Fixed merge conflict to Unstable

This commit is contained in:
Guillermo del Angel 2011-11-22 14:39:45 -05:00
commit 38a90da92c
1 changed files with 38 additions and 30 deletions

View File

@ -556,10 +556,16 @@ public class PairHMMIndelErrorModel {
long indStart = start - haplotype.getStartPosition(); long indStart = start - haplotype.getStartPosition();
long indStop = stop - haplotype.getStartPosition(); long indStop = stop - haplotype.getStartPosition();
double readLikelihood;
if (indStart < 0 || indStop >= haplotype.getBases().length) {
// read spanned more than allowed reference context: we currently can't deal with this
readLikelihood =0;
} else
{
final byte[] haplotypeBases = Arrays.copyOfRange(haplotype.getBases(), final byte[] haplotypeBases = Arrays.copyOfRange(haplotype.getBases(),
(int)indStart, (int)indStop); (int)indStart, (int)indStop);
double readLikelihood;
if (matchMetricArray == null) { if (matchMetricArray == null) {
final int X_METRIC_LENGTH = readBases.length+1; final int X_METRIC_LENGTH = readBases.length+1;
final int Y_METRIC_LENGTH = haplotypeBases.length+1; final int Y_METRIC_LENGTH = haplotypeBases.length+1;
@ -585,12 +591,14 @@ public class PairHMMIndelErrorModel {
readLikelihood = computeReadLikelihoodGivenHaplotypeAffineGaps(haplotypeBases, readBases, readQuals, readLikelihood = computeReadLikelihoodGivenHaplotypeAffineGaps(haplotypeBases, readBases, readQuals,
currentContextGOP, currentContextGCP, startIdx, matchMetricArray, XMetricArray, YMetricArray); currentContextGOP, currentContextGCP, startIdx, matchMetricArray, XMetricArray, YMetricArray);
if (DEBUG) { if (DEBUG) {
System.out.println("H:"+new String(haplotypeBases)); System.out.println("H:"+new String(haplotypeBases));
System.out.println("R:"+new String(readBases)); System.out.println("R:"+new String(readBases));
System.out.format("L:%4.2f\n",readLikelihood); System.out.format("L:%4.2f\n",readLikelihood);
System.out.format("StPos:%d\n", startIdx); System.out.format("StPos:%d\n", startIdx);
} }
}
readEl.put(a,readLikelihood); readEl.put(a,readLikelihood);
readLikelihoods[readIdx][j++] = readLikelihood; readLikelihoods[readIdx][j++] = readLikelihood;
} }