[BioRuby-cvs] bioruby/lib/bio/db/kegg kgml.rb,1.4,1.5

Katayama Toshiaki k at dev.open-bio.org
Tue Sep 19 05:55:40 UTC 2006


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

Modified Files:
	kgml.rb 
Log Message:
* accessor for component attribute is added


Index: kgml.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/kgml.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** kgml.rb	25 Jul 2006 19:17:39 -0000	1.4
--- kgml.rb	19 Sep 2006 05:55:38 -0000	1.5
***************
*** 8,11 ****
--- 8,17 ----
  # $Id$
  #
+ 
+ autoload :REXML, 'rexml/document'
+ 
+ module Bio
+ class KEGG
+ 
  # == KGML (KEGG XML) parser
  #
***************
*** 61,64 ****
--- 67,72 ----
  #    puts entry.fgcolor
  #    puts entry.bgcolor
+ #    # <component> attributes
+ #    puts entry.components
  #    # methood
  #    puts entry.names
***************
*** 101,110 ****
  #  end
  #
- 
- autoload :REXML, 'rexml/document'
- 
- module Bio
- class KEGG
- 
  class KGML
  
--- 109,112 ----
***************
*** 122,125 ****
--- 124,128 ----
      attr_accessor :entry_id, :name, :entry_type, :link, :reaction, :map
      attr_accessor :label, :shape, :x, :y, :width, :height, :fgcolor, :bgcolor
+     attr_accessor :components
      def names
        @name.split(/\s+/)
***************
*** 178,181 ****
--- 181,191 ----
          entry.bgcolor  = attr["bgcolor"]
        }
+ 
+       node.elements.each("component") { |component|
+         attr = component.attributes
+         entry.components ||= []
+         entry.components << attr["id"].to_i
+       }
+ 
        @entries << entry
      }




More information about the bioruby-cvs mailing list