+
+ @Override
+ public boolean isNucleotide()
+ {
+ if (context != null)
+ {
+ return context.isNucleotide();
+ }
+ return false;
+ }
+
+ /**
+ * @param seq
+ * @return true if seq is a member of the group
+ */
+
+ public boolean contains(SequenceI seq1)
+ {
+ return sequences.contains(seq1);
+ }
+
+ /**
+ * @param seq
+ * @param apos
+ * @return true if startRes<=apos and endRes>=apos and seq is in the group
+ */
+ public boolean contains(SequenceI seq, int apos)
+ {
+ return (startRes <= apos && endRes >= apos) && sequences.contains(seq);
+ }
+
+ public boolean isShowInformationHistogram()
+ {
+ return showInformationHistogram;
+ }
+
+ public void setShowInformationHistogram(boolean state)
+ {
+ if (showInformationHistogram != state && information != null)
+ {
+ this.showInformationHistogram = state;
+ // recalcConservation(); TODO don't know what to do here next
+ }
+ this.showInformationHistogram = state;
+
+ }
+
+ public boolean isShowHMMSequenceLogo()
+ {
+ // TODO Auto-generated method stub
+ return showHMMSequenceLogo;
+ }
+
+ public void setshowHMMSequenceLogo(boolean state)
+ {
+ showHMMSequenceLogo = state;
+
+ }
+
+ public boolean isNormaliseHMMSequenceLogo()
+ {
+ // TODO Auto-generated method stub
+ return normaliseHMMSequenceLogo;
+ }
+
+ public void setNormaliseHMMSequenceLogo(boolean state)
+ {
+ 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;
+ }
+