Bug fix: if we're genotyping a very long indel (>100 bp) fail gracefully instead of with an array out of bounds exception
This commit is contained in:
parent
06f12eca56
commit
224574424e
|
|
@ -133,8 +133,12 @@ public class Haplotype {
|
|||
|
||||
|
||||
byte[] basesBeforeVariant = Arrays.copyOfRange(refBases,startIdxInReference,startIdxInReference+numPrefBases);
|
||||
int startAfter = startIdxInReference+numPrefBases+ refAllele.getBases().length;
|
||||
// protect against long events that overrun available reference context
|
||||
if (startAfter > refBases.length)
|
||||
startAfter = refBases.length;
|
||||
byte[] basesAfterVariant = Arrays.copyOfRange(refBases,
|
||||
startIdxInReference+numPrefBases+ refAllele.getBases().length, refBases.length);
|
||||
startAfter, refBases.length);
|
||||
|
||||
|
||||
// Create location for all haplotypes
|
||||
|
|
|
|||
Loading…
Reference in New Issue