[BioRuby-cvs] bioruby/lib/bio/sequence na.rb,1.1,1.2

Katayama Toshiaki k at pub.open-bio.org
Mon Feb 6 14:13:54 UTC 2006


Update of /home/repository/bioruby/bioruby/lib/bio/sequence
In directory pub.open-bio.org:/tmp/cvs-serv1924/sequence

Modified Files:
	na.rb 
Log Message:
* added RDoc header with Ruby's license
* changed to use autoload
* use Bio::NucleicAcid explicitly instead of NucleicAcid
* pikachu method is moved to lib/bio/sequence/compat.rb


Index: na.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/sequence/na.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** na.rb	23 Jan 2006 04:13:36 -0000	1.1
--- na.rb	6 Feb 2006 14:13:52 -0000	1.2
***************
*** 1,8 ****
  module Bio
  
  class Sequence
  
- # Nucleic Acid sequence
  
  class NA < String
  
--- 1,23 ----
+ #
+ # = bio/sequence/na.rb - nucleic acid sequence class
+ #
+ # Copyright::   Copyright (C) 2006
+ #               Toshiaki Katayama <k at bioruby.org>
+ # License::     Ruby's
+ #
+ # $Id$
+ #
+ 
+ require 'bio/sequence/common'
+ 
  module Bio
  
+   autoload :NucleicAcid, 'bio/data/na'
+   autoload :CodonTable,  'bio/data/codontable'
+ 
  class Sequence
  
  
+ # Nucleic Acid sequence
  class NA < String
  
***************
*** 118,127 ****
  
    # Estimate the weight of this biological string molecule.
-   # NucleicAcid is defined in bio/data/na.rb
    def molecular_weight
      if self.rna?
!       NucleicAcid.weight(self, true)
      else
!       NucleicAcid.weight(self)
      end
    end
--- 133,141 ----
  
    # Estimate the weight of this biological string molecule.
    def molecular_weight
      if self.rna?
!       Bio::NucleicAcid.weight(self, true)
      else
!       Bio::NucleicAcid.weight(self)
      end
    end
***************
*** 130,136 ****
    def to_re
      if self.rna?
!       NucleicAcid.to_re(self.dna, true)
      else
!       NucleicAcid.to_re(self)
      end
    end
--- 144,150 ----
    def to_re
      if self.rna?
!       Bio::NucleicAcid.to_re(self.dna, true)
      else
!       Bio::NucleicAcid.to_re(self)
      end
    end
***************
*** 140,144 ****
      array = []
      self.each_byte do |x|
!       array.push(NucleicAcid.names[x.chr.upcase])
      end
      return array
--- 154,158 ----
      array = []
      self.each_byte do |x|
!       array.push(Bio::NucleicAcid.names[x.chr.upcase])
      end
      return array
***************
*** 168,175 ****
    protected :rna?
  
-   def pikachu
-     self.dna.tr("atgc", "pika") # joke, of course :-)
-   end
- 
  end # NA
  
--- 182,185 ----
***************
*** 177,178 ****
--- 187,189 ----
  
  end # Bio
+ 




More information about the bioruby-cvs mailing list