Verbose mode shouldn't be printing out 'NaN's and 'Infinity's

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2153 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2009-11-24 22:01:00 +00:00
parent c9ff5f209c
commit 2cb3e53b0b
1 changed files with 13 additions and 3 deletions

View File

@ -284,9 +284,19 @@ public abstract class JointEstimateGenotypeCalculationModel extends GenotypeCalc
if ( altAllele != ref ) {
char base = Character.toLowerCase(altAllele);
int baseIndex = BaseUtils.simpleBaseToBaseIndex(altAllele);
verboseWriter.println("P(f>0)_" + base + " = " + Math.log10(PofFs[baseIndex]));
verboseWriter.println("Qscore_" + base + " = " + (-10.0 * Math.log10(alleleFrequencyPosteriors[baseIndex][0])));
verboseWriter.println("LOD_" + base + " = " + (Math.log10(PofFs[baseIndex]) - Math.log10(alleleFrequencyPosteriors[baseIndex][0])));
if ( MathUtils.compareDoubles(PofFs[baseIndex], 0.0) != 0 ) {
double phredScaledConfidence = -10.0 * Math.log10(alleleFrequencyPosteriors[baseIndex][0]);
if ( Double.isInfinite(phredScaledConfidence) ) {
phredScaledConfidence = -10.0 * log10PofDgivenAFi[baseIndex][0];
verboseWriter.println("P(f>0)_" + base + " = 1");
verboseWriter.println("Qscore_" + base + " = " + phredScaledConfidence);
verboseWriter.println("LOD_" + base + " = " + phredScaledConfidence);
} else {
verboseWriter.println("P(f>0)_" + base + " = " + Math.log10(PofFs[baseIndex]));
verboseWriter.println("Qscore_" + base + " = " + (-10.0 * Math.log10(alleleFrequencyPosteriors[baseIndex][0])));
verboseWriter.println("LOD_" + base + " = " + (Math.log10(PofFs[baseIndex]) - Math.log10(alleleFrequencyPosteriors[baseIndex][0])));
}
}
}
}
verboseWriter.println();