[BioRuby-cvs] bioruby/lib/bio/db rebase.rb,1.2,1.3
Katayama Toshiaki
k at pub.open-bio.org
Mon Feb 27 13:22:07 UTC 2006
Update of /home/repository/bioruby/bioruby/lib/bio/db
In directory pub.open-bio.org:/tmp/cvs-serv3030/db
Modified Files:
rebase.rb
Log Message:
* autoload problem on YAML with Ruby 1.8.2 is fixed
* RDoc is moved in the head
Index: rebase.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/rebase.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rebase.rb 13 Dec 2005 15:02:41 -0000 1.2
--- rebase.rb 27 Feb 2006 13:22:05 -0000 1.3
***************
*** 1,7 ****
- require 'bio/reference'
- module Bio
-
#
! # bio/db/rebase.rb - Interface for EMBOSS formatted REBASE files
#
# Copyright:: Copyright (C) 2005 Trevor Wennblom <trevor at corevx.com>
--- 1,4 ----
#
! # = bio/db/rebase.rb - Interface for EMBOSS formatted REBASE files
#
# Copyright:: Copyright (C) 2005 Trevor Wennblom <trevor at corevx.com>
***************
*** 11,14 ****
--- 8,98 ----
#
#
+ # == Synopsis
+ #
+ # Bio::REBASE provides utilties for interacting with REBASE data in EMBOSS
+ # format. REBASE is the Restriction Enzyme Database, more information
+ # can be found here:
+ #
+
+ # * http://rebase.neb.com
+ #
+ # EMBOSS formatted files located at:
+ #
+ # * http://rebase.neb.com/rebase/rebase.f37.html
+ #
+ # These files are the same as the "emboss_?.???" files located at:
+ #
+ # * ftp://ftp.neb.com/pub/rebase/
+ #
+ # To easily get started with the data you can simply type this command
+ # at your shell prompt:
+ #
+ # % wget ftp://ftp.neb.com/pub/rebase/emboss*
+ #
+ #
+ # == Usage
+ #
+ # require 'bio/db/rebase'
+ # require 'pp'
+ #
+ # enz = File.read('emboss_e')
+ # ref = File.read('emboss_r')
+ # sup = File.read('emboss_s')
+ #
+ # # When creating a new instance of Bio::REBASE
+ # # the contents of the enzyme file must be passed.
+ # # The references and suppiers file contents
+ # # may also be passed.
+ # rebase = Bio::REBASE.new( enz )
+ # rebase = Bio::REBASE.new( enz, ref )
+ # rebase = Bio::REBASE.new( enz, ref, sup )
+ #
+ # # The 'read' class method allows you to read in files
+ # # that are REBASE EMBOSS formatted
+ # rebase = Bio::REBASE.read( 'emboss_e' )
+ # rebase = Bio::REBASE.read( 'emboss_e', 'emboss_r' )
+ # rebase = Bio::REBASE.read( 'emboss_e', 'emboss_r', 'emboss_s' )
+ #
+ # # The data loaded may be saved in YAML format
+ # rebase.save_yaml( 'enz.yaml' )
+ # rebase.save_yaml( 'enz.yaml', 'ref.yaml' )
+ # rebase.save_yaml( 'enz.yaml', 'ref.yaml', 'sup.yaml' )
+ #
+ # # YAML formatted files can also be read with the
+ # # class method 'load_yaml'
+ # rebase = Bio::REBASE.load_yaml( 'enz.yaml' )
+ # rebase = Bio::REBASE.load_yaml( 'enz.yaml', 'ref.yaml' )
+ # rebase = Bio::REBASE.load_yaml( 'enz.yaml', 'ref.yaml', 'sup.yaml' )
+ #
+ # pp rebase.enzymes[0..4] # ["AarI", "AasI", "AatI", "AatII", "Acc16I"]
+ # pp rebase['AarI'].pattern # "CACCTGC"
+ # pp rebase['AarI'].blunt? # false
+ # pp rebase['AarI'].organism # "Arthrobacter aurescens SS2-322"
+ # pp rebase['AarI'].source # "A. Janulaitis"
+ # pp rebase['AarI'].primary_strand_cut1 # 11
+ # pp rebase['AarI'].primary_strand_cut2 # 0
+ # pp rebase['AarI'].complementary_strand_cut1 # 15
+ # pp rebase['AarI'].complementary_strand_cut2 # 0
+ # pp rebase['AarI'].suppliers # ["F"]
+ # pp rebase['AarI'].supplier_names # ["Fermentas International Inc."]
+ #
+ # pp rebase['AarI'].isoschizomers # Currently none stored in the references file
+ # pp rebase['AarI'].methylation # ""
+ #
+ # pp rebase['EcoRII'].methylation # "2(5)"
+ # pp rebase['EcoRII'].suppliers # ["F", "J", "M", "O", "S"]
+ # pp rebase['EcoRII'].supplier_names # ["Fermentas International Inc.", "Nippon Gene Co., Ltd.",
+ # # "Roche Applied Science", "Toyobo Biochemicals",
+ # # "Sigma Chemical Corporation"]
+ #
+ # # Number of enzymes in the database
+ # pp rebase.size # 673
+ # pp rebase.enzymes.size # 673
+ #
+ # rebase.each do |name, info|
+ # pp "#{name}: #{info.methylation}" unless info.methylation.empty?
+ # end
+ #
+ #
#--
#
***************
*** 29,130 ****
#++
#
- #
-
- =begin rdoc
- bio/db/rebase.rb - Interface for EMBOSS formatted REBASE files
-
- == Synopsis
-
- Bio::REBASE provides utilties for interacting with REBASE data in EMBOSS
- format. REBASE is the Restriction Enzyme Database, more information
- can be found here:
- * http://rebase.neb.com
-
- EMBOSS formatted files located at:
- * http://rebase.neb.com/rebase/rebase.f37.html
-
- These files are the same as the "emboss_?.???" files located at:
- * ftp://ftp.neb.com/pub/rebase/
-
- To easily get started with the data you can simply type this command at your shell prompt:
- wget ftp://ftp.neb.com/pub/rebase/emboss*
-
-
- == Usage
-
- require 'bio/db/rebase'
- require 'pp'
-
- enz = File.read('emboss_e')
- ref = File.read('emboss_r')
- sup = File.read('emboss_s')
-
- # When creating a new instance of Bio::REBASE
- # the contents of the enzyme file must be passed.
- # The references and suppiers file contents
- # may also be passed.
- rebase = Bio::REBASE.new( enz )
- rebase = Bio::REBASE.new( enz, ref )
- rebase = Bio::REBASE.new( enz, ref, sup )
-
- # The 'read' class method allows you to read in files
- # that are REBASE EMBOSS formatted
- rebase = Bio::REBASE.read( 'emboss_e' )
- rebase = Bio::REBASE.read( 'emboss_e', 'emboss_r' )
- rebase = Bio::REBASE.read( 'emboss_e', 'emboss_r', 'emboss_s' )
-
- # The data loaded may be saved in YAML format
- rebase.save_yaml( 'enz.yaml' )
- rebase.save_yaml( 'enz.yaml', 'ref.yaml' )
- rebase.save_yaml( 'enz.yaml', 'ref.yaml', 'sup.yaml' )
! # YAML formatted files can also be read with the
! # class method 'load_yaml'
! rebase = Bio::REBASE.load_yaml( 'enz.yaml' )
! rebase = Bio::REBASE.load_yaml( 'enz.yaml', 'ref.yaml' )
! rebase = Bio::REBASE.load_yaml( 'enz.yaml', 'ref.yaml', 'sup.yaml' )
!
! pp rebase.enzymes[0..4] # ["AarI", "AasI", "AatI", "AatII", "Acc16I"]
! pp rebase['AarI'].pattern # "CACCTGC"
! pp rebase['AarI'].blunt? # false
! pp rebase['AarI'].organism # "Arthrobacter aurescens SS2-322"
! pp rebase['AarI'].source # "A. Janulaitis"
! pp rebase['AarI'].primary_strand_cut1 # 11
! pp rebase['AarI'].primary_strand_cut2 # 0
! pp rebase['AarI'].complementary_strand_cut1 # 15
! pp rebase['AarI'].complementary_strand_cut2 # 0
! pp rebase['AarI'].suppliers # ["F"]
! pp rebase['AarI'].supplier_names # ["Fermentas International Inc."]
!
! pp rebase['AarI'].isoschizomers # Currently none stored in the references file
! pp rebase['AarI'].methylation # ""
!
! pp rebase['EcoRII'].methylation # "2(5)"
! pp rebase['EcoRII'].suppliers # ["F", "J", "M", "O", "S"]
! pp rebase['EcoRII'].supplier_names # ["Fermentas International Inc.", "Nippon Gene Co., Ltd.",
! # "Roche Applied Science", "Toyobo Biochemicals",
! # "Sigma Chemical Corporation"]
!
! # Number of enzymes in the database
! pp rebase.size # 673
! pp rebase.enzymes.size # 673
!
! rebase.each do |name, info|
! pp "#{name}: #{info.methylation}" unless info.methylation.empty?
! end
!
!
! == Author
! Trevor Wennblom <trevor at corevx.com>
! == Copyright
! Copyright (C) 2005 Trevor Wennblom
! Licensed under the same terms as BioRuby.
- =end
class REBASE
- autoload(:YAML, 'yaml')
class DynamicMethod_Hash < Hash
--- 113,125 ----
#++
#
! autoload :YAML, 'yaml'
+ module Bio
! autoload :Reference, 'reference'
class REBASE
class DynamicMethod_Hash < Hash
***************
*** 415,417 ****
--- 410,413 ----
end # REBASE
+
end # Bio
More information about the bioruby-cvs
mailing list