Building a Filter

Setting the Filter Design Mode

There are a number of filter design modes in OBO-Edit. Filters are used throughout OBO-Edit; sometimes the filter design mode can be specified by the user, and sometimes the design mode is locked. (The latter case tends to be seen in complex controls where a lot of fine control is needed; in these cases, the filter design controls are usually locked into the most advanced settings).

When the filter design mode is user configurable, the design mode can be set by clicking the "Advanced" tab of the filter designer. For example, by default, OBO-Edit's search control looks like this:

 

If you click the "Advanced" tab, the advanced interface appears:

 

By clicking combinations of the checkboxes in this panel, you can select the filter design mode. The meanings of these checkboxes are discussed below.

Term Filters

In this discussion of filtering, we will begin with the simplest sort of filtering, and work our way up to more complex filters.

Keyword Filtering

Keyword filtering is only possible for term filters. To enable keyword filtering, click the "Keyword filtering" button in the "Advanced" tab. When keyword filtering is enabled, the "Compound filtering" and "Link filtering" options are disabled.

Keyword filtering works like a google search. Type a list of keywords you would like to match in the ontology, seperated by spaces. The filter will match terms that contain all the keywords you specified.

Keywords filtering searches not only the term name, but all synonyms, the definition, the comments, and any dbxref descriptions.

Standard Filtering

Standard filtering is a much more powerful way of filtering an ontology, but the interface is more complex. To enable standard filtering, make sure the "Term filtering" checkbox is clicked and the "Keyword filtering" checkbox is unclicked in the "Advanced" tab.

The standard filtering control looks like this:

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 will occur out of order, with the more commonly used features described first.

Overview of How Standard 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 NOT box 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:

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.

Numeric Attribute Comparisons

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.

NOT

This checkbox inverts the search. If a search would normally return all terms with the word "kinase" in the name, but the NOT box was checked, the search would 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.

There are three possible values for the search aspect:

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 2 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".