Skip to content

Commit

Permalink
test some other ontologies
Browse files Browse the repository at this point in the history
  • Loading branch information
mjy committed Jun 5, 2011
1 parent c9e99d8 commit 2402ec6
Show file tree
Hide file tree
Showing 6 changed files with 51,276 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.rdoc
Expand Up @@ -8,6 +8,8 @@ A simple Ruby gem for parsing OBO 1.2 formatted ontology files. Useful for repo

== Use

=== General

require 'rubygems'
require 'obo_parser'
foo = parse_obo_file(File.read('my_ontology.obo')) # => An OboParser instance
Expand Down Expand Up @@ -36,6 +38,11 @@ A simple Ruby gem for parsing OBO 1.2 formatted ontology files. Useful for repo

foo.terms.first.relationships # => [['relation_ship', 'FOO:123'], ['other_relationship', 'FOO:456'] ...] An array of [relation, related term id], includes 'is_a', 'disjoint_from' and Typedefs

=== Convenience methods

foo.term_hash # => { term (String) => id (String), ... for each [Term] in the file. } !! Assumes names terms are unique, they might not be, in which case you get key collisions.
foo.id_hash # => { id (String) => term (String), ... for each [Term] in the file. }

See also /test/test_obo_parser.rb

== Utilties
Expand Down
2 changes: 1 addition & 1 deletion lib/utilities.rb
Expand Up @@ -10,7 +10,7 @@ module OboParser::Utilities
# of3 = File.read('hao3.obo')
# of4 = File.read('hao4.obo')
#
# OboParser::Utilities::dump_comparison_by_id([of1, of2, of3, of4])
# OboParser::Utilities::dump_comparison_by_id([of1, of2, of3, of4])
def self.dump_comparison_by_id(files = []) # :yields: String
of = []
files.each_with_index do |f, i|
Expand Down

0 comments on commit 2402ec6

Please sign in to comment.