Fixed a bug wherein the residual probability was not being distributed properly when a file had secondary probs and the best and next-best base agreed.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@486 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
kiran 2009-04-21 23:36:09 +00:00
parent 5abfc7d079
commit 0149c887ff
1 changed files with 4 additions and 2 deletions

View File

@ -154,14 +154,16 @@ abstract public class BasicPileup implements Pileup {
if (bestBaseIndex >= 0 && bestBaseIndex < 4) {
dist[readIndex][bestBaseIndex] = QualityUtils.qualToProb(read.getBaseQualities()[offset]);
System.out.println(bestBaseIndex + " " + dist[readIndex][bestBaseIndex]);
byte[] sqs = (byte[]) read.getAttribute("SQ");
if (sqs != null) {
if (sqs != null && QualityUtils.compressedQualityToBaseIndex(sqs[offset]) != bestBaseIndex) {
int secondBestBaseIndex = QualityUtils.compressedQualityToBaseIndex(sqs[offset]);
dist[readIndex][secondBestBaseIndex] = (1.0 - dist[readIndex][bestBaseIndex]);
} else {
for (int baseIndex = 0; baseIndex < 4; baseIndex++) {
if (baseIndex != bestBaseIndex) {
dist[readIndex][baseIndex] = (dist[readIndex][bestBaseIndex]/3.0);
dist[readIndex][baseIndex] = (1.0 - dist[readIndex][bestBaseIndex])/3.0;
}
}
}