Building Filters
This page provides an overview of how the OBO-Edit filtering system
works, covering basic criteria common to term and link filters. For a
more detailed description of the filter-building interface, including
constructing complex queries, see the Term
Filters page. Aspects of filters specific for links are described
on the Link Filters page.
The standard filtering control looks like this:

Clicking the
icon reveals an additional selector:

The controls in this component have the following
names:

The meaning of some of these components is not immediately
obvious. The detailed discussion of these components is presented out
of order, with the more commonly used features described first.
Overview of How Filtering is Done
For each term in the ontology, the aspect control determine which
terms should be examined to establish a match. (Normally, the search aspect is
self, so only the term itself is examined.) The attribute
values are then fetched for each term to be examined. Sometimes there will be a
single attribute value (if the attribute is "name", for example)
or sometimes there will be several (if the attribute is "synonym" or "dbxref",
for example). Each attribute value is compared against the
user-provided value using the given comparison. If ANY of the
attributes match the value, the term matches the filter.
Finally, if the don't have option is selected, the result of the match is
inverted.
Attribute
The search attribute describes which part of the term should be comparied
against the contents of the value box.
Different attributes contain different types of values. Some attributes
contain text values, some contain numeric values, and others contain boolean
(true/false) values. The type of an attribute determines the possible
comparisons that can be done on that attribute.
Some attributes contain a single value (like "name" or "comment" or any
boolean attribute). Some attributes contain many values (like "id", "synonym",
and "dbxref"). Note that if an attribute contains many values, each attribute
value is compared against the user-provided value. Only one attribute
value needs to match for the whole filter to be considered a match.
There are a number of built-in attributes that can be searched:
- Any Text Field (multiple text values) - Searches the term name,
id, synonyms, definition and comments
- Name or Synonym (multiple text values) - Searches the term name
and synonyms
- ID (multiple text values) - Searches the term's primary
id and secondary ids
- Subset (multiple text values) - Searches the
ids of the subsets to which a term belongs. For example, if a term
belongs to a subset called "Plant GO Slim" with the id "goslim_plant" and a
subset called "Generic GO Slim" with the id "goslim_generic", the
subset attribute will
contain "goslim_plant" and "goslim_generic".
- Name (single text value) - Searches the term name
- Synonym (multiple text values) - Searches the term synonyms
- Comment (single text value) - Searches the term comment
- Definition (single text value) - Searches the term definition
- Namespace (single text value) - Searches the term namespace ID. So if a term belongs to a
namespace called "Molecular function" with the id "molecular_function", this
attribute will contain "molecular_function"
- Dbxref (multiple text values) - Searches all the term
dbxrefs, including general dbxrefs, synonym dbxrefs, and definition dbxrefs.
Dbxref searches only look at the dbxref itself, not the optional dbxref
description text.
- General dbxref (multiple text values) - Searches all general
term dbxrefs, but not synonym dbxrefs or definition dbxrefs.
- Definition dbxref (multiple text values) -
Searches all definition dbxrefs, but not synonym dbxrefs or general dbxrefs.
- Synonym dbxref (multiple text values) - Searches all synonym
dbxrefs, but not definition dbxrefs or general dbxrefs.
- Is intersection (boolean value) - Whether or not this term is an
intersection (aka cross product).
- Is is_a complete (boolean
value) - Whether or not there is an unbroken
chain of is_a links from this term to a root.
- Has is_a parent (boolean
value) - Whether or not this term
has at least one is_a link to a parent.
- Has parent with type id (boolean
value) - Whether or not this term has a parent of the type
specified in the value.
- Is anonymous (boolean value) - Whether or not this term is
anonymous. Currently, there is no way to create an anonymous term in OBO-Edit,
so this will only find anonymous terms loaded from a file.
- Is class (boolean value) - Whether this term is a class.
Instances and Relations will return false for this attribute.
- Is obsolete (boolean value) - Whether this term is obsolete.
- Is property (boolean value) - Whether this term is a property, i.e. a relation.
Classes and instances will return false for this attribute.
- Parent count (single numeric value) - The number of parents a
term has. Note that this is a numeric value, so the possible comparisons for
this attribute will be different than for other attributes.
- Is implied (boolean value) - Whether this term was created by a
reasoner. OBO-Edit's reasoner will never create new terms, so implied terms
can only be loaded from a file that was created by an external reasoner, like
OBOL.
- Is transitive (boolean value) - Whether a relation is marked
transitive. This attribute will return false for all non-relations.
- Is built in (boolean value) - Whether a term is
one of the built-in OBO objects, like the is_a relation. Note
that there are some built-in classes that are hidden by default.
- Keyword (boolean value) - Searches all
the keywords for this term. Keywords include all text fields and dbxrefs.
- Has multiple roots (boolean value) - Whether a term has a path to more than one root.
Several additional attributes are specifically relevant to links, and are discussed in the link filter documentation.
Comparison
The search comparison chooses the method that will be used to determine
whether the user-provided value matches the current attribute.
The possible comparisons change depending on the attribute type. If a boolean
attribute is selected, the comparison box (and the value box) are not shown at
all, because boolean attributes return true or false values, and no further
comparison needs to be done.
Text Attribute Comparisons
Text attribute comparisons are not case-sensitive.
- equals -
Matches if an attribute value and the user value are exactly the same.
- contains -
Matches if an attribute contains the user value.
- starts with -
Matches if an attribute starts with the user value.
- ends with - Matches if an attribute ends with the user
value.
- matches wildcard - Performs a
wildcard match where * is the wildcard character. For example, the wildcard
string "*e*ple" would match the strings "people", "example" and "temple" (and probably
many others)
- matches regexp - Performs a regular expression
match. See http://www.regular-expressions.info/quickstart.html,
http://www.newbie.org/gazette/xxaxx/xprmnt02.html,
and http://search.cpan.org/dist/perl/pod/perlre.pod
for information on how regular expressions work.
Numeric Attribute Comparisons
- equals -
Matches if the attribute value and the user value are exactly the same.
- < - Matches
if the attribute value is less than the user value
- <= - Matches
if the attribute value is less than or equal to the user value
- > - Matches
if the attribute value is greater than the user value.
- >= - Matches if that attribute value is greater
than or equals to the user value.
Value
The value will be matched against the attribute value
using the comparison. If the attribute is a numeric attribute,
the value must be an integer, otherwise nothing will match.
have/don't have
The default for this selector is have, and the don't have option inverts the search.
If a search would normally return all terms
with the word "kinase" in the name, but the don't have option is selected, the
search will find every term that does not have "kinase" in the name.
Aspect
Without a doubt, this is the most misunderstood aspect of OBO-Edit filtering,
but it is essential for doing powerful, complex searches.
Normally when searching, every term in the ontology is checked to
see if it matches the current search criteria. But if a search aspect
is specified, each term is checked to see if other related
terms match the search criteria. If one of the related terms
matches, the original search term is considered a match. Note that the
aspect selector is hidden by default, and appears when the
button is clicked.
There are three possible values for the search aspect:
-
Self -
The default behavior. Only the current term is examined.
-
Ancestor - Instead of the current
term itself, examine the ancestors of the current term.
Note: requires the reasoner to be turned on. Does not appear in the
aspect menu unless the reasoner is on.
-
Descendant - Instead of the current
term itself, examine the descendants of the current term.
Note: requires the reasoner to be turned on. Does not appear in the
aspect menu unless the reasoner is on.
Parent - Instead of the current
term itself, examine the parents of the current term.
To demonstrate how aspects work, let's consider a really simple
ontology...

(Note that D has two parents, B & C.)
If we search for [Self] [Name] [equals] "B" (shorthand for
"use the aspect 'Self', the attribute 'Name', the comparison 'equals' and the
search value 'B'"), we get a single result: B. Just as we'd
expect.
But if we change the aspect to Descendant, we get a
different result: A. This is because term A
has a descendant whose name equals "B". No other term matches, because no other
term has a descendant with the name "B". B itself doesn't
match, because B is not a descendant of itself.
If we change the search to [Descendant] [Name] [equals] "D",
we get 3 results: A, B, and C. This is because
these terms are the only terms with a descendant named "D".
The ancestor aspect works in a similar way. If we search for
[Ancestor] [Name] [equals] "B", we get two results:
D and F. These are the two terms that have an
ancestor with the name "B". E does not match, because none of
its ancestors (C and A) have a name that
equals "B".