goruby 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/go.rb +8 -5
  3. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.1.0
data/lib/go.rb CHANGED
@@ -7,7 +7,6 @@ module Bio
7
7
  def initialize
8
8
  @r = RSRuby.instance
9
9
  @r.library('GO.db')
10
- # @r.print('initing') #debug to test if this is being loaded twice
11
10
  end
12
11
 
13
12
  # Return an array of GO identifiers that are the offspring (all the descendents)
@@ -70,13 +69,17 @@ module Bio
70
69
  #Synonym: ThTPase activity
71
70
  #Synonym: GO:0048253
72
71
  #Secondary: GO:0048253
72
+
73
+ # A performance note:
74
+ # According to some tests that I ran, finding GOID by searching GOTERM
75
+ # is much faster than by GOSYNONYM. A
73
76
 
74
77
  begin
75
- # try to find the synonym
76
- return @r.eval_R("GOID(get('#{go_id_or_synonym_id}', GOSYNONYM))")
77
- rescue RException
78
- # if no synonym is found, try to find the primary ID. raise RException if none is found
78
+ # Assume it is a primary ID, as it likely will be most of the time.
79
79
  return @r.eval_R("GOID(get('#{go_id_or_synonym_id}', GOTERM))")
80
+ rescue RException
81
+ # if no primary is found, try to finding it by synonym. raise RException if none is found
82
+ return @r.eval_R("GOID(get('#{go_id_or_synonym_id}', GOSYNONYM))")
80
83
  end
81
84
  end
82
85
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben J Woodcroft