Find all the children(GO IDs) for a given parent ID (GO ID) using Go ontology and R
2
0
Entering edit mode
8.3 years ago

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?

R gene genome go • 8.7k views
ADD COMMENT
0
Entering edit mode

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 REPLY
3
Entering edit mode
8.3 years ago

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 COMMENT
1
Entering edit mode

For python, there's also goatools.

ADD REPLY
0
Entering edit mode

Thank you- good to know!

ADD REPLY
1
Entering edit mode
8.3 years ago

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

ADD COMMENT

Login before adding your answer.

Traffic: 1181 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6