2009-03-16 06:42:24 +08:00
|
|
|
package org.broadinstitute.sting.gatk.walkers;
|
|
|
|
|
|
|
|
|
|
import org.broadinstitute.sting.gatk.LocusContext;
|
|
|
|
|
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedDatum;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Created by IntelliJ IDEA.
|
|
|
|
|
* User: mdepristo
|
|
|
|
|
* Date: Feb 22, 2009
|
|
|
|
|
* Time: 3:22:14 PM
|
|
|
|
|
* To change this template use File | Settings | File Templates.
|
|
|
|
|
*/
|
2009-03-27 00:22:35 +08:00
|
|
|
public class DepthOfCoverageWalker extends LocusWalker<Integer, Integer> {
|
2009-03-16 06:42:24 +08:00
|
|
|
public Integer map(List<ReferenceOrderedDatum> rodData, char ref, LocusContext context) {
|
|
|
|
|
System.out.printf("%s: %d%n", context.getLocation(), context.getReads().size() );
|
2009-03-25 11:12:54 +08:00
|
|
|
return 1;
|
2009-03-16 06:42:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Integer reduceInit() { return 0; }
|
|
|
|
|
|
|
|
|
|
public Integer reduce(Integer value, Integer sum) {
|
|
|
|
|
return value + sum;
|
|
|
|
|
}
|
|
|
|
|
}
|