-
Notifications
You must be signed in to change notification settings - Fork 34
Annotation Extension Folding
GO annotation extensions (aka col16) are a way to post-compose descriptions.
This page describes how to use OWLTools to perform two operations
- Folding: Taking a GAF + ontology and generating pre-composed classes and mapping annotations to these terms
- Unfolding: Taking a GAF + ontology(ies) and generating c16 extensions based on logical definitions
First see Command Line Examples
Remember on the command line in owltools, order is important. Commands are executed in order
All commands should start something like this:
owltools go.obo --gaf mgi.gaf
Formally, folding takes an anonymous Class Expression CE and generates a new class C together with an Equivalence Axiom:
EquivalentClasses(C CE)
We optionally also include a label
In GAF-2.0, annotation extensions are equivalent to annotations to class expressions
For example, if we had an annotation
gene: geneA
annotation_class: GO:0006915 ! apoptosis
annotation_extension: occurs_in(CL:0000700) ! dopaminergic neuron
and performed folding on it, a new class would be added to the ontology with a TEMP id, which in obo format would look like:
id: GOTEMP-nnnn
name: apoptosis and occurs_in some dopaminergic neuron
intersection_of: GO:0006915 ! apoptosis
intersection_of: occurs_in CL:0000700 ! dopaminergic neuron
If reasoning is performed, then this TEMP class is placed in the hierarchy automatically
The annotation would be mapped to:
gene: geneA
annotation_class: GOTEMP-nnnn
Folding is used when we have an application that is not annotation-extension compliant. The combined (GO,GAF) set is transformed into a logically equivalent structure.
To run this:
owltools go.obo cl.owl --gaf mgi.gaf --gaf-fold-extensions --write-gaf mgi-folded.gaf -o -f obo go-tr.obo
Note that reasoning is performed automatically here.
Make sure you include whichever external ontologies are required to get the correct labels and inferences
Unfolding is the reverse operation of folding. For unfolding to have an effect, the ontology must have equivalence axioms (ie logical definitions).
Unfolding is used when an application wants to expose the logical structure of a term used in an annotation. For example, an annotation-extension compliant GAF tool may allow searching on c16.
As an example, if the ontology contains an equivalence axiom (written here in obo)
id: GO:0006264
name: mitochondrial DNA replication
intersection_of: GO:0006260 ! DNA replication
intersection_of: occurs_in GO:0005739 ! mitochondrion
And we have an annotation:
Gene = geneA
Annotation_class = GO:0006264 ! mitochondrial DNA replication
Annotation_extension = {}
Unfolding would generate:
Gene = geneA
Annotation_class = GO:0006260 ! DNA replication
Annotation_extension = {occurs_in GO:0005739 ! mitochondrion}
To perform this:
owltools go.obo --gaf mgi.gaf --gaf-unfold-extensions --write-gaf mgi-folded.gaf -o -f obo go-tr.obo
A variant of unfolding is partial unfolding, where the annotation class is left untouched, but the extension is added. The results are formally redundant but some applications may prefer this form.
E.g.
Gene = geneA
Annotation_class = GO:0006264 ! mitochondrial DNA replication
Annotation_extension = {occurs_in GO:0005739 ! mitochondrion}
To perform this:
owltools go.obo --gaf mgi.gaf --gaf-unfold-extensions -n --write-gaf mgi-folded.gaf -o -f obo go-tr.obo
An operation related to folding is annotation deepening, where we find the MSC for a specified class.
Here we fold the class expressions, run the reasoner to find the most specific pre-existing named classes, and replace annotations with these.
For example, given:
Gene = geneA
Annotation_class = GO:0006260 ! DNA replication
Annotation_extension = {occurs_in GO:0000262 ! mitochondrial chromosome}
We can infer:
Gene = geneA
Annotation_class = GO:0006264 ! mitochondrial DNA replication
Annotation_extension = {occurs_in GO:0000262 ! mitochondrial chromosome}
Based on axioms in the GO
To generate deeper annotations:
owltools x-cell.owl --gaf mgi.gaf --gaf-fold-inferences