+ startRes = seqs[i].getStart();
+ endRes = seqs[i].getEnd();
+ if (startEnd != null)
+ {
+ startIndex = startEnd[0];
+ endIndex = startEnd[1];
+ // get first non-gaped residue start position
+ while (jalview.util.Comparison.isGap(seqs[i]
+ .getCharAt(startIndex)) && startIndex < endIndex)
+ {
+ startIndex++;
+ }
+
+ // get last non-gaped residue end position
+ while (jalview.util.Comparison.isGap(seqs[i].getCharAt(endIndex))
+ && endIndex > startIndex)
+ {
+ endIndex--;
+ }
+
+ startRes = seqs[i].findPosition(startIndex);
+ endRes = seqs[i].findPosition(endIndex);
+ }
+