return edits==null?0:edits.length;\r
}\r
\r
+ public AlignmentI getAlignment()\r
+ {\r
+ return edits[0].al;\r
+ }\r
+\r
\r
public void appendEdit(String command,\r
SequenceI[] seqs,\r
\r
for(int i=0; i<command.seqs.length; i++)\r
{\r
- command.string[i] = command.seqs[i].getSequence(command.position,\r
- command.position + command.number);\r
+ if(command.seqs[i].getLength()>command.position)\r
+ {\r
+ command.string[i] = command.seqs[i].getSequence(command.position,\r
+ command.position + command.number);\r
\r
- command.seqs[i].deleteChars(command.position,\r
- command.position+command.number);\r
+ command.seqs[i].deleteChars(command.position,\r
+ command.position + command.number);\r
+ }\r
\r
if(command.seqs[i].getLength()<1)\r
{\r
command.al.addSequence(command.seqs[i]);\r
}\r
tmp = new StringBuffer(command.seqs[i].getSequence());\r
- if(command.string!=null)\r
+\r
+ if(command.string!=null && command.string[i]!=null)\r
{\r
+ if(command.position>=tmp.length())\r
+ {\r
+ //This occurs if padding is on, and residues\r
+ //are removed from end of alignment\r
+ int length = command.position-tmp.length();\r
+ while (length > 0)\r
+ {\r
+ tmp.append(command.gapChar);\r
+ length--;\r
+ }\r
+ }\r
tmp.insert(command.position, command.string[i]);\r
command.string[i] = null;\r
}\r
int number,\r
AlignmentI al)\r
{\r
+ this.gapChar = al.getGapCharacter();\r
this.command = command;\r
this.seqs = seqs;\r
this.position = position;\r