From 7da9ff2a9ecafbee52d2957e62a20a54dc67bf51 Mon Sep 17 00:00:00 2001 From: ebanks Date: Fri, 18 Sep 2009 16:03:54 +0000 Subject: [PATCH] Put back the check that both chip and variant are not null. Also, sanity check that ref is not 'N'. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1651 348d0f76-0448-11de-a6fe-93d51630548a --- .../gatk/walkers/varianteval/GenotypeConcordance.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/varianteval/GenotypeConcordance.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/varianteval/GenotypeConcordance.java index f33500acf..0dfaae88e 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/varianteval/GenotypeConcordance.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/varianteval/GenotypeConcordance.java @@ -2,6 +2,7 @@ package org.broadinstitute.sting.playground.gatk.walkers.varianteval; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.utils.BaseUtils; import org.broadinstitute.sting.utils.StingException; import org.broadinstitute.sting.utils.genotype.DiploidGenotype; import org.broadinstitute.sting.utils.genotype.VariantBackedByGenotype; @@ -49,6 +50,10 @@ public class GenotypeConcordance extends BasicVariantAnalysis implements Genotyp if ((chip != null && !(chip instanceof VariantBackedByGenotype) || (eval != null && !(eval instanceof VariantBackedByGenotype)))) throw new StingException("Failure: trying to analyze genotypes of non-genotype data"); + // This shouldn't happen, but let's check anyways + if ( BaseUtils.simpleBaseToBaseIndex(ref) == -1 ) + return; + DiploidGenotype g = DiploidGenotype.createHomGenotype(ref); int truthIndex, callIndex; if (chip == null) @@ -79,7 +84,8 @@ public class GenotypeConcordance extends BasicVariantAnalysis implements Genotyp public String update(Variation eval, RefMetaDataTracker tracker, char ref, AlignmentContext context) { Variation chip = (Variation) tracker.lookup(dbName, null); - inc(chip, eval, ref); + if ( eval != null || chip != null ) + inc(chip, eval, ref); return null; }