[BioRuby-cvs] bioruby/test/unit/bio/shell/plugin test_seq.rb, 1.2, 1.3

Katayama Toshiaki k at pub.open-bio.org
Sun Dec 18 10:37:21 EST 2005


Update of /home/repository/bioruby/bioruby/test/unit/bio/shell/plugin
In directory pub.open-bio.org:/tmp/cvs-serv28318/test/unit/bio/shell/plugin

Modified Files:
	test_seq.rb 
Log Message:
* fixed tests (not yet completed)


Index: test_seq.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/test/unit/bio/shell/plugin/test_seq.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_seq.rb	23 Nov 2005 11:40:45 -0000	1.2
--- test_seq.rb	18 Dec 2005 15:37:19 -0000	1.3
***************
*** 35,109 ****
      def test_naseq
        str = 'ACGT'
!       assert_equal(Bio::Sequence::NA, naseq(str).class)
!       assert_equal(Bio::Sequence::NA.new(str), naseq(str))
!       assert_equal('acgt', naseq(str))
      end
  
      def test_aaseq
        str = 'WD'
!       assert_equal(Bio::Sequence::AA, aaseq(str).class)
!       assert_equal(Bio::Sequence::AA.new('WD'), aaseq(str))
!       assert_equal('WD', aaseq(str))
!     end
! 
!     def test_revseq
!       str = 'acgta'
!       assert_equal('tacgt', revseq(str))
!     end
! 
!     def test_translate
!       str = 'ATGATG'
!       assert_equal(Bio::Sequence::AA.new('MM'), translate(str))
      end
  
!     def test_seq_report_na
!       str = 'ACGT'
!       output = ''
!       assert_equal(output, seq_report(str))
!     end
  
  
!     def test_seq_report_aa
!       str = 'WD'
!       output = ''
!       assert_equal(output, seq_report(str))
!     end
  
  
!     def test_na_report
!       naseq = 'ACGT'
!       output =<<END
! input sequence     : acgt
! reverse complement : acgt
! translation 1      : T
! translation 2      : R
! translation 3      : GT
! translation -1     : T
! translation -2     : R
! translation -3     : GT
! gc percent         : 50 %
! composition        : {\"a\"=>1, \"c\"=>1, \"g\"=>1, \"t\"=>1}
! molecular weight   : 1245.88148
! complemnet weight  : 1245.88148
! protein weight     : 119.12
  //
  END
!       assert_equal(output, na_report(naseq))
      end
  
!     def test_aa_report
        aaseq = 'WD'
        output =<<END
! input sequence    : WD
! composition       : {\"W\"=>1, \"D\"=>1}
! protein weight    : 319.315
! amino acid codes  : [\"Trp\", \"Asp\"]
! amino acid names  : [\"tryptophan\", \"aspartic acid\"]
  //
  END
!       assert_equal(output, aa_report(aaseq))
      end
  
!     def test_double_helix
        seq = 'ACGTACGTACGTACGT'
        output = <<END
--- 35,122 ----
      def test_naseq
        str = 'ACGT'
!       assert_equal(Bio::Sequence::NA, seq(str).class)
!       assert_equal(Bio::Sequence::NA.new(str), seq(str))
!       assert_equal('acgt', seq(str))
      end
  
      def test_aaseq
        str = 'WD'
!       assert_equal(Bio::Sequence::AA, seq(str).class)
!       assert_equal(Bio::Sequence::AA.new('WD'), seq(str))
!       assert_equal('WD', seq(str))
      end
  
!     def test_na_seqstat
!       naseq = 'atgcatgcatgc'
!       output =<<END
  
+ * * * Sequence statistics * * *
  
! 5'->3' sequence   : atgcatgcatgc
! 3'->5' sequence   : gcatgcatgcat
! Translation   1   : MHAC
! Translation   2   : CMH
! Translation   3   : ACM
! Translation  -1   : ACMH
! Translation  -2   : HAC
! Translation  -3   : MHA
! Length            : 12 bp
! GC percent        : 50 %
! Composition       : a -  3 ( 25.00 %)
!                     c -  3 ( 25.00 %)
!                     g -  3 ( 25.00 %)
!                     t -  3 ( 25.00 %)
! Codon usage       :
  
+  *---------------------------------------------*
+  |       |              2nd              |     |
+  |  1st  |-------------------------------| 3rd |
+  |       |  U    |  C    |  A    |  G    |     |
+  |-------+-------+-------+-------+-------+-----|
+  | U   U |F  0.0%|S  0.0%|Y  0.0%|C  0.0%|  u  |
+  | U   U |F  0.0%|S  0.0%|Y  0.0%|C 25.0%|  c  |
+  | U   U |L  0.0%|S  0.0%|*  0.0%|*  0.0%|  a  |
+  |  UUU  |L  0.0%|S  0.0%|*  0.0%|W  0.0%|  g  |
+  |-------+-------+-------+-------+-------+-----|
+  |  CCCC |L  0.0%|P  0.0%|H 25.0%|R  0.0%|  u  |
+  | C     |L  0.0%|P  0.0%|H  0.0%|R  0.0%|  c  |
+  | C     |L  0.0%|P  0.0%|Q  0.0%|R  0.0%|  a  |
+  |  CCCC |L  0.0%|P  0.0%|Q  0.0%|R  0.0%|  g  |
+  |-------+-------+-------+-------+-------+-----|
+  |   A   |I  0.0%|T  0.0%|N  0.0%|S  0.0%|  u  |
+  |  A A  |I  0.0%|T  0.0%|N  0.0%|S  0.0%|  c  |
+  | AAAAA |I  0.0%|T  0.0%|K  0.0%|R  0.0%|  a  |
+  | A   A |M 25.0%|T  0.0%|K  0.0%|R  0.0%|  g  |
+  |-------+-------+-------+-------+-------+-----|
+  |  GGGG |V  0.0%|A  0.0%|D  0.0%|G  0.0%|  u  |
+  | G     |V  0.0%|A  0.0%|D  0.0%|G  0.0%|  c  |
+  | G GGG |V  0.0%|A 25.0%|E  0.0%|G  0.0%|  a  |
+  |  GG G |V  0.0%|A  0.0%|E  0.0%|G  0.0%|  g  |
+  *---------------------------------------------*
  
! Molecular weight  : 3701.61444
! Protein weight    : 460.565
  //
  END
!       assert_equal(output, seqstat(naseq))
      end
  
!     def test_aa_seqstat
        aaseq = 'WD'
        output =<<END
! 
! * * * Sequence statistics * * *
! 
! N->C sequence     : WD
! Length            : 2 aa
! Composition       : D Asp - 1 ( 50.00 %) aspartic acid
!                     W Trp - 1 ( 50.00 %) tryptophan
! Protein weight    : 319.315
  //
  END
!       assert_equal(output, seqstat(aaseq))
      end
  
!     def test_doublehelix
        seq = 'ACGTACGTACGTACGT'
        output = <<END
***************
*** 125,129 ****
       at
  END
!       assert_equal(output, doublehelix(seq))
      end
  
--- 138,152 ----
       at
  END
!       $doublehelix = ''
!       alias puts_orig puts
!       def puts(*args)
!         args.each do |obj|
!           $doublehelix << obj.to_s
!         end
!       end
!       doublehelix(seq)
!       undef puts
!       alias puts puts_orig
!       assert_equal(output, $doublehelix)
      end
  



More information about the bioruby-cvs mailing list