This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Gene Ontology: Shortest Path From Root To Node

Given some GO BP terms for a gene I wish to find out, which of the terms has more specific meaning. I wish to find out the length of the shortest path between the BP Root term(GO:0008150) and the given term. Is there any suitable way to do that using any R package? Like something equivalent to my $length = $node->lengthOfShortestPathToRoot; in Perl's "GO-TermFinder" package.

Thanks in advance

gene-ontology

1 answer

my xsd-sandbox contains a parser for GO as well as some simple bindings to query GO using java (see http://plindenbaum.blogspot.fr/2013/01/a-xml-schema-xsd-for-geneontology.html ).

download GO:

curl "http://archive.geneontology.org/latest-termdb/go_daily-termdb.rdf-xml.gz" |\
    gunzip -c | grep -v " go.xml

generate the classes (requires xjc with java 7)

jdk1.7.0_01/bin/xjc -extension -Xinject-code -b schemas/bio/go/go.jxb -d tmp schemas/bio/go/go.xsd

compile:

jdk1.7.0_01/bin/javac -d tmp -sourcepath tmp  `find tmp -name "ObjectFactory.java"`

find the shortest path for GO:1900848

java  -cp tmp generated.org.genontology.go.Go shortestpath go.xml GO:1900848

GO:1900848    GO:0031328    GO:0009891    GO:0009889    GO:0019222    GO:0050789    GO:0065007    GO:0008150    all

Log in to answer this question.