Class FastqScreenPseudoMapReduce


  • public class FastqScreenPseudoMapReduce
    extends fr.ens.biologie.genomique.kenetre.util.PseudoMapReduce
    This class account reads that map to each of the reference genome.
    Since:
    1.0
    Author:
    Sandrine Perrin
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doMap​(File fastqRead1, File fastqRead2, List<String> genomes, String sampleGenome, int threadNumber)
      Mapper Receive value in SAM format, only the read mapped are added in output with reference genome.
      void doMap​(File fastqRead, List<String> genomes, String sampleGenome, int threadNumber)
      Mapper Receive value in SAM format, only the read mapped are added in output with reference genome.
      FastqScreenResult getFastqScreenResult()
      Compile data of fastqscreen in percentage.
      void map​(String value, List<String> output, fr.ens.biologie.genomique.kenetre.util.Reporter reporter)
      Mapper Receive value in SAM format, only the read mapped are added in output with reference genome.
      void reduce​(String key, Iterator<String> values, List<String> output, fr.ens.biologie.genomique.kenetre.util.Reporter reporter)
      Reducer Receive for each read list mapped genome Values first character represent the number of hits for a read : 1 or 2 (for several hits) and the end represent the name of reference genome.
      • Methods inherited from class fr.ens.biologie.genomique.kenetre.util.PseudoMapReduce

        doMap, doMap, doReduce, doReduce, getLogger, getMapOutputTempFile, getMapReduceTemporaryDirectory, getReporter, setMapReduceTemporaryDirectory
    • Constructor Detail

      • FastqScreenPseudoMapReduce

        public FastqScreenPseudoMapReduce​(File tmpDir,
                                          boolean pairedMode,
                                          String mapperName,
                                          String mapperArguments)
                                   throws AozanException
        Public construction. Instantiation the mapper, the mapper name and the mapper arguments must be define together else it uses the default mapper.
        Parameters:
        tmpDir - path to temporary directory
        pairedMode - true if a pair-end run and option paired mode equals true else false
        mapperName - mapper name name can be null
        mapperArguments - mapper arguments can be null
        Throws:
        AozanException - occurs when the instantiation of mapper fails
    • Method Detail

      • doMap

        public void doMap​(File fastqRead,
                          List<String> genomes,
                          String sampleGenome,
                          int threadNumber)
                   throws AozanException
        Mapper Receive value in SAM format, only the read mapped are added in output with reference genome.
        Parameters:
        fastqRead - fastq file
        genomes - list of reference genome
        sampleGenome - genome reference corresponding to sample, can be null
        threadNumber - number threads used for mapping
        Throws:
        AozanException - if an error occurs while mapping
      • doMap

        public void doMap​(File fastqRead1,
                          File fastqRead2,
                          List<String> genomes,
                          String sampleGenome,
                          int threadNumber)
                   throws AozanException
        Mapper Receive value in SAM format, only the read mapped are added in output with reference genome.
        Parameters:
        fastqRead1 - fastq file
        fastqRead2 - fastq file in mode paired
        genomes - list of genome reference
        sampleGenome - genome reference corresponding to sample, can be null
        threadNumber - number threads used for mapping
        Throws:
        AozanException - if an error occurs while mapping
      • map

        public void map​(String value,
                        List<String> output,
                        fr.ens.biologie.genomique.kenetre.util.Reporter reporter)
                 throws IOException
        Mapper Receive value in SAM format, only the read mapped are added in output with reference genome.
        Specified by:
        map in class fr.ens.biologie.genomique.kenetre.util.PseudoMapReduce
        Parameters:
        value - input of the mapper
        output - List of output of the mapper
        reporter - reporter
        Throws:
        IOException - if an error occurs while executing the mapper
      • reduce

        public void reduce​(String key,
                           Iterator<String> values,
                           List<String> output,
                           fr.ens.biologie.genomique.kenetre.util.Reporter reporter)
                    throws IOException
        Reducer Receive for each read list mapped genome Values first character represent the number of hits for a read : 1 or 2 (for several hits) and the end represent the name of reference genome.
        Specified by:
        reduce in class fr.ens.biologie.genomique.kenetre.util.PseudoMapReduce
        Parameters:
        key - input key of the reducer
        values - values for the key
        output - list of output values of the reducer : here not use
        reporter - reporter
        Throws:
        IOException - if an error occurs while executing the reducer
      • getFastqScreenResult

        public FastqScreenResult getFastqScreenResult()
                                               throws AozanException
        Compile data of fastqscreen in percentage.
        Returns:
        FastqScreenResult result of FastqScreen or null if an error occurs during mapped: they are more readsmapped than reads processed
        Throws:
        AozanException