- No longer prints out non confident calls (they were leading to tables that don't add up and confusing some Pacbio folk).

- Added sensitivity and Specificity to the report.
- With the changes in genotype likelihoods, the indel analysis only happens if the BAM file also has an extended event. Not great, but at least it's not broken.


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5759 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
carneiro 2011-05-04 19:26:55 +00:00
parent 4d251fb91f
commit b66c6dced1
1 changed files with 13 additions and 2 deletions

View File

@ -156,6 +156,7 @@ public class GenotypeAndValidateWalker extends RodWalker<GenotypeAndValidateWalk
if (emitConf >= 0) uac.STANDARD_CONFIDENCE_FOR_EMITTING = emitConf; if (emitConf >= 0) uac.STANDARD_CONFIDENCE_FOR_EMITTING = emitConf;
if (callConf >= 0) uac.STANDARD_CONFIDENCE_FOR_CALLING = callConf; if (callConf >= 0) uac.STANDARD_CONFIDENCE_FOR_CALLING = callConf;
uac.GLmodel = GenotypeLikelihoodsCalculationModel.Model.SNP;
snpEngine = new UnifiedGenotyperEngine(getToolkit(), uac); snpEngine = new UnifiedGenotyperEngine(getToolkit(), uac);
// Adding the INDEL calling arguments for UG // Adding the INDEL calling arguments for UG
@ -205,6 +206,9 @@ public class GenotypeAndValidateWalker extends RodWalker<GenotypeAndValidateWalk
return counter; return counter;
} }
boolean writeVariant = true;
if (bamIsTruth) { if (bamIsTruth) {
if (call.confidentlyCalled) { if (call.confidentlyCalled) {
// If truth is a confident REF call // If truth is a confident REF call
@ -224,6 +228,7 @@ public class GenotypeAndValidateWalker extends RodWalker<GenotypeAndValidateWalk
} }
else { else {
counter.nNotConfidentCalls = 1L; counter.nNotConfidentCalls = 1L;
writeVariant = false;
} }
} }
else { else {
@ -246,10 +251,11 @@ public class GenotypeAndValidateWalker extends RodWalker<GenotypeAndValidateWalk
} }
else { else {
counter.nNotConfidentCalls = 1L; counter.nNotConfidentCalls = 1L;
writeVariant = false;
} }
} }
if (vcfWriter != null) { if (vcfWriter != null && writeVariant) {
if (!vcComp.hasAttribute("callStatus")) { if (!vcComp.hasAttribute("callStatus")) {
MutableVariantContext mvc = new MutableVariantContext(vcComp); MutableVariantContext mvc = new MutableVariantContext(vcComp);
mvc.putAttribute("callStatus", call.isCalledAlt(callConf) ? "ALT" : "REF" ); mvc.putAttribute("callStatus", call.isCalledAlt(callConf) ? "ALT" : "REF" );
@ -284,6 +290,8 @@ public class GenotypeAndValidateWalker extends RodWalker<GenotypeAndValidateWalk
public void onTraversalDone( CountedData reduceSum ) { public void onTraversalDone( CountedData reduceSum ) {
double ppv = 100 * ((double) reduceSum.nAltCalledAlt /( reduceSum.nAltCalledAlt + reduceSum.nRefCalledAlt)); double ppv = 100 * ((double) reduceSum.nAltCalledAlt /( reduceSum.nAltCalledAlt + reduceSum.nRefCalledAlt));
double npv = 100 * ((double) reduceSum.nRefCalledRef /( reduceSum.nRefCalledRef + reduceSum.nAltCalledRef)); double npv = 100 * ((double) reduceSum.nRefCalledRef /( reduceSum.nRefCalledRef + reduceSum.nAltCalledRef));
double sensitivity = 100 * ((double) reduceSum.nAltCalledAlt /( reduceSum.nAltCalledAlt + reduceSum.nAltCalledRef));
double specificity = (reduceSum.nRefCalledRef + reduceSum.nRefCalledAlt > 0) ? 100 * ((double) reduceSum.nRefCalledRef /( reduceSum.nRefCalledRef + reduceSum.nRefCalledAlt)) : 100;
logger.info(String.format("Resulting Truth Table Output\n\n" + logger.info(String.format("Resulting Truth Table Output\n\n" +
"---------------------------------------------------\n" + "---------------------------------------------------\n" +
"\t\t|\tALT\t|\tREF\t\n" + "\t\t|\tALT\t|\tREF\t\n" +
@ -294,8 +302,11 @@ public class GenotypeAndValidateWalker extends RodWalker<GenotypeAndValidateWalk
"positive predictive value: %f%%\n" + "positive predictive value: %f%%\n" +
"negative predictive value: %f%%\n" + "negative predictive value: %f%%\n" +
"---------------------------------------------------\n" + "---------------------------------------------------\n" +
"sensitivity: %f%%\n" +
"specificity: %f%%\n" +
"---------------------------------------------------\n" +
"not confident: %d\n" + "not confident: %d\n" +
"not covered: %d\n" + "not covered: %d\n" +
"---------------------------------------------------\n", reduceSum.nAltCalledAlt, reduceSum.nRefCalledAlt, reduceSum.nAltCalledRef, reduceSum.nRefCalledRef, ppv, npv, reduceSum.nNotConfidentCalls, reduceSum.nUncovered)); "---------------------------------------------------\n", reduceSum.nAltCalledAlt, reduceSum.nRefCalledAlt, reduceSum.nAltCalledRef, reduceSum.nRefCalledRef, ppv, npv, sensitivity, specificity, reduceSum.nNotConfidentCalls, reduceSum.nUncovered));
} }
} }