[BioRuby-cvs] bioruby/test/unit/bio/db test_fasta.rb,1.2,1.3
Katayama Toshiaki
k at pub.open-bio.org
Sun Dec 18 12:55:15 EST 2005
Update of /home/repository/bioruby/bioruby/test/unit/bio/db
In directory pub.open-bio.org:/tmp/cvs-serv30126/test/unit/bio/db
Modified Files:
test_fasta.rb
Log Message:
* fixed to pass all test, replaced the data with suitable one
Index: test_fasta.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/test/unit/bio/db/test_fasta.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_fasta.rb 23 Nov 2005 11:21:15 -0000 1.2
--- test_fasta.rb 18 Dec 2005 17:55:13 -0000 1.3
***************
*** 39,44 ****
! class TestFastaFormat < Test::Unit::TestCase
def setup
text =<<END
--- 39,82 ----
! class TestFastaFormatSwissProt < Test::Unit::TestCase
! def setup
! text =<<END
! >gi|1171674|sp|P42267|NDD_BPR69 NUCLEAR DISRUPTION PROTEIN
! MKYMTVTDLNNAGATVIGTIKGGEWFLGTPHKDILSKPGFYFLVSKLDGRPFSNPCVSARFYVGNQRSKQGFSAVLSHIR
! QRRSQLARTIANNNMVYTVFYLPASKMKPLTTGFGKGQLALAFTRNHHSEYQTLEEMNRMLADNFKFVLQAY
! END
! @obj = Bio::FastaFormat.new(text)
! end
!
! def test_locus
! assert_equal(nil, @obj.locus)
! end
! end
!
! class TestFastaFormatKeggGenesNT < Test::Unit::TestCase
! def setup
! text =<<END
! >eco:b0001 thrL; thr operon leader peptide (N)
! atgaaacgcattagcaccaccattaccaccaccatcaccattaccacaggtaacggtgcg
! ggctga
! END
! @obj = Bio::FastaFormat.new(text)
! end
!
! def test_naseq_class
! assert_equal(Bio::Sequence::NA, @obj.naseq.class)
! end
!
! def test_naseq
! seq = 'atgaaacgcattagcaccaccattaccaccaccatcaccattaccacaggtaacggtgcgggctga'
! assert_equal(seq, @obj.naseq)
! end
+ def test_nalen
+ assert_equal(66, @obj.nalen)
+ end
+ end
+
+ class TestFastaFormatKeggGenesAA < Test::Unit::TestCase
def setup
text =<<END
***************
*** 66,69 ****
--- 104,115 ----
end
+ def test_entry_id
+ assert_equal('sce:YBR160W', @obj.entry_id)
+ end
+
+ def test_acc_version
+ assert_equal(nil, @obj.acc_version)
+ end
+
def test_entry
data = ">sce:YBR160W CDC28, SRM5; cyclin-dependent protein kinase catalytic subunit [EC:2.7.1.-] [SP:CC28_YEAST]\nMSGELANYKRLEKVGEGTYGVVYKALDLRPGQGQRVVALKKIRLESEDEG\nVPSTAIREISLLKELKDDNIVRLYDIVHSDAHKLYLVFEFLDLDLKRYME\nGIPKDQPLGADIVKKFMMQLCKGIAYCHSHRILHRDLKPQNLLINKDGNL\nKLGDFGLARAFGVPLRAYTHEIVTLWYRAPEVLLGGKQYSTGVDTWSIGC\nIFAEMCNRKPIFSGDSEIDQIFKIFRVLGTPNEAIWPDIVYLPDFKPSFP\nQWRRKDLSQVVPSLDPRGIDLLDKLLAYDPINRISARRAAIHPYFQES\n"
***************
*** 71,78 ****
end
- def test_entry_id
- assert_equal('sce:YBR160W', @obj.entry_id)
- end
-
def test_definition
data = "sce:YBR160W CDC28, SRM5; cyclin-dependent protein kinase catalytic subunit [EC:2.7.1.-] [SP:CC28_YEAST]"
--- 117,120 ----
***************
*** 84,137 ****
assert_equal(data, @obj.data)
end
! def test_seq
! seq = 'MSGELANYKRLEKVGEGTYGVVYKALDLRPGQGQRVVALKKIRLESEDEGVPSTAIREISLLKELKDDNIVRLYDIVHSDAHKLYLVFEFLDLDLKRYMEGIPKDQPLGADIVKKFMMQLCKGIAYCHSHRILHRDLKPQNLLINKDGNLKLGDFGLARAFGVPLRAYTHEIVTLWYRAPEVLLGGKQYSTGVDTWSIGCIFAEMCNRKPIFSGDSEIDQIFKIFRVLGTPNEAIWPDIVYLPDFKPSFPQWRRKDLSQVVPSLDPRGIDLLDKLLAYDPINRISARRAAIHPYFQES'
! assert_equal(seq, @obj.seq)
end
! def test_length
! assert_equal(298, @obj.length)
end
! def test_naseq
! seq = 'msgelanykrlekvgegtygvvykaldlrpgqgqrvvalkkirlesedegvpstaireisllkelkddnivrlydivhsdahklylvfefldldlkrymegipkdqplgadivkkfmmqlckgiaychshrilhrdlkpqnllinkdgnlklgdfglarafgvplraytheivtlwyrapevllggkqystgvdtwsigcifaemcnrkpifsgdseidqifkifrvlgtpneaiwpdivylpdfkpsfpqwrrkdlsqvvpsldprgidlldkllaydpinrisarraaihpyfqes'
! assert_equal(seq, @obj.naseq)
end
! def test_nalen
! assert_equal(298, @obj.nalen)
end
def test_aaseq
! seq = "MSGELANYKRLEKVGEGTYGVVYKALDLRPGQGQRVVALKKIRLESEDEGVPSTAIREISLLKELKDDNIVRLYDIVHSDAHKLYLVFEFLDLDLKRYMEGIPKDQPLGADIVKKFMMQLCKGIAYCHSHRILHRDLKPQNLLINKDGNLKLGDFGLARAFGVPLRAYTHEIVTLWYRAPEVLLGGKQYSTGVDTWSIGCIFAEMCNRKPIFSGDSEIDQIFKIFRVLGTPNEAIWPDIVYLPDFKPSFPQWRRKDLSQVVPSLDPRGIDLLDKLLAYDPINRISARRAAIHPYFQES"
assert_equal(seq, @obj.aaseq)
end
def test_aalen
! assert_equal(298, @obj.aalen)
end
def test_identifiers
! assert_equal('', @obj.identifiers)
end
def test_gi
! assert_equal('', @obj.gi)
end
def test_accession
! assert_equal('', @obj.accession)
end
def test_accessions
! assert_equal('', @obj.accessions)
end
def test_acc_version
! assert_equal('', @obj.acc_version)
! end
!
! def test_locus
! assert_equal('', @obj.locus)
end
--- 126,205 ----
assert_equal(data, @obj.data)
end
+ end
! class TestFastaFormat < Test::Unit::TestCase
!
! def setup
! text =<<END
! >gi|55416189|gb|AAV50056.1| NADH dehydrogenase subunit 1 [Dasyurus hallucatus]
! MFTINLLIYIIPILLAVAFLTLIERKMLGYMQFRKGPNIVGPYGLLQPFADAVKLFTKEPLRPLTSSISIFIIAPILALT
! IALTIWTPLPMPNTLLDLNLGLIFILSLSGLSVYSILWSGWASNSKYALIGALRAVAQTISYEVSLAIILLSIMLINGSF
! TLKTLSITQENLWLIITTWPLAMMWYISTLAETNRAPFDLTEGESELVSGFNVEYAAGPFAMFFLAEYANIIAMNAITTI
! LFLGPSLTPNLSHLNTLSFMLKTLLLTMVFLWVRASYPRFRYDQLMHLLWKNFLPMTLAMCLWFISLPIALSCIPPQL
! >gi|55416190|gb|AAV50057.1| NADH dehydrogenase subunit 2 [Dasyurus hallucatus]
! MSPYVLMILTLSLFIGTCLTIFSNHWFTAWMGLEINTLAIIPLMTAPNNPRSTEAATKYFLTQATASMLMMFAIIYNAWS
! TNQWALPQLSDDWISLLMTVALAIKLGLAPFHFWVPEVTQGIPLLTGMILLTWQKIAPTAILFQIAPYLNMKFLVILAIL
! STLVGGWGGLNQTHLRKILAYSSIAHMGWMIIIVQINPTLSIFTLTIYVMATLTTFLTLNLSNSTKIKSLGNLWNKSATA
! TIIIFLTLLSLGGLPPLTGFMPKWLILQELINNGNIITATMMALSALLNLFFYMRLIYASSLTMFPSINNSKMQWYNNSM
! KTTTLIPTATVISSLLLPLTPLFVTLY
! END
! @obj = Bio::FastaFormat.new(text)
end
! def test_entry
! data = ">gi|55416189|gb|AAV50056.1| NADH dehydrogenase subunit 1 [Dasyurus hallucatus]\nMFTINLLIYIIPILLAVAFLTLIERKMLGYMQFRKGPNIVGPYGLLQPFADAVKLFTKEPLRPLTSSISIFIIAPILALT\nIALTIWTPLPMPNTLLDLNLGLIFILSLSGLSVYSILWSGWASNSKYALIGALRAVAQTISYEVSLAIILLSIMLINGSF\nTLKTLSITQENLWLIITTWPLAMMWYISTLAETNRAPFDLTEGESELVSGFNVEYAAGPFAMFFLAEYANIIAMNAITTI\nLFLGPSLTPNLSHLNTLSFMLKTLLLTMVFLWVRASYPRFRYDQLMHLLWKNFLPMTLAMCLWFISLPIALSCIPPQL\n"
! assert_equal(data, @obj.entry)
end
! def test_entry_id
! assert_equal('gi|55416189', @obj.entry_id)
end
! def test_definition
! data = "gi|55416189|gb|AAV50056.1| NADH dehydrogenase subunit 1 [Dasyurus hallucatus]"
! assert_equal(data, @obj.definition)
! end
!
! def test_data
! data = "\nMFTINLLIYIIPILLAVAFLTLIERKMLGYMQFRKGPNIVGPYGLLQPFADAVKLFTKEPLRPLTSSISIFIIAPILALT\nIALTIWTPLPMPNTLLDLNLGLIFILSLSGLSVYSILWSGWASNSKYALIGALRAVAQTISYEVSLAIILLSIMLINGSF\nTLKTLSITQENLWLIITTWPLAMMWYISTLAETNRAPFDLTEGESELVSGFNVEYAAGPFAMFFLAEYANIIAMNAITTI\nLFLGPSLTPNLSHLNTLSFMLKTLLLTMVFLWVRASYPRFRYDQLMHLLWKNFLPMTLAMCLWFISLPIALSCIPPQL\n"
! assert_equal(data, @obj.data)
! end
!
! def test_seq
! seq = 'MFTINLLIYIIPILLAVAFLTLIERKMLGYMQFRKGPNIVGPYGLLQPFADAVKLFTKEPLRPLTSSISIFIIAPILALTIALTIWTPLPMPNTLLDLNLGLIFILSLSGLSVYSILWSGWASNSKYALIGALRAVAQTISYEVSLAIILLSIMLINGSFTLKTLSITQENLWLIITTWPLAMMWYISTLAETNRAPFDLTEGESELVSGFNVEYAAGPFAMFFLAEYANIIAMNAITTILFLGPSLTPNLSHLNTLSFMLKTLLLTMVFLWVRASYPRFRYDQLMHLLWKNFLPMTLAMCLWFISLPIALSCIPPQL'
! assert_equal(seq, @obj.seq)
! end
!
! def test_length
! assert_equal(318, @obj.length)
end
def test_aaseq
! seq = "MFTINLLIYIIPILLAVAFLTLIERKMLGYMQFRKGPNIVGPYGLLQPFADAVKLFTKEPLRPLTSSISIFIIAPILALTIALTIWTPLPMPNTLLDLNLGLIFILSLSGLSVYSILWSGWASNSKYALIGALRAVAQTISYEVSLAIILLSIMLINGSFTLKTLSITQENLWLIITTWPLAMMWYISTLAETNRAPFDLTEGESELVSGFNVEYAAGPFAMFFLAEYANIIAMNAITTILFLGPSLTPNLSHLNTLSFMLKTLLLTMVFLWVRASYPRFRYDQLMHLLWKNFLPMTLAMCLWFISLPIALSCIPPQL"
assert_equal(seq, @obj.aaseq)
end
def test_aalen
! assert_equal(318, @obj.aalen)
end
def test_identifiers
! assert_equal(Bio::FastaDefline, @obj.identifiers.class)
end
def test_gi
! assert_equal('55416189', @obj.gi)
end
def test_accession
! assert_equal('AAV50056', @obj.accession)
end
def test_accessions
! assert_equal(['AAV50056'], @obj.accessions)
end
def test_acc_version
! assert_equal('AAV50056.1', @obj.acc_version)
end
More information about the bioruby-cvs
mailing list