Are the relations in the database always transitive or do I have to compute the transitive closure to be sure?
Hello
I would like to be able to check relations between go terms in an automated manner.
Assume for example I have two terms, say GO:0019900 and GO:0007050.
Now I would like to be able know if for example GO:0019900 some regulated by GO:0007050 and such.
On the gene ontology web, I can search for one term see the relation graph and check if the second term is there. But I would like to know if it can be done automatically - for example if there is a GO API for this, or if an OWL reasoner could perhaps verify this information in the OWL version of the ontology.
Thanks
2 answers
There are several ways to do this:
- directly query the GO MySQL database
- use the GO::Parser perl module
- use the Bioconductor GO.db package
- use owltools
using mysql:
SELECT DISTINCT
child.acc AS child_acc,
child.name AS child_name,
rel.acc AS rel,
parent.acc AS parent_acc,
parent.name AS parent_name
FROM
term AS child,
term AS parent,
term AS rel,
graph_path
WHERE
child.id=graph_path.term2_id AND
parent.id=graph_path.term1_id AND
rel.id = graph_path.relationship_type_id AND
child.acc in ("GO:0007049", "GO:0007050") AND
parent.acc in ("GO:0007049", "GO:0007050") AND
child.acc!=parent.acc
;
example:
$ mysql -hmysql.ebi.ac.uk -ugo_select -pamigo -P4085 go_latest -A < input.sql
child_acc child_name rel parent_acc parent_name
GO:0007050 cell cycle arrest negatively_regulates GO:0007049 cell cycle
GO:0007050 cell cycle arrest part_of GO:0007049 cell cycle
GO:0007050 cell cycle arrest regulates GO:0007049 cell cycle
Transitive closures are pre-computed in the graph_path table.
Log in to answer this question.