+ HiddenSequences hiddenSequences = new HiddenSequences(this);
+
+ public Hashtable alignmentProperties;
+
+ private void initAlignment(SequenceI[] seqs)
+ {
+ int i = 0;
+
+ if (jalview.util.Comparison.isNucleotide(seqs))
+ {
+ type = NUCLEOTIDE;
+ }
+ else
+ {
+ type = PROTEIN;
+ }
+
+ sequences = java.util.Collections
+ .synchronizedList(new ArrayList<SequenceI>());
+
+ for (i = 0; i < seqs.length; i++)
+ {
+ sequences.add(seqs[i]);
+ }
+
+ }
+
+ /**
+ * Make an alignment from an array of Sequences.
+ *
+ * @param sequences
+ */
+ public Alignment(SequenceI[] seqs)
+ {
+ initAlignment(seqs);
+ }
+
+ /**
+ * Make a new alignment from an array of SeqCigars
+ *
+ * @param seqs
+ * SeqCigar[]
+ */
+ public Alignment(SeqCigar[] alseqs)
+ {
+ SequenceI[] seqs = SeqCigar.createAlignmentSequences(alseqs,
+ gapCharacter, new ColumnSelection(), null);
+ initAlignment(seqs);
+ }
+
+ /**
+ * Make a new alignment from an CigarArray JBPNote - can only do this when
+ * compactAlignment does not contain hidden regions. JBPNote - must also check
+ * that compactAlignment resolves to a set of SeqCigars - or construct them
+ * appropriately.
+ *
+ * @param compactAlignment
+ * CigarArray
+ */
+ public static AlignmentI createAlignment(CigarArray compactAlignment)
+ {
+ throw new Error(MessageManager.getString("error.alignment_cigararray_not_implemented"));
+ // this(compactAlignment.refCigars);
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ @Override
+ public List<SequenceI> getSequences()
+ {
+ return sequences;
+ }
+
+ @Override
+ public List<SequenceI> getSequences(
+ Map<SequenceI, SequenceCollectionI> hiddenReps)
+ {
+ // TODO: in jalview 2.8 we don't do anything with hiddenreps - fix design to
+ // work on this.
+ return sequences;
+ }
+
+ @Override
+ public SequenceI[] getSequencesArray()
+ {
+ if (sequences == null)
+ {
+ return null;
+ }
+ synchronized (sequences)
+ {
+ return sequences.toArray(new SequenceI[sequences.size()]);
+ }
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param i
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ @Override
+ public SequenceI getSequenceAt(int i)
+ {
+ synchronized (sequences)
+ {
+ if (i > -1 && i < sequences.size())