[BioRuby-cvs] bioruby/lib/bio sequence.rb,0.53,0.54

Katayama Toshiaki k at pub.open-bio.org
Tue Feb 14 13:12:08 UTC 2006


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

Modified Files:
	sequence.rb 
Log Message:
* previous change made on initialize is moved to guess method itself
  to avoid dup in initialize to make things simple.
* guess method is extended to accept 'length' and 'index' arguments
  to specify what portion of the string should be used to guess
  the amino or nucleic acid-ness of the sequence.


Index: sequence.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/sequence.rb,v
retrieving revision 0.53
retrieving revision 0.54
diff -C2 -d -r0.53 -r0.54
*** sequence.rb	8 Feb 2006 17:22:22 -0000	0.53
--- sequence.rb	14 Feb 2006 13:12:06 -0000	0.54
***************
*** 24,29 ****
  
    def initialize(str)
!     @seq = str.dup
!     @seq.extend Bio::Sequence::Common
    end
  
--- 24,28 ----
  
    def initialize(str)
!     @seq = str
    end
  
***************
*** 59,64 ****
    end
  
!   def guess(threshold = 0.9)
!     cmp = @seq.composition
  
      bases = cmp['A'] + cmp['T'] + cmp['G'] + cmp['C'] + 
--- 58,64 ----
    end
  
!   def guess(threshold = 0.9, length = 10000, index = 0)
!     str = @seq.to_s[index,length].to_s.extend Bio::Sequence::Common
!     cmp = str.composition
  
      bases = cmp['A'] + cmp['T'] + cmp['G'] + cmp['C'] + 




More information about the bioruby-cvs mailing list