{"id":26663332,"url":"https://github.com/mjy/obo_parser","last_synced_at":"2025-04-11T18:33:06.702Z","repository":{"id":56886094,"uuid":"567053","full_name":"mjy/obo_parser","owner":"mjy","description":"An OBO file parser.","archived":false,"fork":false,"pushed_at":"2019-04-04T20:52:41.000Z","size":538,"stargazers_count":6,"open_issues_count":2,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T14:33:46.094Z","etag":null,"topics":["obo","ontology","parser"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-03-17T19:06:10.000Z","updated_at":"2019-11-09T02:34:37.000Z","dependencies_parsed_at":"2022-08-21T00:50:14.127Z","dependency_job_id":null,"html_url":"https://github.com/mjy/obo_parser","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjy%2Fobo_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjy%2Fobo_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjy%2Fobo_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjy%2Fobo_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjy","download_url":"https://codeload.github.com/mjy/obo_parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248458923,"owners_count":21107181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["obo","ontology","parser"],"created_at":"2025-03-25T14:27:38.257Z","updated_at":"2025-04-11T18:33:06.669Z","avatar_url":"https://github.com/mjy.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/mjy/obo_parser.svg?branch=master)](https://travis-ci.org/mjy/obo_parser)\n[![Dependency Status](https://gemnasium.com/badges/github.com/mjy/obo_parser.svg)](https://gemnasium.com/github.com/mjy/obo_parser)\n\n# obo_parser\n\nA simple Ruby gem for parsing OBO 1.2 (?4) formatted ontology files.  Useful for reporting, comparing, and mapping data to other databases.  There is presently no functionality for logical inference across the ontology.\n\n## Installation\n\n    gem install obo_parser\n\n## Use\n\n### General \n    require 'obo_parser'\n    o = parse_obo_file(File.read('my_ontology.obo'))  # =\u003e An OboParser instance  \n    first_term = o.terms.first                        # =\u003e An OboParser#Term instance \n   \n    first_term.id.value                                 # =\u003e 'HAO:1234'\n \n    d = first_term.def                                  # =\u003e An OboParser#Tag instance\n    d.tag                                               # =\u003e 'def'\n    d.value                                             # =\u003e 'Some defintition'\n    d.xrefs                                             # =\u003e ['xref:123', 'xref:456'] \n    d.comment                                           # =\u003e 'Some comment'\n    \n    t = first_term.name                                 # =\u003e An OboParser#Tag instance    \n    t.tag                                               # =\u003e 'name'\n    t.value                                             # =\u003e 'Some Term name' \n    \n    o = first_term.other_tags                           # =\u003e [OboParser#Tag, ... ] An array of tags that are not specially referenced in an OboParser::Stanza\n    o.first                                             # =\u003e An OboParser#Tag instance    \n\n    first_typedef = o.typdefs.first                   # =\u003e An OboParser#Typdef instance \n    first_typdef.id.value                               # =\u003e 'Some typedef id'\n    first_typdef.name.value                             # =\u003e 'Some typedef name'\n\n    o.terms.first.tags_named('synonym')               # =\u003e [OboParser#Tag, ... ]\n    o.terms.first.tags_named('synonym').first.tag     # =\u003e 'synonym'\n    o.terms.first.tags_named('synonym').first.value   # =\u003e 'Some label'\n\n    o.terms.first.relationships                       # =\u003e [['relationship', 'FOO:123'], ['other_relationship', 'FOO:456'] ...] An array of [relation, related term id], includes 'is_a', 'disjoint_from' and Typedefs\n\n### Convenience methods  \n    \n    o.term_hash                                       # =\u003e { term (String) =\u003e id (String), ... for each [Term] in the file. } !! Assumes names terms are unique, they might not be, in which case you get key collisions. \n    o.id_hash                                         # =\u003e { id (String) =\u003e term (String), ... for each [Term] in the file. } \n\nSee also /test/test_obo_parser.rb\n\n## Utilities\n\nA small set of methods (e.g. comparing OBO ontologies) utilizing the gem are included in /lib/utilities.rb.  For example: 1) shared labels across sets of ontologies can be found and returned, 2) ontologies can be dumped into a simple Cytoscape node/edge format; 3) given a set of correspondances between two ontologies various reports can be made. \n\n### Viz\n   \n    OboParser::Utilities::Viz.mock_coordinate_space(o, size: 100) # =\u003e STDOUT tab delimited table with x, y, z, identifier, label \n\n## Contributing\n\nFork, test, code, test, pull request.\n\n## Copyright\n\nCopyright (c) 2010-2017 Matt Yoder. See LICENSE for details.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjy%2Fobo_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjy%2Fobo_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjy%2Fobo_parser/lists"}