Skip to content

Finding Common Ancestors

hdietze edited this page Jun 11, 2015 · 2 revisions

Finding common ancestors via OWLTools.

Background

To avoid terminological confusion, we draw a distinction between superclasses and ancestors. Sometimes in the OWL community "parents" and "ancestors" means the same as "direct subclass" and "subclass", but in the GO/bioinformatics community, parent/ancestor encompasses paths through the ontology graph over other relationships.

  • A is the ancestor of B if and only if A can be reached via a chain of zero or more OBO relationships. For a more formal definition that works for any OWL ontology, see owltools.graph

  • subclass means the same as isa in OBO ontologies. Generally, A subclass of B means inferred subclass, rather than direct.

Note that any OWL reasoner can find the list of named superclasses of any class. Finding the ancestor requires additional work - OWLTools has some convenience methods for this. These methods work for both simple OBO format ontologies and more advanced OWL ontologies

Command Line Usage

Type:

owltools -h

For a full list of commands

Example (find all ancestors of apoptosis)

owltools go.obo -a apoptosis

Note that this assumes the ontology is classified in advance (which is typically the case for any public release an obolibrary.org ontology)

OWLTools also includes convenience wrappers for OWL reasoners

owltools go-unclassified.obo --reasoner jcel --run-reasoner

API

See the owltools.graph.OWLGraphWrapper API docs for methods such as:

Common Ancestors

For finding common ancestors or common superclasses, use the owltools.sim package. This has advanced capabilities for computing similarity between any two classes.

Simply finding common ancestors is easier:

OWLGraphWrapper  g =  getOntologyWrapper("file:go.obo");

// negative regulation of type B pancreatic cell apoptosis
OWLObject a = g.getOWLObjectByIdentifier("GO:2000675");

// caspase activator activity
OWLObject a = g.getOWLObjectByIdentifier("GO:0008656");

SimEngine se = new SimEngine(g);
for (OWLObject c : se.getLeastCommonSubsumers(a,b)) {
  System.out.println(c);
}

Advanced

OWLSim is an experimental extension to OWLTools - whilst the core of OWLTools is relatively stable, and in production use by the GO consortium, the owltools.sim portion may change (and may be split into a separate project).

As well as finding the name common ancestors, OWLSim provides methods for finding anonymous common ancestors, as well as means to compute the semantic similarity between any two classes.

For more details see [http://owlsim.org]