[BioRuby-cvs] bioruby/lib/bio sequence.rb,0.48,0.49

Katayama Toshiaki k at pub.open-bio.org
Sun Nov 27 10:46:03 EST 2005


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

Modified Files:
	sequence.rb 
Log Message:
* fixed a bug in translate(2) or translate(-2)


Index: sequence.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/sequence.rb,v
retrieving revision 0.48
retrieving revision 0.49
diff -C2 -d -r0.48 -r0.49
*** sequence.rb	22 Nov 2005 00:32:59 -0000	0.48
--- sequence.rb	27 Nov 2005 15:46:01 -0000	0.49
***************
*** 310,325 ****
        case frame
        when 1, 2, 3
!         frame -= 1
        when 4, 5, 6
!         frame -= 4
          naseq.complement!
        when -1, -2, -3
!         frame = -1 - frame
          naseq.complement!
        else
!         frame = 0
        end
!       nalen = naseq.length - (naseq.length - frame) % 3
!       aaseq = naseq[frame, nalen].gsub(/.{3}/) {|codon| ct[codon] or unknown}
        return Bio::Sequence::AA.new(aaseq)
      end
--- 310,326 ----
        case frame
        when 1, 2, 3
!         from = frame - 1
        when 4, 5, 6
!         from = frame - 4
          naseq.complement!
        when -1, -2, -3
!         from = -1 - frame
          naseq.complement!
        else
!         from = 0
        end
!       nalen = naseq.length - from
!       nalen -= nalen % 3
!       aaseq = naseq[from, nalen].gsub(/.{3}/) {|codon| ct[codon] or unknown}
        return Bio::Sequence::AA.new(aaseq)
      end



More information about the bioruby-cvs mailing list