X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignmentI.java;h=cea1c5b29fc4ec56d6bae3708a5f6f491a792822;hb=daa1765ab2101480a724b92a3f3e7dee662ba943;hp=dd58b3176a22353d21f58543b99e0b693a3b434d;hpb=cef7be0f9008ff15318e3479a5de35e127071ef3;p=jalview.git
diff --git a/src/jalview/datamodel/AlignmentI.java b/src/jalview/datamodel/AlignmentI.java
index dd58b31..cea1c5b 100755
--- a/src/jalview/datamodel/AlignmentI.java
+++ b/src/jalview/datamodel/AlignmentI.java
@@ -5,16 +5,16 @@
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General License
+ * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General License for more details.
+ * PURPOSE. See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General License
+ * You should have received a copy of the GNU General Public License
* along with Jalview. If not, see .
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
@@ -48,15 +48,29 @@ public interface AlignmentI extends AnnotatedCollectionI
/**
*
- * 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
*
@@ -504,8 +518,6 @@ public interface AlignmentI extends AnnotatedCollectionI
* - 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
*/
@@ -513,6 +525,17 @@ public interface AlignmentI extends AnnotatedCollectionI
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.
@@ -580,27 +603,43 @@ public interface AlignmentI extends AnnotatedCollectionI
*/
AlignedCodonFrame getMapping(SequenceI mapFrom, SequenceI mapTo);
- public void setHiddenColumns(HiddenColumns cols);
-
/**
- * Returns all HMM consensus sequences.
+ * Set the hidden columns collection on the alignment. Answers true if the
+ * hidden column selection changed, else false.
*
- * @param remove
- * If true, remove all HMM consensus sequences from the alignment.
+ * @param cols
* @return
*/
- public List getHMMConsensusSequences(boolean remove);
+ public boolean setHiddenColumns(HiddenColumns cols);
/**
* Insert a sequence at a position in an alignment
*
* @param i
- * The idnex of the position.
+ * 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);
}