Allow multiple records at a position

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5178 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2011-02-03 04:19:05 +00:00
parent cb6454bf98
commit 918cc09477
1 changed files with 14 additions and 23 deletions

View File

@ -33,11 +33,9 @@ import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.contexts.variantcontext.VariantContextUtils; import org.broadinstitute.sting.gatk.contexts.variantcontext.VariantContextUtils;
import org.broadinstitute.sting.gatk.datasources.simpleDataSources.ReferenceOrderedDataSource; import org.broadinstitute.sting.gatk.datasources.simpleDataSources.ReferenceOrderedDataSource;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.refdata.VariantContextAdaptors;
import org.broadinstitute.sting.gatk.walkers.*; import org.broadinstitute.sting.gatk.walkers.*;
import org.broadinstitute.sting.commandline.Argument; import org.broadinstitute.sting.commandline.Argument;
import org.broadinstitute.sting.commandline.Output; import org.broadinstitute.sting.commandline.Output;
import org.broadinstitute.sting.utils.GenomeLoc;
import org.broadinstitute.sting.utils.SampleUtils; import org.broadinstitute.sting.utils.SampleUtils;
import org.broadinstitute.sting.utils.vcf.VCFUtils; import org.broadinstitute.sting.utils.vcf.VCFUtils;
@ -134,7 +132,6 @@ public class VariantFiltrationWalker extends RodWalker<Integer, Integer> {
public Integer reduceInit() { 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 tracker the meta-data tracker
* @param ref the reference base * @param ref the reference base
@ -145,18 +142,11 @@ public class VariantFiltrationWalker extends RodWalker<Integer, Integer> {
if ( tracker == null ) if ( tracker == null )
return 0; return 0;
List<Object> rods = tracker.getReferenceMetaData( INPUT_VARIANT_ROD_BINDING_NAME ); Collection<VariantContext> VCs = tracker.getVariantContexts(ref, INPUT_VARIANT_ROD_BINDING_NAME, null, context.getLocation(), true, false);
// ignore places where we don't have a variant if ( VCs.size() == 0 )
if ( rods.size() == 0 )
return 0;
//VariantContext vc = VariantContextAdaptors.toVariantContext( INPUT_VARIANT_ROD_BINDING_NAME, rods.get(0), ref );
VariantContext vc = tracker.getVariantContext( ref, INPUT_VARIANT_ROD_BINDING_NAME, null, context.getLocation(), true );
// protect against case where we have a variant in context but we're not at the beginning of location
if (vc == null)
return 0; return 0;
for ( VariantContext vc : VCs ) {
FiltrationContext varContext = new FiltrationContext(tracker, ref, vc); FiltrationContext varContext = new FiltrationContext(tracker, ref, vc);
// if we're still initializing the context, do so // if we're still initializing the context, do so
@ -170,6 +160,7 @@ public class VariantFiltrationWalker extends RodWalker<Integer, Integer> {
variantContextWindow.moveWindow(varContext); variantContextWindow.moveWindow(varContext);
filter(); filter();
} }
}
return 1; return 1;
} }