new method to get map of sequence positions corresponding to alignment columns
[jalview.git] / src / jalview / datamodel / SequenceI.java
index 9fdd02a..d9ffc81 100755 (executable)
@@ -108,12 +108,12 @@ public interface SequenceI
   public char[] getSequence();
 
   /**
-   * DOCUMENT ME!
+   * get stretch of sequence characters in an array
    *
-   * @param start DOCUMENT ME!
-   * @param end DOCUMENT ME!
+   * @param start absolute index into getSequence()
+   * @param end exclusive index of last position in segment to be returned.
    *
-   * @return DOCUMENT ME!
+   * @return char[max(0,end-start)];
    */
   public char[] getSequence(int start, int end);
 
@@ -174,6 +174,14 @@ public interface SequenceI
   public int[] gapMap();
 
   /**
+   * Returns an int array where indices correspond to each position in
+   * sequence char array and the element value gives the result of findPosition
+   * for that index in the sequence.
+   * 
+   * @return int[SequenceI.getLength()] 
+   */
+  public int[] findPositionMap();
+  /**
    * Delete a range of aligned sequence columns, creating a new dataset sequence if necessary
    * and adjusting start and end positions accordingly.
    *
@@ -226,6 +234,10 @@ public interface SequenceI
    */
   public Vector getPDBId();
 
+  /**
+   * add entry to the vector of PDBIds, if it isn't in the list already
+   * @param entry
+   */
   public void addPDBId(PDBEntry entry);
   /**
    * update the list of PDBEntrys to include any DBRefEntrys citing structural databases 
@@ -286,5 +298,13 @@ public interface SequenceI
    * @return dataset sequence for this sequence
    */
   public SequenceI createDatasetSequence();
+  
+  /**
+   * Transfer any database references or annotation from entry
+   * under a sequence mapping.
+   * @param entry
+   * @param mp null or mapping from entry's numbering to local start/end
+   */
+  public void transferAnnotation(SequenceI entry, Mapping mp);
 
 }