-
- Sequence ds = new Sequence(name,
- AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars,
- this.getSequenceAsString()
- ),
- start,
- end);
- ds.setDescription(description);
+ newend--;
+ } else {
+ int sindex = findIndex(start)-1;
+ if (sindex==s)
+ {
+ // delete characters including start of sequence
+ newstart = findPosition(j);
+ break; // don't need to search for any more residue characters.
+ } else {
+ // delete characters after start.
+ int eindex = findIndex(end)-1;
+ if (eindex<j)
+ {
+ // delete characters at end of sequence
+ newend = findPosition(i-1);
+ break; // don't need to search for any more residue characters.
+ } else {
+ createNewDs=true;
+ newend--; // decrease end position by one for the deleted residue and search further
+ }
+ }