edits = new Edit[0];\r
\r
boolean delete = true;\r
- for (int i = start; i <= end; i++)\r
+ for (int i = start; i < end; i++)\r
{\r
delete = true;\r
\r
{\r
//This is for empty columns at the\r
//end of the alignment\r
- int width = end-endCol;\r
-\r
- if(endCol==-1)\r
- width = end-start+1;\r
-\r
-\r
this.appendEdit(DELETE_GAP, seqs,\r
startCol - deletedCols,\r
- width,\r
+ end-startCol+1,\r
gapChar,\r
false);\r
}\r
int startCol = -1, endCol = -1;\r
int deletedCols = 0;\r
\r
+ int j, jSize;\r
+\r
edits = new Edit[0];\r
\r
boolean delete = true;\r
char [] sequence;\r
+\r
for(int s=0; s<seqs.length; s++)\r
{\r
deletedCols = 0;\r
startCol = -1;\r
endCol = -1;\r
- sequence = seqs[s].getSequence().toCharArray();\r
- for (int i = start; i < end; i++)\r
+ sequence = seqs[s].getSequence(start, end+1).toCharArray();\r
+\r
+ jSize = sequence.length;\r
+ for (j=0; j<jSize; j++)\r
{\r
delete = true;\r
\r
- if (!jalview.util.Comparison.isGap(sequence[i]))\r
+\r
+ if (!jalview.util.Comparison.isGap(sequence[j]))\r
{\r
if (delete)\r
- endCol = i;\r
+ endCol = j;\r
\r
delete = false;\r
}\r
\r
+\r
if (delete && startCol == -1)\r
{\r
- startCol = i;\r
+ startCol = j;\r
}\r
\r
if (!delete && startCol > -1)\r
{\r
this.appendEdit(DELETE_GAP, new SequenceI[]{seqs[s]},\r
- startCol - deletedCols,\r
+ start + startCol - deletedCols,\r
endCol - startCol,\r
gapChar,\r
false);\r
}\r
if (delete && startCol > -1)\r
{\r
- int width = end - endCol;\r
-\r
- if (endCol == -1)\r
- width = end - start + 1;\r
-\r
- //This is the end of the region.\r
this.appendEdit(DELETE_GAP, new SequenceI[]{seqs[s]},\r
- startCol - deletedCols,\r
- width,\r
+ start + startCol - deletedCols,\r
+ jSize - startCol,\r
gapChar,\r
false);\r
}\r