[BioRuby-cvs] bioruby/lib/bio/db/kegg genes.rb,0.20,0.21

Katayama Toshiaki k at pub.open-bio.org
Wed Nov 9 02:15:44 EST 2005


Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg
In directory pub.open-bio.org:/tmp/cvs-serv30701/lib/bio/db/kegg

Modified Files:
	genes.rb 
Log Message:
* Bio::KEGG::GENES#dblinks method is changed to return a Hash of Array of
  IDs instead of a Hash of String.


Index: genes.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/genes.rb,v
retrieving revision 0.20
retrieving revision 0.21
diff -C2 -d -r0.20 -r0.21
*** genes.rb	8 Sep 2005 01:22:11 -0000	0.20
--- genes.rb	9 Nov 2005 07:15:42 -0000	0.21
***************
*** 80,83 ****
--- 80,84 ----
  
        def eclinks
+ #       definition.slice(/\[EC:(.*?)\]/, 1)	# ruby >= 1.7
  #       definition.scan(/\[EC:(.*?)\]/).flatten
          if /\[EC:(.*?)\]/.match(definition)
***************
*** 89,92 ****
--- 90,94 ----
  
        def splinks
+ #       definition.slice(/\[SP:(.*?)\]/, 1)	# ruby >= 1.7
  #       definition.scan(/\[SP:(.*?)\]/).flatten
          if /\[SP:(.*?)\]/.match(definition)
***************
*** 127,136 ****
          unless @data['DBLINKS']
            hash = {}
!           get('DBLINKS').scan(/(\S+):\s*(\S+)\n/).each do |k, v|
!             hash[k] = v
            end
            @data['DBLINKS'] = hash
          end
!         @data['DBLINKS']		# Hash of DB:ID in DBLINKS
        end
  
--- 129,139 ----
          unless @data['DBLINKS']
            hash = {}
!           get('DBLINKS').scan(/(\S+):\s*(.*)\n/).each do |db, str|
!             id_array = str.strip.split(/\s+/)
!             hash[db] = id_array
            end
            @data['DBLINKS'] = hash
          end
!         @data['DBLINKS']		# Hash of Array of DB IDs in DBLINKS
        end
  



More information about the bioruby-cvs mailing list