[BioRuby-cvs] bioruby/lib/bio/sequence compat.rb,1.1,1.2
Katayama Toshiaki
k at pub.open-bio.org
Mon Feb 6 14:18:06 UTC 2006
Update of /home/repository/bioruby/bioruby/lib/bio/sequence
In directory pub.open-bio.org:/tmp/cvs-serv2032/sequence
Modified Files:
compat.rb
Log Message:
* added RDoc header with Ruby's license
* changed to use autoload
* pikachu method is moved from lib/bio/sequence/na.rb
* changed to warn when to_fasta method is used in debug mode
Index: compat.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/sequence/compat.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** compat.rb 23 Jan 2006 04:13:36 -0000 1.1
--- compat.rb 6 Feb 2006 14:18:03 -0000 1.2
***************
*** 1,3 ****
! # only for backward compatibility, use Bio::Sequence#output(:fasta) instead
module Bio
--- 1,12 ----
! #
! # = bio/sequence/compat.rb - methods for backward compatibility
! #
! # Copyright:: Copyright (C) 2006
! # Toshiaki Katayama <k at bioruby.org>
! # License:: Ruby's
! #
! # $Id$
! #
!
module Bio
***************
*** 5,8 ****
--- 14,21 ----
class Sequence
+ autoload :Common, 'bio/sequence/common'
+ autoload :NA, 'bio/sequence/na'
+ autoload :AA, 'bio/sequence/aa'
+
def to_s
String.new(@seq)
***************
*** 10,14 ****
alias to_str to_s
! module Common
# Output the FASTA format string of the sequence. The 1st argument is
--- 23,28 ----
alias to_str to_s
!
! module Common
# Output the FASTA format string of the sequence. The 1st argument is
***************
*** 16,19 ****
--- 30,34 ----
# sequence will be folded.
def to_fasta(header = '', width = nil)
+ warn "Bio::Sequence#to_fasta is obsolete. Use Bio::Sequence#output(:fasta) instead" if $DEBUG
">#{header}\n" +
if width
***************
*** 26,29 ****
--- 41,45 ----
end # Common
+
class NA
***************
*** 32,37 ****
--- 48,58 ----
end
+ def pikachu
+ self.dna.tr("atgc", "pika") # joke, of course :-)
+ end
+
end # NA
+
class AA
***************
*** 41,44 ****
--- 62,66 ----
end # AA
+
end # Sequence
More information about the bioruby-cvs
mailing list