JAL-2054 Renamed getStartEnd in AlignFrame to getVisibleStartAndEndIndex, and refacto...
[jalview.git] / src / jalview / datamodel / AlignmentI.java
index 67e5743..76d1a48 100755 (executable)
@@ -375,12 +375,12 @@ public interface AlignmentI extends AnnotatedCollectionI
    * 
    * @return
    */
-  Set<AlignedCodonFrame> getCodonFrames();
+  List<AlignedCodonFrame> getCodonFrames();
 
   /**
-   * Set the codon frame mappings (replacing any existing set).
+   * Set the codon frame mappings (replacing any existing list).
    */
-  void setCodonFrames(Set<AlignedCodonFrame> acfs);
+  void setCodonFrames(List<AlignedCodonFrame> acfs);
 
   /**
    * get codon frames involving sequenceI
@@ -473,9 +473,8 @@ public interface AlignmentI extends AnnotatedCollectionI
    * 
    * @return existing annotation matching the given attributes
    */
-  AlignmentAnnotation findOrCreateAnnotation(String name,
-          String calcId, boolean autoCalc, SequenceI seqRef,
-          SequenceGroup groupRef);
+  AlignmentAnnotation findOrCreateAnnotation(String name, String calcId,
+          boolean autoCalc, SequenceI seqRef, SequenceGroup groupRef);
 
   /**
    * move the given group up or down in the alignment by the given number of
@@ -517,4 +516,40 @@ public interface AlignmentI extends AnnotatedCollectionI
    * @return
    */
   Set<String> getSequenceNames();
+
+  /**
+   * Checks if the alignment has at least one sequence with one non-gaped
+   * residue
+   * 
+   * @return
+   */
+  public boolean hasValidSequence();
+
+  /**
+   * Update any mappings to 'virtual' sequences to compatible real ones, if
+   * present in the added sequences. Returns a count of mappings updated.
+   * 
+   * @param seqs
+   * @return
+   */
+  int realiseMappings(List<SequenceI> seqs);
+
+  /**
+   * Returns the first AlignedCodonFrame that has a mapping between the given
+   * dataset sequences
+   * 
+   * @param mapFrom
+   * @param mapTo
+   * @return
+   */
+  AlignedCodonFrame getMapping(SequenceI mapFrom, SequenceI mapTo);
+
+  /**
+   * Calculate the visible start and end index of an alignment. The result is
+   * returned an int array where: int[0] = startIndex, and int[1] = endIndex.
+   * 
+   * @param hiddenCols
+   * @return
+   */
+  public int[] getVisibleStartAndEndIndex(List<int[]> hiddenCols);
 }