0.0
No commit activity in last 3 years
No release in over 3 years
Parses gene ontology .obo files, links terms through `is_a` and provides methods to find levels and traverse the tree.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.16
~> 5.0
~> 10.0
 Project Readme

GeneOntology

Parses gene ontology .obo files, links terms through is_a and provides methods to find levels and traverse the tree.

Installation

Add this line to your application's Gemfile:

gem 'gene_ontology'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gene_ontology

Usage

require 'gene_ontology'

# download from http://purl.obolibrary.org/obo/go.obo
go = GeneOntology.from_file("go.obo")

go.header # => a GeneOntology::Header object
go.id_to_term # => a hash from GO id to the GeneOntology::Term

some_term = go.id_to_term.values.first

# traverse the tree upwards, beginning with the current Term
some_term.each do |term|
  term.name =~ /Plasma Membrane/i
end
some_term.level  # => how many levels down from the top 3
                 # molecular_function, biol comp. etc are level 0

Testing

rake test

Note: will download http://purl.obolibrary.org/obo/go.obo to a tempfile unless 'go.obo' is already in package root. Just for testing.

License

MIT License -- see LICENSE for copyright info.