[BioRuby-cvs] bioruby/test/unit/bio/appl/iprscan test_report.rb, 1.1, 1.2

Mitsuteru C. Nakao nakao at dev.open-bio.org
Thu Feb 22 07:53:51 UTC 2007


Update of /home/repository/bioruby/bioruby/test/unit/bio/appl/iprscan
In directory dev.open-bio.org:/tmp/cvs-serv13869/test/unit/bio/appl/iprscan

Modified Files:
	test_report.rb 
Log Message:
* Added the txt format test file.
* Added Bio::Iprscan::Report.parse_in_txt method. 


Index: test_report.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/test/unit/bio/appl/iprscan/test_report.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test_report.rb	14 Dec 2006 16:22:12 -0000	1.1
--- test_report.rb	22 Feb 2007 07:53:49 -0000	1.2
***************
*** 22,29 ****
        File.open(File.join(TestDataIprscan, "merged.raw"))
      end
    end
    
    
!   class TestIprscanTxtReport < Test::Unit::TestCase
  
      def setup
--- 22,34 ----
        File.open(File.join(TestDataIprscan, "merged.raw"))
      end
+ 
+     def self.txt_format
+       File.open(File.join(TestDataIprscan, "merged.txt"))
+     end
+ 
    end
    
    
!   class TestIprscanPTxtReport < Test::Unit::TestCase
  
      def setup
***************
*** 39,43 ****
  //
  END
!       @obj = Bio::Iprscan::Report.parse_in_txt(test_entry)
      end 
     
--- 44,48 ----
  //
  END
!       @obj = Bio::Iprscan::Report.parse_in_ptxt(test_entry)
      end 
     
***************
*** 87,92 ****
--- 92,168 ----
      end
  
+   end # TestIprscanPTxtReport
+ 
+ 
+ 
+ 
+   class TestIprscanTxtReport < Test::Unit::TestCase
+     def setup
+       test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0]
+       @obj = Bio::Iprscan::Report.parse_in_txt(test_txt)
+     end 
+ 
+     def test_iprscan_report_class
+       assert_equal(Bio::Iprscan::Report, @obj.class)
+     end
+  
+     def test_query_id
+       assert_equal('Q9RHD9', @obj.query_id)
+     end
+ 
+     def test_query_length
+       assert_equal(267, @obj.query_length)
+     end
+ 
+     def test_matches_size
+       assert_equal(16, @obj.matches.size)
+     end
+     
+     def test_match_ipr_id
+       assert_equal('IPR000110', @obj.matches.first.ipr_id)
+     end
+ 
+     def test_match_ipr_description
+       assert_equal('Ribosomal protein S1', @obj.matches.first.ipr_description)
+     end
+ 
+     def test_match_method
+       assert_equal('FPrintScan', @obj.matches.first.method)
+     end
+ 
+     def test_match_accession
+       assert_equal('PR00681', @obj.matches.first.accession)
+     end
+ 
+     def test_match_description
+       assert_equal('RIBOSOMALS1', @obj.matches.first.description)
+     end
+ 
+     def test_match_evalue
+       assert_equal('1.5e-17', @obj.matches.first.evalue)
+     end
+ 
+     def test_match_match_start
+       assert_equal(6, @obj.matches.first.match_start)
+     end
+ 
+     def test_match_match_end
+       assert_equal(27, @obj.matches.first.match_end)
+     end
+ 
+     def test_match_go_terms
+       ary = [["Molecular Function", "RNA binding", "GO:0003723"], 
+              ["Molecular Function", "structural constituent of ribosome", "GO:0003735"], 
+              ["Cellular Component", "ribosome", "GO:0005840"], 
+              ["Biological Process", "protein biosynthesis", "GO:0006412"]]
+       assert_equal(ary, @obj.matches.first.go_terms)
+     end
+ 
+ 
    end # TestIprscanTxtReport
  
+ 
+ 
+ 
    class TestIprscanRawReport < Test::Unit::TestCase
      def setup




More information about the bioruby-cvs mailing list