A very simple walker to print out (using the ROD's toString method) all of

the RODs it sees.  This is the easiest solution to get around the (temporary)
bug of reads being seen multiple times by reads walkers when close intervals
are passed to them (i.e. process full contigs and then use a ref walker to
filter the ones within your intervals of choice)


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1273 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2009-07-17 14:03:34 +00:00
parent 129ad97ce5
commit f978b04633
1 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,47 @@
package org.broadinstitute.sting.playground.gatk.walkers;
import org.broadinstitute.sting.gatk.LocusContext;
import org.broadinstitute.sting.gatk.refdata.*;
import org.broadinstitute.sting.gatk.walkers.*;
/**
* PrintRODsWalker prints out all of the RODs that it sees (using the ROD's toString method)
*/
@Requires(value={DataSource.REFERENCE},referenceMetaData=@RMD(name="variant",type=ReferenceOrderedDatum.class))
public class PrintRODsWalker extends RefWalker<Integer, Integer> {
/**
* Initialize the number of loci processed to zero.
*
* @return 0
*/
public Integer reduceInit() { return 0; }
/**
* For each site of interest, rescore the genotype likelihoods by applying the specified feature set.
*
* @param tracker the meta-data tracker
* @param ref the reference base
* @param context the context for the given locus
* @return 1 if the locus was successfully processed, 0 if otherwise
*/
public Integer map(RefMetaDataTracker tracker, char ref, LocusContext context) {
ReferenceOrderedDatum variant = tracker.lookup("variant", null);
if (variant != null )
out.println(variant);
return 1;
}
/**
* Increment the number of rods processed.
*
* @param value result of the map.
* @param sum accumulator for the reduce.
* @return the new number of rods processed.
*/
public Integer reduce(Integer value, Integer sum) {
return sum + value;
}
}