[BioRuby-cvs] bioruby/lib/bio/db/kegg enzyme.rb,0.9,0.10

Katayama Toshiaki k at dev.open-bio.org
Mon Jan 15 04:50:08 UTC 2007


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

Modified Files:
	enzyme.rb 
Log Message:
* entry_id is changed to entry method as it returns a "EC x.x.x.x    Enzyme"
  style string. Instead, entry_id method is changed to return EC number only.
* obsolete? method is added, which returns boolean value (true/false) according
  to the ENTRY line contains Obsolete or not.
* all_reac, iubmb_reactions, kegg_reactions methods are added to support
  new ALL_REAC field.
* inhibitors and orthologs methods are added.
* substrates, products, inhibitors, cofactors, pathways, orthologs, diseases,
  motifs methods now utilizes new lines_fetch method in db.rb to process
  continuous sub field.


Index: enzyme.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/enzyme.rb,v
retrieving revision 0.9
retrieving revision 0.10
diff -C2 -d -r0.9 -r0.10
*** enzyme.rb	19 Sep 2006 05:52:05 -0000	0.9
--- enzyme.rb	15 Jan 2007 04:50:05 -0000	0.10
***************
*** 2,6 ****
  # = bio/db/kegg/enzyme.rb - KEGG/ENZYME database class
  #
! # Copyright::  Copyright (C) 2001, 2002 Toshiaki Katayama <k at bioruby.org>
  # License::    Ruby's
  #
--- 2,6 ----
  # = bio/db/kegg/enzyme.rb - KEGG/ENZYME database class
  #
! # Copyright::  Copyright (C) 2001, 2002, 2007 Toshiaki Katayama <k at bioruby.org>
  # License::    Ruby's
  #
***************
*** 23,36 ****
  
    # ENTRY
!   def entry_id
      field_fetch('ENTRY')
    end
  
    # NAME
    def names
!     lines_fetch('NAME')
    end
    def name
!     names[0]
    end
  
--- 23,45 ----
  
    # ENTRY
!   def entry
      field_fetch('ENTRY')
    end
  
+   def entry_id
+     entry[/EC (\S+)/, 1]
+   end
+ 
+   def obsolete?
+     entry[/Obsolete/] ? true : false
+   end
+ 
    # NAME
    def names
!     field_fetch('NAME').split(/\s*;\s*/)
    end
+ 
    def name
!     names.first
    end
  
***************
*** 45,66 ****
    end
  
!   # REACTION ';'
    def reaction
      field_fetch('REACTION')
    end
    
    # SUBSTRATE
    def substrates
!     lines_fetch('SUBSTRATE')
    end
  
    # PRODUCT
    def products
!     lines_fetch('PRODUCT')
    end
  
    # COFACTOR
    def cofactors
!     lines_fetch('COFACTOR')
    end
  
--- 54,98 ----
    end
  
!   # REACTION
    def reaction
      field_fetch('REACTION')
    end
+ 
+   # ALL_REAC ';'
+   def all_reac
+     field_fetch('ALL_REAC')
+   end
+ 
+   def iubmb_reactions
+     all_reac.sub(/;\s*\(other\).*/, '').split(/\s*;\s*/)
+   end
+ 
+   def kegg_reactions
+     reac = all_reac
+     if reac[/\(other\)/]
+       reac.sub(/.*\(other\)\s*/, '').split(/\s*;\s*/)
+     else
+       []
+     end
+   end
    
    # SUBSTRATE
    def substrates
!     field_fetch('SUBSTRATE').split(/\s*;\s*/)
    end
  
    # PRODUCT
    def products
!     field_fetch('PRODUCT').split(/\s*;\s*/)
!   end
! 
!   # INHIBITOR
!   def inhibitors
!     field_fetch('INHIBITOR').split(/\s*;\s*/)
    end
  
    # COFACTOR
    def cofactors
!     field_fetch('COFACTOR').split(/\s*;\s*/)
    end
  
***************
*** 75,78 ****
--- 107,115 ----
    end
  
+   # ORTHOLOG
+   def orthologs
+     lines_fetch('ORTHOLOG')
+   end
+ 
    # GENES
    def genes
***************
*** 93,102 ****
    def structures
      unless @data['STRUCTURES']
!       @data['STRUCTURES'] =
!         fetch('STRUCTURES').sub(/(PDB: )*/,'').split(/\s+/)
      end
      @data['STRUCTURES']
    end
  
    # DBLINKS
    def dblinks
--- 130,140 ----
    def structures
      unless @data['STRUCTURES']
!       @data['STRUCTURES'] = fetch('STRUCTURES').sub(/(PDB: )*/,'').split(/\s+/)
      end
      @data['STRUCTURES']
    end
  
+   # REFERENCE
+ 
    # DBLINKS
    def dblinks




More information about the bioruby-cvs mailing list