protected Vector groups = new Vector();\r
protected ArrayList superGroup = new ArrayList();\r
protected char gapCharacter = '-';\r
+ public AlignmentAnnotation [] annotations;\r
+ public Conservation conservation;\r
+\r
+ public boolean featuresAdded = false;\r
\r
/** Make an alignment from an array of Sequences.\r
*\r
}\r
\r
/** Adds a sequence to the alignment. Recalculates maxLength and size.\r
- * Should put the new sequence in a sequence group!!!\r
*\r
* @param snew\r
*/\r
}\r
\r
/** Adds a sequence to the alignment. Recalculates maxLength and size.\r
- * Should put the new sequence in a sequence group!!!\r
- *\r
+ *\r
* @param snew\r
*/\r
public void setSequenceAt(int i,SequenceI snew) {\r
deleteSequence(oldseq);\r
\r
sequences.setElementAt(snew,i);\r
-\r
- ((SequenceGroup)groups.lastElement()).addSequence(snew);\r
}\r
\r
public Vector getGroups() {\r
\r
public void setGapCharacter(char gc)\r
{\r
- char old = getGapCharacter();\r
gapCharacter = gc;\r
for (int i=0; i < sequences.size(); i++)\r
{\r
Sequence seq = (Sequence)sequences.elementAt(i);\r
- seq.sequence = seq.sequence.replace(old, gc);\r
+ seq.sequence = seq.sequence.replace('.', gc);\r
+ seq.sequence = seq.sequence.replace('-', gc);\r
}\r
}\r
\r
return false;\r
\r
return true;\r
+ }\r
+\r
+ public void deleteAnnotation(AlignmentAnnotation aa)\r
+ {\r
+ int aSize = 1;\r
+ if(annotations!=null)\r
+ aSize = annotations.length;\r
+\r
+ AlignmentAnnotation [] temp = new AlignmentAnnotation [aSize-1];\r
+\r
+ int tIndex = 0;\r
+ for (int i = 0; i < aSize; i++)\r
+ {\r
+ if(annotations[i]==aa)\r
+ continue;\r
+\r
+\r
+ temp[tIndex] = annotations[i];\r
+ tIndex++;\r
+ }\r
\r
+ annotations = temp;\r
+\r
+ }\r
+\r
+ public void addAnnotation(AlignmentAnnotation aa)\r
+ {\r
+ int aSize = 1;\r
+ if(annotations!=null)\r
+ aSize = annotations.length+1;\r
+\r
+ AlignmentAnnotation [] temp = new AlignmentAnnotation [aSize];\r
+ int i=0;\r
+ if (aSize > 1)\r
+ for (i = 0; i < aSize-1; i++)\r
+ temp[i] = annotations[i];\r
+\r
+ temp[i] = aa;\r
+\r
+ annotations = temp;\r
}\r
+ public AlignmentAnnotation[] getAlignmentAnnotation()\r
+ {\r
+ return annotations;\r
+ }\r
+\r
}\r
\r
\r