X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceI.java;h=c1687fe3dbe812899e70ab9d2081c91a6c6c267c;hb=e2c3b3602486cee3f85dd8dfc7856a5ce6701669;hp=e4be5ee3dd299f7f7e46844082f8e2f580e3f318;hpb=df2bf54c7050c42db156e96e73bbabce63e718d7;p=jalview.git diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index e4be5ee..c1687fe 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -22,6 +22,7 @@ package jalview.datamodel; import jalview.datamodel.features.SequenceFeaturesI; +import java.util.BitSet; import java.util.List; import java.util.Vector; @@ -118,9 +119,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(); @@ -176,7 +177,7 @@ public interface SequenceI extends ASequenceI public String getDescription(); /** - * Return the alignment column for a sequence position + * Return the alignment column (from 1..) for a sequence position * * @param pos * lying from start to end @@ -191,16 +192,27 @@ 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 position. * * @param i * column index in alignment (from 0.. getSequenceFeatures(); @@ -485,14 +504,41 @@ public interface SequenceI extends ASequenceI public List getPrimaryDBRefs(); /** - * Returns a (possibly empty) list of sequence features that overlap the range - * from-to (inclusive), optionally restricted to one or more specified feature - * types + * 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 + * included (but not contact features). * - * @param from - * @param to + * @param fromCol + * start column of range inclusive (1..) + * @param toCol + * end column of range inclusive (1..) * @param types + * optional feature types to restrict results to * @return */ - List findFeatures(int from, int to, String... types); + 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); }