2009-05-01 06:16:21 +08:00
|
|
|
package org.broadinstitute.sting.gatk.walkers;
|
|
|
|
|
|
|
|
|
|
import org.broadinstitute.sting.gatk.LocusContext;
|
|
|
|
|
import org.broadinstitute.sting.utils.GenomeLoc;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import net.sf.samtools.SAMRecord;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Created by IntelliJ IDEA.
|
|
|
|
|
* User: mdepristo
|
|
|
|
|
* Date: Feb 22, 2009
|
|
|
|
|
* Time: 2:52:28 PM
|
|
|
|
|
* To change this template use File | Settings | File Templates.
|
|
|
|
|
*/
|
2009-05-20 07:26:17 +08:00
|
|
|
@Requires({DataSource.READS,DataSource.REFERENCE})
|
2009-05-01 06:16:21 +08:00
|
|
|
public abstract class DuplicateWalker<MapType, ReduceType> extends Walker<MapType, ReduceType> {
|
|
|
|
|
// Do we actually want to operate on the context?
|
2009-05-22 06:26:57 +08:00
|
|
|
public boolean filter(GenomeLoc loc, byte[] refBases, LocusContext context,
|
|
|
|
|
List<SAMRecord> uniqueReads,
|
|
|
|
|
List<SAMRecord> duplicateReads) {
|
2009-05-01 06:16:21 +08:00
|
|
|
return true; // We are keeping all the reads
|
|
|
|
|
}
|
|
|
|
|
|
2009-05-08 02:06:02 +08:00
|
|
|
/**
|
|
|
|
|
* Called by the traversal engine to decide whether to send non-duplicates as lists of
|
|
|
|
|
* singleton reads to the map function. By default it's false.
|
2009-05-22 06:26:57 +08:00
|
|
|
*
|
2009-05-08 02:06:02 +08:00
|
|
|
* @return true if you want to see non duplicates during the traversal
|
|
|
|
|
*/
|
|
|
|
|
public boolean mapUniqueReadsTooP() { return false; }
|
|
|
|
|
|
2009-05-22 06:26:57 +08:00
|
|
|
public abstract MapType map(GenomeLoc loc, byte[] refBases, LocusContext context,
|
|
|
|
|
List<SAMRecord> uniqueReads,
|
|
|
|
|
List<SAMRecord> duplicateReads);
|
2009-05-01 06:16:21 +08:00
|
|
|
|
|
|
|
|
// Given result of map function
|
|
|
|
|
public abstract ReduceType reduceInit();
|
|
|
|
|
public abstract ReduceType reduce(MapType value, ReduceType sum);
|
|
|
|
|
}
|