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?
2 answers
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.
Thank you- good to know!
Log in to answer this question.
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.