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 a list of all features stored, whose type either matches one of the
46 * given ontology terms, or is a specialisation of a term in the Sequence
47 * Ontology. Results are returned in no particular guaranteed order.
52 List<SequenceFeature> getFeaturesByOntology(String... ontologyTerm);
55 * Answers the number of (positional or non-positional) features, optionally
56 * restricted to specified feature types. Contact features are counted as 1.
62 int getFeatureCount(boolean positional, String... type);
65 * Answers the total length of positional features, optionally restricted to
66 * specified feature types. Contact features are counted as length 1.
71 int getTotalFeatureLength(String... type);
74 * Answers a list of all positional features, optionally restricted to
75 * specified types, in no particular guaranteed order
80 List<SequenceFeature> getPositionalFeatures(
84 * Answers a list of all contact features, optionally restricted to specified
85 * types, in no particular guaranteed order
89 List<SequenceFeature> getContactFeatures(String... type);
92 * Answers a list of all non-positional features, optionally restricted to
93 * specified types, in no particular guaranteed order
96 * if no type is specified, all are returned
99 List<SequenceFeature> getNonPositionalFeatures(
103 * Deletes the given feature from the store, returning true if it was found
104 * (and deleted), else false. This method makes no assumption that the feature
105 * is in the 'expected' place in the store, in case it has been modified since
110 boolean delete(SequenceFeature sf);
113 * Answers true if this store contains at least one feature, else false
117 boolean hasFeatures();
120 * Returns a set of the distinct feature groups present in the collection. The
121 * set may include null. The boolean parameter determines whether the groups
122 * for positional or for non-positional features are returned. The optional
123 * type parameter may be used to restrict to groups for specified feature
126 * @param positionalFeatures
130 Set<String> getFeatureGroups(boolean positionalFeatures,
134 * Answers the set of distinct feature types for which there is at least one
135 * feature with one of the given feature group(s). The boolean parameter
136 * determines whether the groups for positional or for non-positional features
139 * @param positionalFeatures
143 Set<String> getFeatureTypesForGroups(
144 boolean positionalFeatures, String... groups);
147 * Answers a set of the distinct feature types for which a feature is stored.
148 * The types may optionally be restricted to those which match, or are a
149 * subtype of, given sequence ontology terms
153 Set<String> getFeatureTypes(String... soTerm);
156 * Answers the minimum score held for positional or non-positional features
157 * for the specified type. This may be Float.NaN if there are no features, or
158 * none has a non-NaN score.
164 float getMinimumScore(String type, boolean positional);
167 * Answers the maximum score held for positional or non-positional features
168 * for the specified type. This may be Float.NaN if there are no features, or
169 * none has a non-NaN score.
175 float getMaximumScore(String type, boolean positional);