1 package jalview.datamodel.ontology;
7 public interface OntologyI
10 * Answers true if the term can be identified in the ontology (possibly by id,
11 * description or alias), else false
16 boolean isValidTerm(String term);
19 * Answers true if <code>childTerm</code> is the same as, or a sub-type
20 * (specialisation of) <code>parentTerm</code>, else false
26 boolean isA(String childTerm, String parentTerm);
29 * Answers those terms in the given set which are not child terms of some
30 * other term in the set. That is, returns a set of parent terms. The input
31 * set is not modified.
36 Set<String> getParentTerms(Set<String> terms);
39 * Answers a (possibly empty) list of those terms in the supplied list which
40 * are a child (directly or indirectly) of <code>parent</code>. The parent
41 * term itself is not included (even if in the input list)
47 List<String> getChildTerms(String parent, List<String> terms);
50 * Answers a (possibly empty) list of the immediate parent terms of the given
56 List<String> getParents(String term);
59 * Returns a sorted list of all valid terms queried for (i.e. terms processed
60 * which were valid in the SO), using the friendly description.
62 * This can be used to check that any hard-coded stand-in for the full SO
63 * includes all the terms needed for correct processing.
67 List<String> termsFound();
70 * Returns a sorted list of all invalid terms queried for (i.e. terms
71 * processed which were not found in the SO), using the friendly description.
73 * This can be used to report any 'non-compliance' in data, and/or to report
74 * valid terms missing from any hard-coded stand-in for the full SO.
78 List<String> termsNotFound();
81 * Answers the top level parent terms (normally only one) for the given term,
82 * that is, those that have no parent themselves. Answers null if {@code term}
83 * is not a sequence ontology term. Answers a list just containing
84 * {@code term} if it is a valid term with no parent.
89 List<String> getRootParents(String term);
92 * Answers a (possibly empty) map of any Ontology terms (from the given term
93 * and its parents) which subsume one or more of the target terms. The map key
94 * is an ontology term, and the entry is the list of target terms that are
95 * sub-terms of the key.
97 * For example if {@code stop_gained} and {@code stop_lost} are known feature
98 * types, then SO term {@ nonsynonymous_variant} is the first common parent of
102 * the term to search from
104 * candidate terms to 'capture' in ontology groupings
107 Map<String, List<String>> findSequenceOntologyGroupings(String givenTerm,
108 List<String> targetTerms);