Skip to content
This repository was archived by the owner on May 22, 2026. It is now read-only.

Commit 09ee7f3

Browse files
committed
Fixed StringIndexOutOfBoundsException in modifyCigar().
Test case updated.
1 parent a3a6c51 commit 09ee7f3

3 files changed

Lines changed: 6 additions & 5 deletions

src/main/java/com/astrazeneca/vardict/modules/CigarUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,10 @@ public static Tuple.Tuple2<Integer, String> modifyCigar(int indel,
460460
if (!ref.containsKey(refoff - rrn - 1)) {
461461
break;
462462
}
463-
if (isHasAndNotEquals(ref, refoff - rrn - 1, querySeq, rdoff - rrn - 1)) {
463+
if (rrn < rdoff && isHasAndNotEquals(ref, refoff - rrn - 1, querySeq, rdoff - rrn - 1)) {
464464
rn = rrn + 1;
465465
rmch = 0;
466-
} else if (isHasAndEquals(ref, refoff - rrn - 1, querySeq, rdoff - rrn - 1)) {
466+
} else if (rrn < rdoff && isHasAndEquals(ref, refoff - rrn - 1, querySeq, rdoff - rrn - 1)) {
467467
rmch++;
468468
}
469469
rrn++;
@@ -500,10 +500,10 @@ public static Tuple.Tuple2<Integer, String> modifyCigar(int indel,
500500
if (!ref.containsKey(refoff - rrn - 1)) {
501501
break;
502502
}
503-
if (isHasAndNotEquals(ref, refoff - rrn - 1, querySeq, rdoff - rrn - 1)) {
503+
if (rrn < rdoff && isHasAndNotEquals(ref, refoff - rrn - 1, querySeq, rdoff - rrn - 1)) {
504504
rn = rrn + 1;
505505
rmch = 0;
506-
} else if (isHasAndEquals(ref, refoff - rrn - 1, querySeq, rdoff - rrn - 1)) {
506+
} else if (rrn < rdoff && isHasAndEquals(ref, refoff - rrn - 1, querySeq, rdoff - rrn - 1)) {
507507
rmch++;
508508
}
509509
rrn++;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Somatic,hs38DH.fa,172T_S8.final.chr1_sliced_SOOBE.bam|172N_S7.final.chr1_sliced_SOOBE.bam,chr1,11182030,11182188
2+
172T_S8.final.chr1_sliced_SOOBE testbed 1 11182181 11182181 A G 359 5 132 221 2 3 A/G 0.0139 2;2 32.8 1 37.8 1 60.0 10.000 0.0144 0 1.2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1.000 1 GGATGACAGCGTATCTCTGG TGCTGGCGCCCACAGAAAAG 1:11182031-11182188 SampleSpecific SNV 0 0 0 0

testdata/integrationtestcases/Somatic;hs38DH.fa;172T_S8.final.chr1_sliced_SOOBE.bam-172N_S7.final.chr1_sliced_SOOBE.bam;chr1;11182141-11182143;;.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)