2009-03-16 06:42:24 +08:00
|
|
|
package org.broadinstitute.sting.gatk.walkers;
|
|
|
|
|
|
|
|
|
|
import net.sf.samtools.SAMRecord;
|
|
|
|
|
import org.broadinstitute.sting.gatk.LocusContext;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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-03-27 21:44:46 +08:00
|
|
|
public abstract class ReadWalker<MapType, ReduceType> extends Walker<ReduceType> {
|
2009-03-27 00:22:35 +08:00
|
|
|
public boolean requiresOrderedReads() { return false; }
|
2009-03-16 06:42:24 +08:00
|
|
|
|
|
|
|
|
// Do we actually want to operate on the context?
|
2009-03-27 00:22:35 +08:00
|
|
|
public boolean filter(LocusContext context, SAMRecord read) {
|
|
|
|
|
// We are keeping all the reads
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2009-03-16 06:42:24 +08:00
|
|
|
|
|
|
|
|
// Map over the org.broadinstitute.sting.gatk.LocusContext
|
2009-03-27 00:22:35 +08:00
|
|
|
public abstract MapType map(LocusContext context, SAMRecord read);
|
2009-03-16 06:42:24 +08:00
|
|
|
|
|
|
|
|
// Given result of map function
|
2009-03-27 00:22:35 +08:00
|
|
|
public abstract ReduceType reduceInit();
|
|
|
|
|
public abstract ReduceType reduce(MapType value, ReduceType sum);
|
2009-03-16 06:42:24 +08:00
|
|
|
}
|