protected Vector groups = new Vector();\r
protected Vector superGroup = new Vector();\r
protected char gapCharacter = '-';\r
+ protected boolean isNucleotide = true;\r
+\r
\r
/** DOCUMENT ME!! */\r
public AlignmentAnnotation[] annotations;\r
*/\r
public Alignment(SequenceI[] seqs)\r
{\r
+ int i=0, iSize = seqs.length, j, jSize;\r
+ while(isNucleotide && i<iSize)\r
+ {\r
+ jSize = seqs[i].getLength();\r
+ for(j=0; j<jSize; j++)\r
+ {\r
+ if(!jalview.schemes.ResidueProperties.nucleotideHash.containsKey(seqs[i].getSequence(j, j+1))\r
+ && !jalview.util.Comparison.isGap(seqs[i].getSequence().charAt(j)))\r
+ {\r
+ isNucleotide = false;\r
+ break;\r
+ }\r
+ }\r
+ i++;\r
+ }\r
+\r
sequences = new Vector();\r
\r
- for (int i = 0; i < seqs.length; i++)\r
+ for (i = 0; i < seqs.length; i++)\r
{\r
sequences.addElement(seqs[i]);\r
}\r
{\r
return annotations;\r
}\r
+\r
+ public void setNucleotide(boolean b)\r
+ {\r
+ isNucleotide = b;\r
+ }\r
+\r
+ public boolean isNucleotide()\r
+ {\r
+ return isNucleotide;\r
+ }\r
}\r
* @return DOCUMENT ME!\r
*/\r
public Vector getAAFrequency();\r
+\r
+ /**\r
+ * Returns true if alignment is nucleotide sequence\r
+ *\r
+ * @return DOCUMENT ME!\r
+ */\r
+ public boolean isNucleotide();\r
+\r
+ /**\r
+ * Set true if the alignment is a nucleotide sequence\r
+ *\r
+ * @return\r
+ */\r
+ public void setNucleotide(boolean b);\r
+\r
}\r