When checking to make sure that we have cached enough data in the PL array, use the converted index value since that's what will be used as an index into the array.

This commit is contained in:
Eric Banks 2012-03-18 00:36:30 -04:00
parent a05a7f287d
commit 344a938a70
1 changed files with 6 additions and 4 deletions

View File

@ -288,11 +288,13 @@ public class GenotypeLikelihoods {
* @return the allele index pair
*/
public static GenotypeLikelihoodsAllelePair getAllelePairUsingDeprecatedOrdering(final int PLindex) {
// make sure that we've cached enough data
if ( PLindex >= PLIndexToAlleleIndex.length )
calculatePLcache(PLindex);
final int convertedIndex = PLindexConversion[PLindex];
return PLIndexToAlleleIndex[PLindexConversion[PLindex]];
// make sure that we've cached enough data
if ( convertedIndex >= PLIndexToAlleleIndex.length )
calculatePLcache(convertedIndex);
return PLIndexToAlleleIndex[convertedIndex];
}
/**