We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to understand how I can use GOTATOOLS to parse any of the GO files to yield a dictionary that has the following structure:
{id_go: {ec_1, ec_2, ..., ec_n}}
I was able to load the obo file but I couldn't figure out how to get the enzymes:
from goatools.base import get_godag godag = get_godag('Databases/GO/go-basic.obo', optional_attrs='relationship') go = godag['GO:0000015'] for id_go, go in godag.items(): print(id_go, go.get_all_children()) #GO:0000001 set() #GO:0000002 set() #GO:0000006 set() #GO:0000007 set() #GO:0000009 {'GO:0033164', 'GO:0052917'}
They are definitely in there, I just don't how to access them:
%%bash grep -c "EC:" /Users/jolespin/Databases/GO/go-basic.obo # Databases/GO/go-basic.obo:26098
The text was updated successfully, but these errors were encountered:
@jolespin
You are close, EC number is under xref (you can check which field they are under in the .obo file).
xref
.obo
Here are some sample code:
from goatools.base import get_godag godag = get_godag("go-basic.obo", optional_attrs="xref") for id_go, go in godag.items(): ecs = [x for x in go.xref if x.startswith("EC:")] if ecs: print(id_go, ecs)
This prints out:
... GO:0008557 ['EC:7.6.2.1'] GO:1901237 ['EC:7.3.2.6'] GO:0090450 ['EC:3.6.1.64'] GO:0043851 ['EC:2.1.1.246']
Sorry, something went wrong.
Add test_godag_ecs() per #292
2f8e5cb
Add test_godag_ecs() per #292 (#293)
795fb27
* Add test_godag_ecs() per #292 * upgrade versions in build.yml * Add test_get_godag.py in test list
No branches or pull requests
I'm trying to understand how I can use GOTATOOLS to parse any of the GO files to yield a dictionary that has the following structure:
I was able to load the obo file but I couldn't figure out how to get the enzymes:
They are definitely in there, I just don't how to access them:
The text was updated successfully, but these errors were encountered: