X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceI.java;h=9045735594453832a054f9ce99a65b3793ee9a46;hb=05a51640d2a5c35cd32e8ad831963bd268ea10f6;hp=857f206324877ba712bcad31f4f3e8ceaa7ec7c7;hpb=40f53cf86e7d8c2a89f23b66024d46633307c83a;p=jalview.git diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index 857f206..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 */ @@ -223,6 +229,13 @@ public interface SequenceI extends ASequenceI public int[] gapMap(); /** + * Build a bitset corresponding to sequence gaps + * + * @return a BitSet where set values correspond to gaps in the sequence + */ + public BitSet gapBitset(); + + /** * 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. @@ -450,17 +463,6 @@ public interface SequenceI extends ASequenceI public void transferAnnotation(SequenceI entry, Mapping mp); /** - * @param index - * The sequence index in the MSA - */ - public void setIndex(int index); - - /** - * @return The index of the sequence in the alignment - */ - public int getIndex(); - - /** * @return The RNA of the sequence in the alignment */ @@ -498,6 +500,24 @@ public interface SequenceI extends ASequenceI public List 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 @@ -527,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 @@ -534,5 +556,45 @@ 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 + */ + 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); }