lib: fix HGVS insertion 3 prime rule on the edge of the transcript
@@ -420,6 +420,7 @@ public class HgvsProteinCalculator {
// keep moving to the right (3' Rule) while the first amino acid deleted equals the first one after deletion,
// Example: check 11:6390701:-:CTGGCGCTGGCG
+ if (aminoacidPosition - 1 < transcript.getProteinSequence().length()) {
String aaAfterInsertion = transcript.getProteinSequence().substring(aminoacidPosition - 1, aminoacidPosition);
while (codedAminoacids.get(0).equals(aaAfterInsertion)) {
aminoacidPosition++;
@@ -429,6 +430,7 @@ public class HgvsProteinCalculator {
codedAminoacids.add(aaAfterInsertion);
aaAfterInsertion = transcript.getProteinSequence().substring(aminoacidPosition - 1, aminoacidPosition);
}
+ }
// Get position and flanking amino acids
int codonIndex = aminoacidPosition - 1;
