Class FastqScreenPseudoMapReduce
- java.lang.Object
-
- fr.ens.biologie.genomique.kenetre.util.PseudoMapReduce
-
- fr.ens.biologie.genomique.aozan.fastqscreen.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
-
-
Constructor Summary
Constructors Constructor Description FastqScreenPseudoMapReduce(File tmpDir, boolean pairedMode, String mapperName, String mapperArguments)
Public construction.
-
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.
-
-
-
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 directorypairedMode
- true if a pair-end run and option paired mode equals true else falsemapperName
- mapper name name can be nullmapperArguments
- 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 filegenomes
- list of reference genomesampleGenome
- genome reference corresponding to sample, can be nullthreadNumber
- 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 filefastqRead2
- fastq file in mode pairedgenomes
- list of genome referencesampleGenome
- genome reference corresponding to sample, can be nullthreadNumber
- 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 classfr.ens.biologie.genomique.kenetre.util.PseudoMapReduce
- Parameters:
value
- input of the mapperoutput
- List of output of the mapperreporter
- 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 classfr.ens.biologie.genomique.kenetre.util.PseudoMapReduce
- Parameters:
key
- input key of the reducervalues
- values for the keyoutput
- list of output values of the reducer : here not usereporter
- 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
-
-