Updating other walkers now that VCC extends from VC

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5486 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2011-03-22 03:10:40 +00:00
parent 0ee687e49d
commit 1a9e65bcd4
8 changed files with 19 additions and 21 deletions

View File

@ -33,8 +33,6 @@ import org.broadinstitute.sting.gatk.walkers.indels.HaplotypeIndelErrorModel;
import org.broadinstitute.sting.gatk.walkers.indels.PairHMMIndelErrorModel; import org.broadinstitute.sting.gatk.walkers.indels.PairHMMIndelErrorModel;
import org.broadinstitute.sting.utils.BaseUtils; import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.GenomeLoc;
import org.broadinstitute.sting.utils.GenomeLocParser;
import org.broadinstitute.sting.utils.baq.BAQ;
import org.broadinstitute.sting.utils.collections.Pair; import org.broadinstitute.sting.utils.collections.Pair;
import org.broadinstitute.sting.utils.exceptions.StingException; import org.broadinstitute.sting.utils.exceptions.StingException;
import org.broadinstitute.sting.utils.genotype.Haplotype; import org.broadinstitute.sting.utils.genotype.Haplotype;

View File

@ -111,11 +111,11 @@ public class UGCalcLikelihoods extends LocusWalker<VariantCallContext, Integer>
} }
public Integer reduce(VariantCallContext value, Integer sum) { public Integer reduce(VariantCallContext value, Integer sum) {
if ( value == null || value.vc == null ) if ( value == null )
return sum; return sum;
try { try {
writer.add(value.vc, value.refBase); writer.add(value, value.refBase);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
throw new IllegalArgumentException(e.getMessage() + "; this is often caused by using the --assume_single_sample_reads argument with the wrong sample name"); throw new IllegalArgumentException(e.getMessage() + "; this is often caused by using the --assume_single_sample_reads argument with the wrong sample name");
} }

View File

@ -110,13 +110,13 @@ public class UGCallVariants extends RodWalker<VariantCallContext, Integer> {
public Integer reduceInit() { return 0; } public Integer reduceInit() { return 0; }
public Integer reduce(VariantCallContext value, Integer sum) { public Integer reduce(VariantCallContext value, Integer sum) {
if ( value == null || value.vc == null ) if ( value == null )
return sum; return sum;
try { try {
Map<String, Object> attrs = new HashMap<String, Object>(value.vc.getAttributes()); Map<String, Object> attrs = new HashMap<String, Object>(value.getAttributes());
VariantContextUtils.calculateChromosomeCounts(value.vc, attrs, true); VariantContextUtils.calculateChromosomeCounts(value, attrs, true);
writer.add(VariantContext.modifyAttributes(value.vc, attrs), value.refBase); writer.add(VariantContext.modifyAttributes(value, attrs), value.refBase);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
throw new IllegalArgumentException(e.getMessage() + "; this is often caused by using the --assume_single_sample_reads argument with the wrong sample name"); throw new IllegalArgumentException(e.getMessage() + "; this is often caused by using the --assume_single_sample_reads argument with the wrong sample name");
} }

View File

@ -561,14 +561,14 @@ public class MendelianViolationClassifier extends LocusWalker<MendelianViolation
Allele alt = null; Allele alt = null;
for ( Map.Entry<String,StratifiedAlignmentContext> sEntry : strat.entrySet() ) { for ( Map.Entry<String,StratifiedAlignmentContext> sEntry : strat.entrySet() ) {
VariantCallContext call = engine.calculateLikelihoodsAndGenotypes(tracker, ref, sEntry.getValue().getContext(StratifiedAlignmentContext.StratifiedContextType.COMPLETE)); VariantCallContext call = engine.calculateLikelihoodsAndGenotypes(tracker, ref, sEntry.getValue().getContext(StratifiedAlignmentContext.StratifiedContextType.COMPLETE));
if ( call != null && call.confidentlyCalled && call.vc != null ) { if ( call != null && call.confidentlyCalled ) {
if ( call.vc.isSNP() ) { if ( call.isSNP() ) {
if ( ! call.vc.getAlternateAllele(0).basesMatch(var.getAlternateAllele(0))) { if ( ! call.getAlternateAllele(0).basesMatch(var.getAlternateAllele(0))) {
if ( alt == null ) { if ( alt == null ) {
alt = call.vc.getAlternateAllele(0); alt = call.getAlternateAllele(0);
conf = (int) Math.floor(10*call.vc.getNegLog10PError()); conf = (int) Math.floor(10*call.getNegLog10PError());
} else { } else {
conf += (int) Math.floor(10*call.vc.getNegLog10PError()); conf += (int) Math.floor(10*call.getNegLog10PError());
} }
} }
} }

View File

@ -199,10 +199,10 @@ public class LocusMismatchWalker extends LocusWalker<String,Integer> implements
private Genotype getGenotype( RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context ) { private Genotype getGenotype( RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context ) {
VariantCallContext calls = ug.calculateLikelihoodsAndGenotypes(tracker,ref,context); VariantCallContext calls = ug.calculateLikelihoodsAndGenotypes(tracker,ref,context);
if ( calls == null || calls.vc == null || calls.vc.getNSamples() == 0 || !calls.vc.isSNP() ) if ( calls == null || calls.getNSamples() == 0 || !calls.isSNP() )
return null; return null;
else { else {
return calls.vc.getGenotype(0); return calls.getGenotype(0);
} }
} }

View File

@ -120,8 +120,8 @@ public class SnpCallRateByCoverageWalker extends LocusWalker<List<String>, Strin
VariantCallContext calls = UG.calculateLikelihoodsAndGenotypes(tracker, ref, subContext); VariantCallContext calls = UG.calculateLikelihoodsAndGenotypes(tracker, ref, subContext);
if (calls != null && calls.vc != null && calls.vc.getNSamples() > 0 && calls.confidentlyCalled) { if (calls != null && calls.getNSamples() > 0 && calls.confidentlyCalled) {
Genotype evCall = calls.vc.getGenotype(0); Genotype evCall = calls.getGenotype(0);
vcCall = vc.getGenotype(evCall.getSampleName()); vcCall = vc.getGenotype(evCall.getSampleName());
if ((evCall.isHet() || evCall.isHomVar()) && (vcCall.isHet() || vcCall.isHomVar())) { if ((evCall.isHet() || evCall.isHomVar()) && (vcCall.isHet() || vcCall.isHomVar())) {

View File

@ -178,7 +178,7 @@ public class ValidationGenotyper extends LocusWalker<ValidationGenotyper.Counted
} }
else if( evalStatus == VARIANT_STATUS.CALLED && compStatus == VARIANT_STATUS.MISSING ) { else if( evalStatus == VARIANT_STATUS.CALLED && compStatus == VARIANT_STATUS.MISSING ) {
VariantCallContext call = engine.calculateLikelihoodsAndGenotypes(tracker, ref, context); VariantCallContext call = engine.calculateLikelihoodsAndGenotypes(tracker, ref, context);
if( call != null && call.confidentlyCalled && call.vc != null && call.vc.getType() == VariantContext.Type.NO_VARIATION ) { if( call != null && call.confidentlyCalled && call.getType() == VariantContext.Type.NO_VARIATION ) {
counter.numFP = 1L; counter.numFP = 1L;
if( printStream!= null ) { if( printStream!= null ) {
printStream.println(vcEval.getChr() + ":" + vcEval.getStart() ); // Used to create interval lists of FP variants printStream.println(vcEval.getChr() + ":" + vcEval.getStart() ); // Used to create interval lists of FP variants

View File

@ -109,8 +109,8 @@ public class FindContaminatingReadGroupsWalker extends LocusWalker<Integer, Inte
if (altBalance > 0.70) { if (altBalance > 0.70) {
VariantCallContext ugResult = ug.calculateLikelihoodsAndGenotypes(tracker, ref, context); VariantCallContext ugResult = ug.calculateLikelihoodsAndGenotypes(tracker, ref, context);
if (ugResult != null && ugResult.vc != null && ugResult.vc.getNSamples() > 0) { if (ugResult != null && ugResult.getNSamples() > 0) {
return ugResult.vc.getGenotype(0).isHet(); return ugResult.getGenotype(0).isHet();
} }
} }