diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CountVariants.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CountVariants.java index b356a68dc..711ed9e04 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CountVariants.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/evaluators/CountVariants.java @@ -99,22 +99,24 @@ public class CountVariants extends VariantEvaluator implements StandardEval { // This is really not correct. What we really want here is a polymorphic vs. monomorphic count (i.e. on the Genotypes). // So in order to maintain consistency with the previous implementation (and the intention of the original author), I've // added in a proxy check for monomorphic status here. - if ( !vc1.isVariant() || (vc1.hasGenotypes() && vc1.getHomRefCount() == vc1.getNSamples()) ) { + if ( !vc1.isVariant() || (vc1.hasGenotypes() && vc1.getHomRefCount() + vc1.getNoCallCount() == vc1.getNSamples()) ) { nRefLoci++; } else { - nVariantLoci++; - switch (vc1.getType()) { + switch (vc1.getType()) { case NO_VARIATION: break; case SNP: + nVariantLoci++; nSNPs++; if (vc1.getAttributeAsBoolean("ISSINGLETON")) nSingletons++; break; case MNP: + nVariantLoci++; nMNPs++; if (vc1.getAttributeAsBoolean("ISSINGLETON")) nSingletons++; break; case INDEL: + nVariantLoci++; if (vc1.isSimpleInsertion()) nInsertions++; else if (vc1.isSimpleDeletion()) @@ -123,6 +125,7 @@ public class CountVariants extends VariantEvaluator implements StandardEval { nComplex++; break; case MIXED: + nVariantLoci++; nMixed++; break; default: diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTable.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTable.java index 7903be507..19db58e0c 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTable.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTable.java @@ -206,28 +206,12 @@ public class VariantsToTable extends RodWalker { } if (field.equals("AF") || field.equals("AC")) { - String afo = val; - - double af=0; - if (afo.contains(",")) { - String[] afs = afo.split(","); - afs[0] = afs[0].substring(1,afs[0].length()); - afs[afs.length-1] = afs[afs.length-1].substring(0,afs[afs.length-1].length()-1); - - double[] afd = new double[afs.length]; - - for (int k=0; k < afd.length; k++) - afd[k] = Double.valueOf(afs[k]); - - af = MathUtils.arrayMax(afd); - //af = Double.valueOf(afs[0]); - - } - else - if (!afo.equals("NA")) - af = Double.valueOf(afo); - - val = Double.toString(af); + if (val.contains(",")) { + // strip [,] and spaces + val = val.replace("[",""); + val = val.replace("]",""); + val = val.replace(" ",""); + } } vals.add(val);