/**
*
- * Calculates the maximum width of the alignment, including gaps.
+ * Answers the width of the alignment, including gaps, that is, the length of
+ * the longest sequence, or -1 if there are no sequences. Avoid calling this
+ * method repeatedly where possible, as it has to perform a calculation. Note
+ * that this width includes any hidden columns.
*
- * @return Greatest sequence length within alignment, or -1 if no sequences
- * present
+ * @return
+ * @see AlignmentI#getVisibleWidth()
*/
@Override
int getWidth();
/**
+ *
+ * Answers the visible width of the alignment, including gaps, that is, the
+ * length of the longest sequence, excluding any hidden columns. Answers -1 if
+ * there are no sequences. Avoid calling this method repeatedly where
+ * possible, as it has to perform a calculation.
+ *
+ * @return
+ */
+ int getVisibleWidth();
+
+ /**
* Calculates if this set of sequences (visible and invisible) are all the
* same length
*
* - null or specific sequence reference
* @param groupRef
* - null or specific group reference
- * @param method
- * - CalcId for the annotation (must match)
*
* @return existing annotation matching the given attributes
*/
boolean autoCalc, SequenceI seqRef, SequenceGroup groupRef);
/**
+ * like findOrCreateAnnotation - looks for an existing alignment annotation
+ * row with matching name, calcId, sequenceRef, groupRef and autoCalculated
+ * flag and updates it from the annotation. If none is found the annotation is
+ * added directly.
+ *
+ * @param ala
+ * @return ala or the annotation row that was updated.
+ */
+ AlignmentAnnotation updateFromOrCopyAnnotation(AlignmentAnnotation ala);
+
+ /**
* move the given group up or down in the alignment by the given number of
* rows. Implementor assumes given group is already present on alignment - no
* recalculations are triggered.
*/
AlignedCodonFrame getMapping(SequenceI mapFrom, SequenceI mapTo);
- public void setHiddenColumns(HiddenColumns cols);
+ /**
+ * Set the hidden columns collection on the alignment. Answers true if the
+ * hidden column selection changed, else false.
+ *
+ * @param cols
+ * @return
+ */
+ public boolean setHiddenColumns(HiddenColumns cols);
+
+ /**
+ * Insert a sequence at a position in an alignment
+ *
+ * @param i
+ * The index of the position.
+ * @param snew
+ * The new sequence.
+ */
+ void insertSequenceAt(int i, SequenceI snew);
+ /**
+ * Set the first sequence as representative and hide its insertions. Typically
+ * used when loading JPred files.
+ */
+ public void setupJPredAlignment();
+
+ /**
+ * Add gaps into the sequences aligned to profileseq under the given
+ * AlignmentView
+ *
+ * @param profileseq
+ * sequence in al which sequences are aligned to
+ * @param input
+ * alignment view where sequence corresponding to profileseq is first
+ * entry
+ * @return new HiddenColumns for new alignment view, with insertions into
+ * profileseq marked as hidden.
+ */
+ public HiddenColumns propagateInsertions(SequenceI profileseq,
+ AlignmentView input);
}