sgsfak / oboparse.py

Parses the OBO format in python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

oboparse.py

Parses the OBO format in python

By default it prints each "stanza" in the JSON format.

For example:

curl http://www.geneontology.org/ontology/obo_format_1_2/gene_ontology_ext.obo | python oboparse.py 

Or you can use the jq to create a CSV with the terms:

< gene_ontology_ext.obo python oboparse.py | jq -r '.| select(.["@type"]=="Term")|[.id, .name, .["def"], .is_obsolete//false] | @csv'

or a CSV containing the hierarchy of terms:

< gene_ontology_ext.obo python oboparse.py | jq -r '.| select(.["@type"]=="Term" and .is_a)|{id, parent: .is_a[] }|[.id, .parent]|@csv'

About

Parses the OBO format in python

License:Apache License 2.0


Languages

Language:Python 100.0%