1 package jalview.datamodel.features;
3 import jalview.datamodel.SequenceFeature;
8 public interface SequenceFeaturesI
12 * Adds one sequence feature to the store, and returns true, unless the
13 * feature is already contained in the store, in which case this method
14 * returns false. Containment is determined by SequenceFeature.equals()
15 * comparison. Answers false, and does not add the feature, if feature type is
20 boolean add(SequenceFeature sf);
23 * Returns a (possibly empty) list of features, optionally restricted to
24 * specified types, which overlap the given (inclusive) sequence position
32 List<SequenceFeature> findFeatures(int from, int to,
36 * Answers a list of all features stored, optionally restricted to specified
37 * types, in no particular guaranteed order
42 List<SequenceFeature> getAllFeatures(String... type);
45 * Answers the number of (positional or non-positional) features, optionally
46 * restricted to specified feature types. Contact features are counted as 1.
52 int getFeatureCount(boolean positional, String... type);
55 * Answers the total length of positional features, optionally restricted to
56 * specified feature types. Contact features are counted as length 1.
61 int getTotalFeatureLength(String... type);
64 * Answers a list of all positional features, optionally restricted to
65 * specified types, in no particular guaranteed order
70 List<SequenceFeature> getPositionalFeatures(
74 * Answers a list of all contact features, optionally restricted to specified
75 * types, in no particular guaranteed order
79 List<SequenceFeature> getContactFeatures(String... type);
82 * Answers a list of all non-positional features, optionally restricted to
83 * specified types, in no particular guaranteed order
86 * if no type is specified, all are returned
89 List<SequenceFeature> getNonPositionalFeatures(
93 * Deletes the given feature from the store, returning true if it was found
94 * (and deleted), else false. This method makes no assumption that the feature
95 * is in the 'expected' place in the store, in case it has been modified since
100 boolean delete(SequenceFeature sf);
103 * Answers true if this store contains at least one feature, else false
107 boolean hasFeatures();
110 * Returns a set of the distinct feature groups present in the collection. The
111 * set may include null. The boolean parameter determines whether the groups
112 * for positional or for non-positional features are returned. The optional
113 * type parameter may be used to restrict to groups for specified feature
116 * @param positionalFeatures
120 Set<String> getFeatureGroups(boolean positionalFeatures,
124 * Answers the set of distinct feature types for which there is at least one
125 * feature with one of the given feature group(s). The boolean parameter
126 * determines whether the groups for positional or for non-positional features
129 * @param positionalFeatures
133 Set<String> getFeatureTypesForGroups(
134 boolean positionalFeatures, String... groups);
137 * Answers a set of the distinct feature types for which a feature is stored
141 Set<String> getFeatureTypes();
144 * Answers the minimum score held for positional or non-positional features
145 * for the specified type. This may be Float.NaN if there are no features, or
146 * none has a non-NaN score.
152 float getMinimumScore(String type, boolean positional);
155 * Answers the maximum score held for positional or non-positional features
156 * for the specified type. This may be Float.NaN if there are no features, or
157 * none has a non-NaN score.
163 float getMaximumScore(String type, boolean positional);