normaliseSequenceLogo = state;
}
+ /**
+ * Returns all HMM consensus sequences. This will not return real sequences
+ * with HMMs. If remove is set to true, the consensus sequences will be
+ * removed from the alignment.
+ */
+ @Override // TODO make this more efficient.
+ public List<SequenceI> getHMMConsensusSequences(boolean remove)
+ {
+ List<SequenceI> seqs = new ArrayList<>();
+ int position = 0;
+ int seqsRemoved = 0;
+ boolean endReached = false;
+
+ while (!endReached)
+ {
+ SequenceI seq = sequences.get(position);
+ if (seq.isHMMConsensusSequence())
+ {
+ if (remove)
+ {
+ sequences.remove(position);
+ seqsRemoved++;
+ seq.setPreviousPosition(seqsRemoved + position - 1);
+ }
+ else
+ {
+ position++;
+ }
+ seqs.add(seq);
+ }
+ else
+ {
+ position++;
+ }
+
+ if (position >= sequences.size())
+ {
+ endReached = true;
+ }
+ }
+ return seqs;
+ }
+
}