Question: Find all the children(GO IDs) for a given parent ID (GO ID) using Go ontology and R
0
gravatar for animesh_10kuet
2.8 years ago by
animesh_10kuet10 wrote:

I need to find all the children(GO IDs) under a parents (GO ID) of GO ontology (Go tree).

Suppose, a GO ID = GO:0007114 (cell budding), Need to find all the children of it for all the labels.

Is there any R package or other way for finding the children based on GO Ontology for specific GO ID?

genome go R gene • 4.6k views
ADD COMMENTlink modified 2.8 years ago by dariober10.0k • written 2.8 years ago by animesh_10kuet10

Hello animesh_10kuet!

It appears that your post has been cross-posted to another site: http://stackoverflow.com/questions/38178531

This is typically not recommended as it runs the risk of annoying people in both communities.

ADD REPLYlink written 2.8 years ago by Pierre Lindenbaum118k
2
gravatar for dariober
2.8 years ago by
dariober10.0k
WCIP | Glasgow | UK
dariober10.0k wrote:

A while ago I was asked the same question with solution preferably in python and I came up with this:

Get Orange-Bioinformatics python library:

pip install --user Orange-Bioinformatics

Get database of go terms:

wget http://purl.obolibrary.org/obo/go.obo

Produce a table with two columns, child_term, parent_term:

python

import Orange.bio.obiOntology

obi= Orange.bio.obiOntology.OBOOntology('go.obo')
all_terms= obi.terms()

fout= open('go.obo.paired.txt', 'w')
fout.write('child_term\tparent_term\n')
for t in all_terms:
    parents= obi.super_terms(t)
    if len(parents) == 0:
        fout.writet.id + '\t' + 'NA' + '\n')
    else:
        for p in parents:
            fout.writet.id + '\t' + p.id + '\n')
fout.close()

len(all_terms)
quit()

Output table file looks like this. It should be fairly easy from here to get all children of a parent or vice-versa using e.g. grep:

child_term      parent_term
GO:0000001      GO:1902589
GO:0000001      GO:0071840
GO:0000001      GO:0007005
GO:0000001      GO:0051641
GO:0000001      GO:0016043
GO:0000001      GO:0044763
GO:0000001      GO:1902580
GO:0000001      GO:1902578

Hope this helps.

ADD COMMENTlink modified 2.8 years ago • written 2.8 years ago by dariober10.0k
1

For python, there's also goatools.

ADD REPLYlink written 2.8 years ago by Jean-Karim Heriche18k

Thank you- good to know!

ADD REPLYlink written 2.8 years ago by dariober10.0k
1
gravatar for Jean-Karim Heriche
2.8 years ago by
EMBL Heidelberg, Germany
Jean-Karim Heriche18k wrote:

I think the R package GO.db can do this. Alternatively, in perl, you can use the go-perl library.

ADD COMMENTlink modified 2.8 years ago • written 2.8 years ago by Jean-Karim Heriche18k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1503 users visited in the last hour