[BioRuby-cvs] bioruby/lib/bio/db/kegg compound.rb,0.11,0.12

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


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

Modified Files:
	compound.rb 
Log Message:
* license is changed from LGPL to Ruby's


Index: compound.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/compound.rb,v
retrieving revision 0.11
retrieving revision 0.12
diff -C2 -d -r0.11 -r0.12
*** compound.rb	8 Sep 2005 01:22:11 -0000	0.11
--- compound.rb	19 Sep 2006 05:51:29 -0000	0.12
***************
*** 1,22 ****
  #
! # bio/db/kegg/compound.rb - KEGG COMPOUND database class
! #
! #   Copyright (C) 2001, 2002, 2004 KATAYAMA Toshiaki <k at bioruby.org>
! #
! #  This library is free software; you can redistribute it and/or
! #  modify it under the terms of the GNU Lesser General Public
! #  License as published by the Free Software Foundation; either
! #  version 2 of the License, or (at your option) any later version.
! #
! #  This library is distributed in the hope that it will be useful,
! #  but WITHOUT ANY WARRANTY; without even the implied warranty of
! #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
! #  Lesser General Public License for more details.
  #
! #  You should have received a copy of the GNU Lesser General Public
! #  License along with this library; if not, write to the Free Software
! #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 1,9 ----
  #
! # = bio/db/kegg/compound.rb - KEGG COMPOUND database class
  #
! # Copyright::  Copyright (C) 2001, 2002, 2004 Toshiaki Katayama <k at bioruby.org>
! # License::    Ruby's
  #
! # $Id$
  #
  
***************
*** 24,114 ****
  
  module Bio
  
!   class KEGG
! 
!     class COMPOUND < KEGGDB
! 
!       DELIMITER	= RS = "\n///\n"
!       TAGSIZE	= 12
! 
!       def initialize(entry)
!         super(entry, TAGSIZE)
!       end
  
!       # ENTRY
!       def entry_id
!         unless @data['ENTRY']
!           @data['ENTRY'] = fetch('ENTRY').split(/\s+/).first
!         end
!         @data['ENTRY']
!       end
  
!       # NAME
!       def names
!         lines_fetch('NAME') 
!       end
!       def name
!         names[0]
!       end
  
!       # FORMULA
!       def formula
!         field_fetch('FORMULA')
!       end
  
!       # MASS
!       def mass
!         field_fetch('MASS').to_f
!       end
  
!       # REACTION
!       def reactions
!         unless @data['REACTION']
!           @data['REACTION'] = fetch('REACTION').split(/\s+/)
!         end
!         @data['REACTION']
!       end
  
!       # RPAIR
!       def rpairs
!         unless @data['RPAIR']
!           @data['RPAIR'] = fetch('RPAIR').split(/\s+/)
!         end
!         @data['RPAIR']
!       end
  
!       # PATHWAY
!       def pathways
!         lines_fetch('PATHWAY') 
!       end
  
!       # ENZYME
!       def enzymes
!         unless @data['ENZYME']
!           field = fetch('ENZYME')
!           if /\(/.match(field)	# old version
!             @data['ENZYME'] = field.scan(/\S+ \(\S+\)/)
!           else
!             @data['ENZYME'] = field.scan(/\S+/)
!           end
!         end
!         @data['ENZYME']
!       end
  
!       # DBLINKS
!       def dblinks
!         lines_fetch('DBLINKS')
!       end
  
!       # ATOM, BOND
!       def kcf
!         return "#{get('ATOM')}#{get('BOND')}"
        end
- 
      end
  
    end
  
! end
  
  
--- 11,99 ----
  
  module Bio
+ class KEGG
  
! class COMPOUND < KEGGDB
  
!   DELIMITER	= RS = "\n///\n"
!   TAGSIZE	= 12
  
!   def initialize(entry)
!     super(entry, TAGSIZE)
!   end
  
!   # ENTRY
!   def entry_id
!     unless @data['ENTRY']
!       @data['ENTRY'] = fetch('ENTRY').split(/\s+/).first
!     end
!     @data['ENTRY']
!   end
  
!   # NAME
!   def names
!     lines_fetch('NAME') 
!   end
!   def name
!     names[0]
!   end
  
!   # FORMULA
!   def formula
!     field_fetch('FORMULA')
!   end
  
!   # MASS
!   def mass
!     field_fetch('MASS').to_f
!   end
  
!   # REACTION
!   def reactions
!     unless @data['REACTION']
!       @data['REACTION'] = fetch('REACTION').split(/\s+/)
!     end
!     @data['REACTION']
!   end
  
!   # RPAIR
!   def rpairs
!     unless @data['RPAIR']
!       @data['RPAIR'] = fetch('RPAIR').split(/\s+/)
!     end
!     @data['RPAIR']
!   end
  
!   # PATHWAY
!   def pathways
!     lines_fetch('PATHWAY') 
!   end
  
!   # ENZYME
!   def enzymes
!     unless @data['ENZYME']
!       field = fetch('ENZYME')
!       if /\(/.match(field)	# old version
!         @data['ENZYME'] = field.scan(/\S+ \(\S+\)/)
!       else
!         @data['ENZYME'] = field.scan(/\S+/)
        end
      end
+     @data['ENZYME']
+   end
+ 
+   # DBLINKS
+   def dblinks
+     lines_fetch('DBLINKS')
+   end
  
+   # ATOM, BOND
+   def kcf
+     return "#{get('ATOM')}#{get('BOND')}"
    end
  
! end # COMPOUND
! 
! end # KEGG
! end # Bio
  
  




More information about the bioruby-cvs mailing list