Fixed batching bug.

This commit is contained in:
sathibault 2013-07-11 11:08:46 -05:00
parent 82dcdc01c0
commit 7458b59bb3
1 changed files with 19 additions and 7 deletions

View File

@ -113,6 +113,7 @@ public final class CnyPairHMM extends PairHMM implements BatchPairHMM {
} }
public double[] batchGetResult() { public double[] batchGetResult() {
int iii, numHaplotypes;
double[] results; double[] results;
int n = flushQueue(); int n = flushQueue();
@ -123,16 +124,27 @@ public final class CnyPairHMM extends PairHMM implements BatchPairHMM {
resultQueue.push(results); resultQueue.push(results);
} }
final HmmInput test = batchRequests.remove(0); numHaplotypes = 0;
final int numHaplotypes = test.haplotypes.size(); for (Iterator<HmmInput> it=batchRequests.listIterator(); it.hasNext(); ) {
HmmInput h = it.next();
numHaplotypes += h.haplotypes.size();
}
results = new double[numHaplotypes]; results = new double[numHaplotypes];
for (int jjj = 0; jjj < numHaplotypes; jjj++) { iii = 0;
results[jjj] = resultQueue.pop(); while (!batchRequests.isEmpty()) {
if (results[jjj]<-60.0) { HmmInput test = batchRequests.remove(0);
int testSize = test.haplotypes.size();
for (int jjj = 0; jjj < testSize; jjj++) {
results[iii] = resultQueue.pop();
if (results[iii]<-60.0) {
final Haplotype haplotype = test.haplotypes.get(jjj); final Haplotype haplotype = test.haplotypes.get(jjj);
results[jjj]=softHmm(haplotype.getBases(), test.readBases, test.readQuals, test.insertionGOP, test.deletionGOP, test.overallGCP, 0, true); results[iii] = softHmm(haplotype.getBases(), test.readBases, test.readQuals, test.insertionGOP, test.deletionGOP, test.overallGCP, 0, true);
}
iii++;
} }
} }
return results; return results;
} }