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.utils.BaseUtils;
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.exceptions.StingException;
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) {
if ( value == null || value.vc == null )
if ( value == null )
return sum;
try {
writer.add(value.vc, value.refBase);
writer.add(value, value.refBase);
} 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");
}

View File

@ -110,13 +110,13 @@ public class UGCallVariants extends RodWalker<VariantCallContext, Integer> {
public Integer reduceInit() { return 0; }
public Integer reduce(VariantCallContext value, Integer sum) {
if ( value == null || value.vc == null )
if ( value == null )
return sum;
try {
Map<String, Object> attrs = new HashMap<String, Object>(value.vc.getAttributes());
VariantContextUtils.calculateChromosomeCounts(value.vc, attrs, true);
writer.add(VariantContext.modifyAttributes(value.vc, attrs), value.refBase);
Map<String, Object> attrs = new HashMap<String, Object>(value.getAttributes());
VariantContextUtils.calculateChromosomeCounts(value, attrs, true);
writer.add(VariantContext.modifyAttributes(value, attrs), value.refBase);
} 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");
}

View File

@ -561,14 +561,14 @@ public class MendelianViolationClassifier extends LocusWalker<MendelianViolation
Allele alt = null;
for ( Map.Entry<String,StratifiedAlignmentContext> sEntry : strat.entrySet() ) {
VariantCallContext call = engine.calculateLikelihoodsAndGenotypes(tracker, ref, sEntry.getValue().getContext(StratifiedAlignmentContext.StratifiedContextType.COMPLETE));
if ( call != null && call.confidentlyCalled && call.vc != null ) {
if ( call.vc.isSNP() ) {
if ( ! call.vc.getAlternateAllele(0).basesMatch(var.getAlternateAllele(0))) {
if ( call != null && call.confidentlyCalled ) {
if ( call.isSNP() ) {
if ( ! call.getAlternateAllele(0).basesMatch(var.getAlternateAllele(0))) {
if ( alt == null ) {
alt = call.vc.getAlternateAllele(0);
conf = (int) Math.floor(10*call.vc.getNegLog10PError());
alt = call.getAlternateAllele(0);
conf = (int) Math.floor(10*call.getNegLog10PError());
} 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 ) {
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;
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);
if (calls != null && calls.vc != null && calls.vc.getNSamples() > 0 && calls.confidentlyCalled) {
Genotype evCall = calls.vc.getGenotype(0);
if (calls != null && calls.getNSamples() > 0 && calls.confidentlyCalled) {
Genotype evCall = calls.getGenotype(0);
vcCall = vc.getGenotype(evCall.getSampleName());
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 ) {
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;
if( printStream!= null ) {
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) {
VariantCallContext ugResult = ug.calculateLikelihoodsAndGenotypes(tracker, ref, context);
if (ugResult != null && ugResult.vc != null && ugResult.vc.getNSamples() > 0) {
return ugResult.vc.getGenotype(0).isHet();
if (ugResult != null && ugResult.getNSamples() > 0) {
return ugResult.getGenotype(0).isHet();
}
}