X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceI.java;h=9045735594453832a054f9ce99a65b3793ee9a46;hb=05a51640d2a5c35cd32e8ad831963bd268ea10f6;hp=7cbb7308f717a4201a3ce138985440969ba6ef90;hpb=033f5f831f933664923dd7c667c731201f94894a;p=jalview.git diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index 7cbb730..9045735 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 */ @@ -192,13 +198,14 @@ 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(); /** + * Updates mapping of Hidden Markov Model nodes to aligned sequence positions + * (e.g. after an alignment edit). The nodes of the HMM (excluding the first + * node, with model average values), are associated in turn with non-gapped + * sequence positions. + */ + public void updateHMMMapping(); + + boolean isHMMConsensusSequence(); + + void setIsHMMConsensusSequence(boolean isHMMConsensusSequence); + + /** + * 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 @@ -526,6 +547,8 @@ public interface SequenceI extends ASequenceI */ BitSet getInsertionsAsBits(); + void mapToReference(AlignmentAnnotation rf); + /** * Replaces every occurrence of c1 in the sequence with c2 and returns the * number of characters changed @@ -533,9 +556,45 @@ public interface SequenceI extends ASequenceI * @param c1 * @param c2 */ - public int replace(char c1, char c2); + int replace(char c1, char c2); - public abstract GeneLoci getGeneLoci(); + /** + * Answers the GeneLociI, or null if not known + * + * @return + */ + GeneLociI getGeneLoci(); - public abstract void setGeneLoci(GeneLoci gl); + /** + * 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 + */ + public 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 + */ + public int firstResidueOutsideIterator(Iterator it); }