X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceI.java;h=03fc545434ecb15c82ed8f3ce405b10fb3229201;hb=2780a5c99798d048f690752f69a61c131e5e24d1;hp=ec76cb99abaf45a1264721752e550ffceba7f99f;hpb=4c6cd08af580ff73cfce39bec34ae4658a4b4b34;p=jalview.git diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index ec76cb9..03fc545 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -21,7 +21,9 @@ package jalview.datamodel; import jalview.datamodel.features.SequenceFeaturesI; +import jalview.util.MapList; +import java.util.BitSet; import java.util.List; import java.util.Vector; @@ -118,9 +120,9 @@ public interface SequenceI extends ASequenceI public String getSequenceAsString(int start, int end); /** - * Get the sequence as a character array + * Answers a copy of the sequence as a character array * - * @return seqeunce and any gaps + * @return */ public char[] getSequence(); @@ -202,6 +204,16 @@ public interface SequenceI extends ASequenceI public int findPosition(int i); /** + * Returns the from-to sequence positions (start..) for the given column + * positions (1..), or null if no residues are included in the range + * + * @param fromColum + * @param toColumn + * @return + */ + public Range findPositions(int fromColum, int toColumn); + + /** * Returns an int array where indices correspond to each residue in the * sequence and the element value gives its position in the alignment * @@ -265,7 +277,7 @@ public interface SequenceI extends ASequenceI * Answers a list of all sequence features associated with this sequence. The * list may be held by the sequence's dataset sequence if that is defined. * - * @return hard reference to array + * @return */ public List getSequenceFeatures(); @@ -500,4 +512,32 @@ public interface SequenceI extends ASequenceI * @return */ List findFeatures(int fromCol, int toCol, String... types); + + /** + * Method to call to indicate that the sequence (characters or alignment/gaps) + * has been modified. Provided to allow any cursors on residue/column + * positions to be invalidated. + */ + void sequenceChanged(); + + /** + * + * @return BitSet corresponding to index [0,length) where Comparison.isGap() + * returns true. + */ + BitSet getInsertionsAsBits(); + + /** + * Replaces every occurrence of c1 in the sequence with c2 and returns the + * number of characters changed + * + * @param c1 + * @param c2 + */ + public int replace(char c1, char c2); + + GeneLociI getGeneLoci(); + + void setGeneLoci(String speciesId, String assemblyId, + String chromosomeId, MapList map); }