Merge branch 'develop' into update_212_Dec_merge_with_21125_chamges
[jalview.git] / src / jalview / datamodel / SequenceI.java
index 2f365e6..8f1d160 100755 (executable)
@@ -48,6 +48,9 @@ public interface SequenceI extends ASequenceI
    */
   public void setName(String name);
 
+  public HiddenMarkovModel getHMM();
+
+  public void setHMM(HiddenMarkovModel hmm);
   /**
    * Get the display name
    */
@@ -215,10 +218,10 @@ public interface SequenceI extends ASequenceI
    * from 1), or null if no residues are included in the range
    * 
    * @param fromColum
-   *          - first column base 1
+   *          - first column base 1. (0 and negative positions are rounded up)
    * @param toColumn
    *          - last column, base 1
-   * @return
+   * @return null if fromColum>toColumn
    */
   public ContiguousI findPositions(int fromColum, int toColumn);
 
@@ -357,13 +360,12 @@ public interface SequenceI extends ASequenceI
   /**
    * set the array of Database references for the sequence.
    * 
-   * BH 2019.02.04 changes param to DBModlist
+   * BH 2019.02.04 changes param to DBModlist 
    * 
    * @param dbs
    * @deprecated - use is discouraged since side-effects may occur if DBRefEntry
    *             set are not normalised.
-   * @throws InvalidArgumentException
-   *           if the is not one created by Sequence itself
+   * @throws InvalidArgumentException if the is not one created by Sequence itself
    */
   @Deprecated
   public void setDBRefs(DBModList<DBRefEntry> dbs);
@@ -448,8 +450,8 @@ public interface SequenceI extends ASequenceI
 
   /**
    * Returns a (possibly empty) list of any annotations that match on given
-   * calcId (source), label (type) and description (observation instance). Null
-   * values do not match.
+   * calcId (source), label (type) and description (observation instance).
+   * Null values do not match.
    * 
    * @param calcId
    * @param label
@@ -457,7 +459,6 @@ public interface SequenceI extends ASequenceI
    */
   public List<AlignmentAnnotation> getAlignmentAnnotations(String calcId,
           String label, String description);
-
   /**
    * create a new dataset sequence (if necessary) for this sequence and sets
    * this sequence to refer to it. This call will move any features or
@@ -517,6 +518,11 @@ public interface SequenceI extends ASequenceI
    *         list
    */
   public List<DBRefEntry> getPrimaryDBRefs();
+  /**
+   * Answers true if the sequence has annotation for Hidden Markov Model
+   * information content, else false
+   */
+  boolean hasHMMAnnotation();
 
   /**
    * Returns a (possibly empty) list of sequence features that overlap the given
@@ -532,8 +538,7 @@ public interface SequenceI extends ASequenceI
    *          optional feature types to restrict results to
    * @return
    */
-  List<SequenceFeature> findFeatures(int fromCol, int toCol,
-          String... types);
+  List<SequenceFeature> findFeatures(int fromCol, int toCol, String... types);
 
   /**
    * Method to call to indicate that the sequence (characters or alignment/gaps)
@@ -541,7 +546,7 @@ public interface SequenceI extends ASequenceI
    * positions to be invalidated.
    */
   void sequenceChanged();
-
+  
   /**
    * 
    * @return BitSet corresponding to index [0,length) where Comparison.isGap()
@@ -573,8 +578,9 @@ public interface SequenceI extends ASequenceI
    * @param chromosomeId
    * @param map
    */
-  void setGeneLoci(String speciesId, String assemblyId, String chromosomeId,
-          MapList map);
+  void setGeneLoci(String speciesId, String assemblyId,
+          String chromosomeId, MapList map);
+
 
   /**
    * Returns the sequence string constructed from the substrings of a sequence
@@ -597,4 +603,12 @@ public interface SequenceI extends ASequenceI
    */
   public int firstResidueOutsideIterator(Iterator<int[]> it);
 
+
+  /**
+   * Answers true if this sequence has an associated Hidden Markov Model
+   * 
+   * @return
+   */
+  boolean hasHMMProfile();
 }
+