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, in no particular guaranteed order.
37 * Positional features may optionally be restricted to specified types, but
38 * all non-positional features (if any) are always returned.
40 * To filter non-positional features by type, use
41 * getNonPositionalFeatures(type).
46 List<SequenceFeature> getAllFeatures(String... type);
49 * Answers a list of all features stored, whose type either matches one of the
50 * given ontology terms, or is a specialisation of a term in the Sequence
51 * Ontology. Results are returned in no particular guaranteed order.
56 List<SequenceFeature> getFeaturesByOntology(String... ontologyTerm);
59 * Answers the number of (positional or non-positional) features, optionally
60 * restricted to specified feature types. Contact features are counted as 1.
66 int getFeatureCount(boolean positional, String... type);
69 * Answers the total length of positional features, optionally restricted to
70 * specified feature types. Contact features are counted as length 1.
75 int getTotalFeatureLength(String... type);
78 * Answers a list of all positional features, optionally restricted to
79 * specified types, in no particular guaranteed order
84 List<SequenceFeature> getPositionalFeatures(
88 * Answers a list of all contact features, optionally restricted to specified
89 * types, in no particular guaranteed order
93 List<SequenceFeature> getContactFeatures(String... type);
96 * Answers a list of all non-positional features, optionally restricted to
97 * specified types, in no particular guaranteed order
100 * if no type is specified, all are returned
103 List<SequenceFeature> getNonPositionalFeatures(
107 * Deletes the given feature from the store, returning true if it was found
108 * (and deleted), else false. This method makes no assumption that the feature
109 * is in the 'expected' place in the store, in case it has been modified since
114 boolean delete(SequenceFeature sf);
117 * Answers true if this store contains at least one feature, else false
121 boolean hasFeatures();
124 * Returns a set of the distinct feature groups present in the collection. The
125 * set may include null. The boolean parameter determines whether the groups
126 * for positional or for non-positional features are returned. The optional
127 * type parameter may be used to restrict to groups for specified feature
130 * @param positionalFeatures
134 Set<String> getFeatureGroups(boolean positionalFeatures,
138 * Answers the set of distinct feature types for which there is at least one
139 * feature with one of the given feature group(s). The boolean parameter
140 * determines whether the groups for positional or for non-positional features
143 * @param positionalFeatures
147 Set<String> getFeatureTypesForGroups(
148 boolean positionalFeatures, String... groups);
151 * Answers a set of the distinct feature types for which a feature is stored.
152 * The types may optionally be restricted to those which match, or are a
153 * subtype of, given sequence ontology terms
157 Set<String> getFeatureTypes(String... soTerm);
160 * Answers the minimum score held for positional or non-positional features
161 * for the specified type. This may be Float.NaN if there are no features, or
162 * none has a non-NaN score.
168 float getMinimumScore(String type, boolean positional);
171 * Answers the maximum score held for positional or non-positional features
172 * for the specified type. This may be Float.NaN if there are no features, or
173 * none has a non-NaN score.
179 float getMaximumScore(String type, boolean positional);