new String(command.string[i]));
int ipos = command.seqs[i].findPosition(start)
- command.seqs[i].getStart();
- tmp.append(oldstring.substring(end));
+ if (end < oldstring.length())
+ {
+ tmp.append(oldstring.substring(end));
+ }
command.seqs[i].setSequence(tmp.toString());
- command.string[i] = oldstring.substring(start, end).toCharArray();
+ command.string[i] = oldstring
+ .substring(start, Math.min(end, oldstring.length()))
+ .toCharArray();
String nogapold = AlignSeq.extractGaps(Comparison.GapChars,
new String(command.string[i]));