1. Reverting: dbsnp automatically is a comp

2. Fixing logic for min Qscore calculation


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3230 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2010-04-21 18:51:35 +00:00
parent 532263ea25
commit e9e844fbf5
3 changed files with 16 additions and 17 deletions

View File

@ -116,7 +116,6 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> {
@Argument(shortName="known", doc="Name of ROD bindings containing variant sites that should be treated as known when splitting eval rods into known and novel subsets", required=false)
protected String[] KNOWN_NAMES = {rodDbSNP.STANDARD_DBSNP_TRACK_NAME};
private Set<String> uniqueKnownNames = new HashSet<String>();
@Argument(shortName="sample", doc="Derive eval and comp contexts using only these sample genotypes, when genotypes are available in the original context", required=false)
protected String[] SAMPLES = {};
@ -264,10 +263,7 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> {
} else if ( d.getName().startsWith("comp") ) {
compNames.add(d.getName());
} else if ( d.getName().startsWith(rodDbSNP.STANDARD_DBSNP_TRACK_NAME) || d.getName().startsWith("hapmap") ) {
// it feels like overkill (i.e. too much output) to include the dbsnp track as
// truth given that it's also used in the known/novel stratification. If this
// becomes useful for some reason, uncomment this line...
uniqueKnownNames.add(d.getName());
compNames.add(d.getName());
} else {
logger.info("Not evaluating ROD binding " + d.getName());
}
@ -466,8 +462,11 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> {
break;
case 2:
VariantContext comp = vcs.get(group.compTrackName);
if ( comp != null && minCompQualScore != NO_MIN_QUAL_SCORE && comp.getNegLog10PError() < (minCompQualScore / 10.0))
comp = null;
if ( comp != null &&
minCompQualScore != NO_MIN_QUAL_SCORE &&
comp.hasNegLog10PError() &&
comp.getNegLog10PError() < (minCompQualScore / 10.0) )
comp = null;
String interesting = evaluation.update2( evalWantsVC ? vc : null, comp, tracker, ref, context );
if ( interesting != null ) interestingReasons.add(interesting);
break;
@ -523,7 +522,9 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> {
if ( vc == null )
return true;
if ( minQualScore != NO_MIN_QUAL_SCORE && vc.getNegLog10PError() < (minQualScore / 10.0)) {
if ( minQualScore != NO_MIN_QUAL_SCORE &&
vc.hasNegLog10PError() &&
vc.getNegLog10PError() < (minQualScore / 10.0) ) {
//System.out.printf("exclude %s%n", vc);
return false;
}
@ -572,7 +573,6 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> {
if ( tracker != null ) {
bindVariantContexts(bindings, evalNames, tracker, context, false);
bindVariantContexts(bindings, compNames, tracker, context, true);
bindVariantContexts(bindings, uniqueKnownNames, tracker, context, true);
}
return bindings;
}

View File

@ -5,9 +5,7 @@ import org.broadinstitute.sting.playground.utils.report.utils.Node;
import org.broadinstitute.sting.utils.StingException;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**

View File

@ -18,8 +18,8 @@ public class VariantEvalIntegrationTest extends WalkerTest {
@Test
public void testVESimple() {
HashMap<String, String> expectations = new HashMap<String, String>();
expectations.put("-L 1:1-10,000,000", "5ea9dd109c45c47243f40af759b36d09");
expectations.put("-L 1:1-10,000,000 -family NA19238+NA19239=NA19240 -MVQ 0", "8b126d445eaec0263d2af6fbfea5ad8b");
expectations.put("-L 1:1-10,000,000", "bb96e002225df21a84ba7c72613cc67a");
expectations.put("-L 1:1-10,000,000 -family NA19238+NA19239=NA19240 -MVQ 0", "7427803b4121665e130c76191f862231");
for ( Map.Entry<String, String> entry : expectations.entrySet() ) {
String extraArgs = entry.getKey();
@ -39,9 +39,10 @@ public class VariantEvalIntegrationTest extends WalkerTest {
" -B dbsnp_130,dbSNP," + GATKDataLocation + "dbsnp_130_b36.rod" +
" -B comp_hapmap,VCF," + validationDataLocation + "CEU_hapmap_nogt_23.vcf";
expectations.put("", "1bc8126366117045bb08872e098502af");
expectations.put(" -known comp_hapmap -known dbsnp", "1bc8126366117045bb08872e098502af");
expectations.put(" -known comp_hapmap", "11e2a3ae77b3ce4b659baa832388f920");
String matchingMD5 = "920940d4006d5d140183f3ba35cafe00";
expectations.put("", matchingMD5);
expectations.put(" -known comp_hapmap -known dbsnp", matchingMD5);
expectations.put(" -known comp_hapmap", "ae9ab5a1556e773b3b1ba80453b14eda");
for ( Map.Entry<String, String> entry : expectations.entrySet() ) {
String extraArgs2 = entry.getKey();
@ -59,7 +60,7 @@ public class VariantEvalIntegrationTest extends WalkerTest {
String extraArgs = "-L 1:1-10,000,000 -family NA19238+NA19239=NA19240 -MVQ 30";
WalkerTestSpec spec = new WalkerTestSpec( root + " " + extraArgs + " -o %s -outputVCF %s",
2,
Arrays.asList("cd4813cc4bcce0f8f81d42bcde11f7ce", "a3ce1d70d8ae3874807e9d61994d42af"));
Arrays.asList("40fca380c2e768cfff5febefc4a73aa0", "a3ce1d70d8ae3874807e9d61994d42af"));
executeTest("testVEWriteVCF", spec);
}
}