X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceI.java;h=6c82bf3aa6a30da7971c5889cf05b6dd9d87cf62;hb=6323f1a33650360f131f25cf2797e5600ceee49f;hp=a29e2ba81c2f34491c2e806cda561242c42efd93;hpb=1c5971e6df15c0d5c774a2cb7dbdac286a72a9b2;p=jalview.git diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index a29e2ba..6c82bf3 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -20,6 +20,8 @@ */ package jalview.datamodel; +import jalview.datamodel.features.SequenceFeaturesI; + import java.util.List; import java.util.Vector; @@ -217,8 +219,11 @@ public interface SequenceI extends ASequenceI public int[] findPositionMap(); /** + * Answers true if the sequence is composed of amino acid characters. Note + * that implementations may use heuristic methods which are not guaranteed to + * give the biologically 'right' answer. * - * @return true if sequence is composed of amino acid characters + * @return */ public boolean isProtein(); @@ -264,6 +269,13 @@ public interface SequenceI extends ASequenceI public SequenceFeature[] getSequenceFeatures(); /** + * Answers the object holding features for the sequence + * + * @return + */ + SequenceFeaturesI getFeatures(); + + /** * Replaces the array of sequence features associated with this sequence with * a new array reference. If this sequence has a dataset sequence, then this * method will update the dataset sequence's feature array @@ -334,7 +346,14 @@ public interface SequenceI extends ASequenceI */ public void addDBRef(DBRefEntry entry); - public void addSequenceFeature(SequenceFeature sf); + /** + * Adds the given sequence feature and returns true, or returns false if it is + * already present on the sequence, or if the feature type is null. + * + * @param sf + * @return + */ + public boolean addSequenceFeature(SequenceFeature sf); public void deleteFeature(SequenceFeature sf); @@ -456,7 +475,6 @@ public interface SequenceI extends ASequenceI */ public PDBEntry getPDBEntry(String pdbId); - /** * Get all primary database/accessions for this sequence's data. These * DBRefEntry are expected to resolve to a valid record in the associated @@ -466,4 +484,16 @@ public interface SequenceI extends ASequenceI * list */ 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 + * + * @param from + * @param to + * @param types + * @return + */ + List findFeatures(int from, int to, String... types); }