Fix to isReference() in VCFRecord. Change to VariantCounter to correctly counter only non-genotype variants, as well as update to VariantEvalWalker

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2531 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
depristo 2010-01-07 00:03:29 +00:00
parent 6c4ac9e663
commit 7215526810
3 changed files with 11 additions and 3 deletions

View File

@ -29,7 +29,7 @@ public class VariantCounter extends BasicVariantAnalysis implements GenotypeAnal
} }
public String update(Variation eval, RefMetaDataTracker tracker, char ref, AlignmentContext context) { public String update(Variation eval, RefMetaDataTracker tracker, char ref, AlignmentContext context) {
nSNPs += eval == null ? 0 : 1; nSNPs += eval == null || eval.isReference()? 0 : 1;
// TODO -- break the het check out to a different module used only for single samples // TODO -- break the het check out to a different module used only for single samples

View File

@ -229,7 +229,12 @@ public class VCFRecord implements Variation, VariantBackedByGenotype {
} }
public boolean hasAlternateAllele() { public boolean hasAlternateAllele() {
return getAlternateAlleles().size() > 0; for ( VCFGenotypeEncoding alt : this.mAlts ) {
if ( alt.getType() != VCFGenotypeEncoding.TYPE.UNCALLED )
return true;
}
return false;
} }
public boolean isBiallelic() { public boolean isBiallelic() {
@ -279,6 +284,9 @@ public class VCFRecord implements Variation, VariantBackedByGenotype {
switch ( type ) { switch ( type ) {
case SINGLE_BASE: case SINGLE_BASE:
return VARIANT_TYPE.SNP; return VARIANT_TYPE.SNP;
case UNCALLED:
// If there are no alt alleles, all of the genotypes are reference or no calls, so we're a reference site
return VARIANT_TYPE.REFERENCE;
case DELETION: case DELETION:
return VARIANT_TYPE.DELETION; return VARIANT_TYPE.DELETION;
case INSERTION: case INSERTION:

View File

@ -116,7 +116,7 @@ public class VariantEvalWalkerIntegrationTest extends WalkerTest {
@Test @Test
public void testEvalGenotypeROD() { public void testEvalGenotypeROD() {
List<String> md5 = new ArrayList<String>(); List<String> md5 = new ArrayList<String>();
md5.add("978176e0b369c08c041a66045e995129"); md5.add("010d1c7ce773b39f3de1355eb9682e4d");
/** /**
* the above MD5 was calculated after running the following command: * the above MD5 was calculated after running the following command:
* *