X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceI.java;h=d06adcbd4f68b5fefbef332c059de6844ffadca5;hb=b5667f39acdf309cd92881b73edfda591e0acaf4;hp=6e6d1aada4a1e4c5067ecda1dc3fd2e9d7444abd;hpb=bba9e58f08fc55c0f789f8354d1444e5c5e1b0e6;p=jalview.git diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index 6e6d1aa..d06adcb 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -21,8 +21,10 @@ package jalview.datamodel; import jalview.datamodel.features.SequenceFeaturesI; +import jalview.util.MapList; import java.util.BitSet; +import java.util.Iterator; import java.util.List; import java.util.Vector; @@ -44,6 +46,10 @@ public interface SequenceI extends ASequenceI */ public void setName(String name); + public HiddenMarkovModel getHMM(); + + public void setHMM(HiddenMarkovModel hmm); + /** * Get the display name */ @@ -110,9 +116,11 @@ public interface SequenceI extends ASequenceI * get a range on the sequence as a string * * @param start - * position relative to start of sequence including gaps (from 0) + * (inclusive) position relative to start of sequence including gaps + * (from 0) * @param end - * position relative to start of sequence including gaps (from 0) + * (exclusive) position relative to start of sequence including gaps + * (from 0) * * @return String containing all gap and symbols in specified range */ @@ -192,25 +200,29 @@ public interface SequenceI extends ASequenceI public int findIndex(int pos); /** - * Returns the sequence position for an alignment position. + * Returns the sequence position for an alignment (column) position. If at a + * gap, returns the position of the next residue to the right. If beyond the + * end of the sequence, returns 1 more than the last residue position. * * @param i * column index in alignment (from 0.. 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 * alignment column range, optionally restricted to one or more specified * feature types. If the range is all gaps, then features which enclose it are @@ -533,5 +547,52 @@ public interface SequenceI extends ASequenceI * @param c1 * @param c2 */ - public int replace(char c1, char c2); + int replace(char c1, char c2); + + /** + * Answers the GeneLociI, or null if not known + * + * @return + */ + GeneLociI getGeneLoci(); + + /** + * Sets the mapping to gene loci for the sequence + * + * @param speciesId + * @param assemblyId + * @param chromosomeId + * @param map + */ + void setGeneLoci(String speciesId, String assemblyId, + String chromosomeId, MapList map); + + + /** + * Returns the sequence string constructed from the substrings of a sequence + * defined by the int[] ranges provided by an iterator. E.g. the iterator + * could iterate over all visible regions of the alignment + * + * @param it + * the iterator to use + * @return a String corresponding to the sequence + */ + String getSequenceStringFromIterator(Iterator it); + + /** + * Locate the first position in this sequence which is not contained in an + * iterator region. If no such position exists, return 0 + * + * @param it + * iterator over regions + * @return first residue not contained in regions + */ + int firstResidueOutsideIterator(Iterator it); + + /** + * Answers true if this sequence has an associated Hidden Markov Model + * + * @return + */ + boolean hasHMMProfile(); }