protected char gapCharacter = '-';
- protected int type = NUCLEOTIDE;
-
- public static final int PROTEIN = 0;
-
- public static final int NUCLEOTIDE = 1;
+ private boolean nucleotide = true;
public boolean hasRNAStructure = false;
hiddenSequences = new HiddenSequences(this);
codonFrameList = new ArrayList<AlignedCodonFrame>();
- if (Comparison.isNucleotide(seqs))
- {
- type = NUCLEOTIDE;
- }
- else
- {
- type = PROTEIN;
- }
+ nucleotide = Comparison.isNucleotide(seqs);
sequences = Collections.synchronizedList(new ArrayList<SequenceI>());
}
/**
- * Adds a sequence to the alignment. Recalculates maxLength and size.
+ * Adds a sequence to the alignment. Recalculates maxLength and size. Note
+ * this currently does not recalculate whether or not the alignment is
+ * nucleotide, so mixed alignments may have undefined behaviour.
*
* @param snew
*/
}
@Override
- public void setNucleotide(boolean b)
- {
- if (b)
- {
- type = NUCLEOTIDE;
- }
- else
- {
- type = PROTEIN;
- }
- }
-
- @Override
public boolean isNucleotide()
{
- if (type == NUCLEOTIDE)
- {
- return true;
- }
- else
- {
- return false;
- }
+ return nucleotide;
}
@Override
boolean hasRNAStructure();
/**
- * Set alignment to be a nucleotide sequence
- *
- */
- void setNucleotide(boolean b);
-
- /**
* Get the associated dataset for the alignment.
*
* @return Alignment containing dataset sequences or null of this is a