Back to index

python-biopython  1.60
Public Member Functions
test_Motif.TestMEME Class Reference

List of all members.

Public Member Functions

def test_meme_parser_1
def test_meme_parser_2
def test_meme_parser_3
def test_meme_parser_4

Detailed Description

Definition at line 429 of file test_Motif.py.


Member Function Documentation

Test if Motif can parse MEME output files (first test)

Definition at line 431 of file test_Motif.py.

00431 
00432     def test_meme_parser_1(self):
00433         """Test if Motif can parse MEME output files (first test)
00434         """
00435         from Bio.Alphabet import IUPAC
00436         from Bio.Motif.Parsers import MEME
00437         handle = open("Motif/meme.out")
00438         record = MEME.read(handle)
00439         self.assertEqual(record.version, '3.5.7')
00440         self.assertEqual(record.datafile, 'test.fa')
00441         self.assertEqual(record.alphabet, IUPAC.unambiguous_dna)
00442         self.assertEqual(len(record.sequence_names), 10)
00443         self.assertEqual(record.sequence_names[0], 'SEQ1;')
00444         self.assertEqual(record.sequence_names[1], 'SEQ2;')
00445         self.assertEqual(record.sequence_names[2], 'SEQ3;')
00446         self.assertEqual(record.sequence_names[3], 'SEQ4;')
00447         self.assertEqual(record.sequence_names[4], 'SEQ5;')
00448         self.assertEqual(record.sequence_names[5], 'SEQ6;')
00449         self.assertEqual(record.sequence_names[6], 'SEQ7;')
00450         self.assertEqual(record.sequence_names[7], 'SEQ8;')
00451         self.assertEqual(record.sequence_names[8], 'SEQ9;')
00452         self.assertEqual(record.sequence_names[9], 'SEQ10;')
00453         self.assertEqual(record.command, 'meme test.fa -dna -w 10 -dir /home/bartek/MetaMotif/meme')
00454         self.assertEqual(len(record.motifs), 1)
00455         motif = record.motifs[0]
00456         self.assertEqual(motif.num_occurrences, 10)
00457         self.assertAlmostEqual(motif.evalue, 1.1e-22)
00458         self.assertEqual(motif.alphabet, IUPAC.unambiguous_dna)
00459         self.assertEqual(motif.name, "Motif 1")
00460         self.assertEqual(len(motif.instances), 10)
00461         self.assertAlmostEqual(motif.instances[0].pvalue, 8.71e-07)
00462         self.assertAlmostEqual(motif.instances[1].pvalue, 8.71e-07)
00463         self.assertAlmostEqual(motif.instances[2].pvalue, 8.71e-07)
00464         self.assertAlmostEqual(motif.instances[3].pvalue, 8.71e-07)
00465         self.assertAlmostEqual(motif.instances[4].pvalue, 8.71e-07)
00466         self.assertAlmostEqual(motif.instances[5].pvalue, 8.71e-07)
00467         self.assertAlmostEqual(motif.instances[6].pvalue, 8.71e-07)
00468         self.assertAlmostEqual(motif.instances[7].pvalue, 8.71e-07)
00469         self.assertAlmostEqual(motif.instances[8].pvalue, 8.71e-07)
00470         self.assertAlmostEqual(motif.instances[9].pvalue, 8.71e-07)
00471         self.assertEqual(motif.instances[0].sequence_name, 'SEQ10;')
00472         self.assertEqual(motif.instances[1].sequence_name, 'SEQ9;')
00473         self.assertEqual(motif.instances[2].sequence_name, 'SEQ8;')
00474         self.assertEqual(motif.instances[3].sequence_name, 'SEQ7;')
00475         self.assertEqual(motif.instances[4].sequence_name, 'SEQ6;')
00476         self.assertEqual(motif.instances[5].sequence_name, 'SEQ5;')
00477         self.assertEqual(motif.instances[6].sequence_name, 'SEQ4;')
00478         self.assertEqual(motif.instances[7].sequence_name, 'SEQ3;')
00479         self.assertEqual(motif.instances[8].sequence_name, 'SEQ2;')
00480         self.assertEqual(motif.instances[9].sequence_name, 'SEQ1;')
00481         self.assertEqual(motif.instances[0].start, 3)
00482         self.assertEqual(motif.instances[1].start, 93)
00483         self.assertEqual(motif.instances[2].start, 172)
00484         self.assertEqual(motif.instances[3].start, 177)
00485         self.assertEqual(motif.instances[4].start, 105)
00486         self.assertEqual(motif.instances[5].start, 185)
00487         self.assertEqual(motif.instances[6].start, 173)
00488         self.assertEqual(motif.instances[7].start, 112)
00489         self.assertEqual(motif.instances[8].start, 172)
00490         self.assertEqual(motif.instances[9].start, 52)
00491         self.assertEqual(motif.instances[0].strand, '+')
00492         self.assertEqual(motif.instances[1].strand, '+')
00493         self.assertEqual(motif.instances[2].strand, '+')
00494         self.assertEqual(motif.instances[3].strand, '+')
00495         self.assertEqual(motif.instances[4].strand, '+')
00496         self.assertEqual(motif.instances[5].strand, '+')
00497         self.assertEqual(motif.instances[6].strand, '+')
00498         self.assertEqual(motif.instances[7].strand, '+')
00499         self.assertEqual(motif.instances[8].strand, '+')
00500         self.assertEqual(motif.instances[9].strand, '+')
00501         self.assertEqual(motif.instances[0].length, 10)
00502         self.assertEqual(motif.instances[1].length, 10)
00503         self.assertEqual(motif.instances[2].length, 10)
00504         self.assertEqual(motif.instances[3].length, 10)
00505         self.assertEqual(motif.instances[4].length, 10)
00506         self.assertEqual(motif.instances[5].length, 10)
00507         self.assertEqual(motif.instances[6].length, 10)
00508         self.assertEqual(motif.instances[7].length, 10)
00509         self.assertEqual(motif.instances[8].length, 10)
00510         self.assertEqual(motif.instances[9].length, 10)
00511         self.assertEqual(motif.instances[0].motif_name, 'Motif 1')
00512         self.assertEqual(motif.instances[1].motif_name, 'Motif 1')
00513         self.assertEqual(motif.instances[2].motif_name, 'Motif 1')
00514         self.assertEqual(motif.instances[3].motif_name, 'Motif 1')
00515         self.assertEqual(motif.instances[4].motif_name, 'Motif 1')
00516         self.assertEqual(motif.instances[5].motif_name, 'Motif 1')
00517         self.assertEqual(motif.instances[6].motif_name, 'Motif 1')
00518         self.assertEqual(motif.instances[7].motif_name, 'Motif 1')
00519         self.assertEqual(motif.instances[8].motif_name, 'Motif 1')
00520         self.assertEqual(motif.instances[9].motif_name, 'Motif 1')
00521         self.assertEqual(motif.instances[0].alphabet, IUPAC.unambiguous_dna)
00522         self.assertEqual(motif.instances[1].alphabet, IUPAC.unambiguous_dna)
00523         self.assertEqual(motif.instances[2].alphabet, IUPAC.unambiguous_dna)
00524         self.assertEqual(motif.instances[3].alphabet, IUPAC.unambiguous_dna)
00525         self.assertEqual(motif.instances[4].alphabet, IUPAC.unambiguous_dna)
00526         self.assertEqual(motif.instances[5].alphabet, IUPAC.unambiguous_dna)
00527         self.assertEqual(motif.instances[6].alphabet, IUPAC.unambiguous_dna)
00528         self.assertEqual(motif.instances[7].alphabet, IUPAC.unambiguous_dna)
00529         self.assertEqual(motif.instances[8].alphabet, IUPAC.unambiguous_dna)
00530         self.assertEqual(motif.instances[9].alphabet, IUPAC.unambiguous_dna)
00531         self.assertEqual(motif.instances[0].tostring(), "CTCAATCGTA")
00532         self.assertEqual(motif.instances[1].tostring(), "CTCAATCGTA")
00533         self.assertEqual(motif.instances[2].tostring(), "CTCAATCGTA")
00534         self.assertEqual(motif.instances[3].tostring(), "CTCAATCGTA")
00535         self.assertEqual(motif.instances[4].tostring(), "CTCAATCGTA")
00536         self.assertEqual(motif.instances[5].tostring(), "CTCAATCGTA")
00537         self.assertEqual(motif.instances[6].tostring(), "CTCAATCGTA")
00538         self.assertEqual(motif.instances[7].tostring(), "CTCAATCGTA")
00539         self.assertEqual(motif.instances[8].tostring(), "CTCAATCGTA")
00540         self.assertEqual(motif.instances[9].tostring(), "CTCAATCGTA")
00541         handle.close()

Here is the call graph for this function:

Test if Motif can parse MEME output files (second test)

Definition at line 542 of file test_Motif.py.

00542 
00543     def test_meme_parser_2(self):
00544         """Test if Motif can parse MEME output files (second test)
00545         """
00546         from Bio.Alphabet import IUPAC
00547         from Bio.Motif.Parsers import MEME
00548         handle = open("Motif/meme.dna.oops.txt")
00549         record = MEME.read(handle)
00550         self.assertEqual(record.version, '3.0')
00551         self.assertEqual(record.datafile, 'INO_up800.s')
00552         self.assertEqual(record.alphabet, IUPAC.unambiguous_dna)
00553         self.assertEqual(len(record.sequence_names), 7)
00554         self.assertEqual(record.sequence_names[0], 'CHO1')
00555         self.assertEqual(record.sequence_names[1], 'CHO2')
00556         self.assertEqual(record.sequence_names[2], 'FAS1')
00557         self.assertEqual(record.sequence_names[3], 'FAS2')
00558         self.assertEqual(record.sequence_names[4], 'ACC1')
00559         self.assertEqual(record.sequence_names[5], 'INO1')
00560         self.assertEqual(record.sequence_names[6], 'OPI3')
00561         self.assertEqual(record.command, 'meme -mod oops -dna -revcomp -nmotifs 2 -bfile yeast.nc.6.freq INO_up800.s')
00562         self.assertEqual(len(record.motifs), 2)
00563         motif = record.motifs[0]
00564         self.assertEqual(motif.num_occurrences, 7)
00565         self.assertAlmostEqual(motif.evalue, 0.2)
00566         self.assertEqual(motif.alphabet, IUPAC.unambiguous_dna)
00567         self.assertEqual(motif.name, "Motif 1")
00568         self.assertEqual(len(motif.instances), 7)
00569         self.assertAlmostEqual(motif.instances[0].pvalue, 1.85e-08)
00570         self.assertAlmostEqual(motif.instances[1].pvalue, 1.85e-08)
00571         self.assertAlmostEqual(motif.instances[2].pvalue, 1.52e-07)
00572         self.assertAlmostEqual(motif.instances[3].pvalue, 2.52e-07)
00573         self.assertAlmostEqual(motif.instances[4].pvalue, 4.23e-07)
00574         self.assertAlmostEqual(motif.instances[5].pvalue, 9.43e-07)
00575         self.assertAlmostEqual(motif.instances[6].pvalue, 3.32e-06)
00576         self.assertEqual(motif.instances[0].sequence_name, 'INO1')
00577         self.assertEqual(motif.instances[1].sequence_name, 'FAS1')
00578         self.assertEqual(motif.instances[2].sequence_name, 'ACC1')
00579         self.assertEqual(motif.instances[3].sequence_name, 'CHO2')
00580         self.assertEqual(motif.instances[4].sequence_name, 'CHO1')
00581         self.assertEqual(motif.instances[5].sequence_name, 'FAS2')
00582         self.assertEqual(motif.instances[6].sequence_name, 'OPI3')
00583         self.assertEqual(motif.instances[0].strand, '-')
00584         self.assertEqual(motif.instances[1].strand, '+')
00585         self.assertEqual(motif.instances[2].strand, '+')
00586         self.assertEqual(motif.instances[3].strand, '+')
00587         self.assertEqual(motif.instances[4].strand, '+')
00588         self.assertEqual(motif.instances[5].strand, '+')
00589         self.assertEqual(motif.instances[6].strand, '+')
00590         self.assertEqual(motif.instances[0].length, 12)
00591         self.assertEqual(motif.instances[1].length, 12)
00592         self.assertEqual(motif.instances[2].length, 12)
00593         self.assertEqual(motif.instances[3].length, 12)
00594         self.assertEqual(motif.instances[4].length, 12)
00595         self.assertEqual(motif.instances[5].length, 12)
00596         self.assertEqual(motif.instances[6].length, 12)
00597         self.assertEqual(motif.instances[0].start, 620)
00598         self.assertEqual(motif.instances[1].start,  95)
00599         self.assertEqual(motif.instances[2].start,  83)
00600         self.assertEqual(motif.instances[3].start, 354)
00601         self.assertEqual(motif.instances[4].start, 611)
00602         self.assertEqual(motif.instances[5].start, 567)
00603         self.assertEqual(motif.instances[6].start, 340)
00604         self.assertEqual(motif.instances[0].tostring(), "TTCACATGCCGC")
00605         self.assertEqual(motif.instances[1].tostring(), "TTCACATGCCGC")
00606         self.assertEqual(motif.instances[2].tostring(), "TTCACATGGCCC")
00607         self.assertEqual(motif.instances[3].tostring(), "TTCTCATGCCGC")
00608         self.assertEqual(motif.instances[4].tostring(), "TTCACACGGCAC")
00609         self.assertEqual(motif.instances[5].tostring(), "TTCACATGCTAC")
00610         self.assertEqual(motif.instances[6].tostring(), "TTCAGATCGCTC")
00611         motif = record.motifs[1]
00612         self.assertEqual(motif.num_occurrences, 7)
00613         self.assertAlmostEqual(motif.evalue, 110)
00614         self.assertEqual(motif.alphabet, IUPAC.unambiguous_dna)
00615         self.assertEqual(motif.name, "Motif 2")
00616         self.assertEqual(len(motif.instances), 7)
00617         self.assertAlmostEqual(motif.instances[0].pvalue, 3.24e-07)
00618         self.assertAlmostEqual(motif.instances[1].pvalue, 3.24e-07)
00619         self.assertAlmostEqual(motif.instances[2].pvalue, 3.24e-07)
00620         self.assertAlmostEqual(motif.instances[3].pvalue, 5.29e-06)
00621         self.assertAlmostEqual(motif.instances[4].pvalue, 6.25e-06)
00622         self.assertAlmostEqual(motif.instances[5].pvalue, 8.48e-06)
00623         self.assertAlmostEqual(motif.instances[6].pvalue, 8.48e-06)
00624         self.assertEqual(motif.instances[0].sequence_name, 'OPI3')
00625         self.assertEqual(motif.instances[1].sequence_name, 'ACC1')
00626         self.assertEqual(motif.instances[2].sequence_name, 'CHO1')
00627         self.assertEqual(motif.instances[3].sequence_name, 'INO1')
00628         self.assertEqual(motif.instances[4].sequence_name, 'FAS1')
00629         self.assertEqual(motif.instances[5].sequence_name, 'FAS2')
00630         self.assertEqual(motif.instances[6].sequence_name, 'CHO2')
00631         self.assertEqual(motif.instances[0].strand, '-')
00632         self.assertEqual(motif.instances[1].strand, '+')
00633         self.assertEqual(motif.instances[2].strand, '-')
00634         self.assertEqual(motif.instances[3].strand, '-')
00635         self.assertEqual(motif.instances[4].strand, '+')
00636         self.assertEqual(motif.instances[5].strand, '-')
00637         self.assertEqual(motif.instances[6].strand, '-')
00638         self.assertEqual(motif.instances[0].length, 10)
00639         self.assertEqual(motif.instances[1].length, 10)
00640         self.assertEqual(motif.instances[2].length, 10)
00641         self.assertEqual(motif.instances[3].length, 10)
00642         self.assertEqual(motif.instances[4].length, 10)
00643         self.assertEqual(motif.instances[5].length, 10)
00644         self.assertEqual(motif.instances[6].length, 10)
00645         self.assertEqual(motif.instances[0].start, 186)
00646         self.assertEqual(motif.instances[1].start, 232)
00647         self.assertEqual(motif.instances[2].start, 559)
00648         self.assertEqual(motif.instances[3].start, 283)
00649         self.assertEqual(motif.instances[4].start,  44)
00650         self.assertEqual(motif.instances[5].start, 185)
00651         self.assertEqual(motif.instances[6].start, 413)
00652         self.assertEqual(motif.instances[0].tostring(), "TCTGGCACAG")
00653         self.assertEqual(motif.instances[1].tostring(), "TCTGGCACAG")
00654         self.assertEqual(motif.instances[2].tostring(), "TCTGGCACAG")
00655         self.assertEqual(motif.instances[3].tostring(), "GCGGGCGCAG")
00656         self.assertEqual(motif.instances[4].tostring(), "GCAGGCACGG")
00657         self.assertEqual(motif.instances[5].tostring(), "TCTGGCACTC")
00658         self.assertEqual(motif.instances[6].tostring(), "TCTGGCATCG")
00659         handle.close()

Here is the call graph for this function:

Test if Motif can parse MEME output files (third test)

Definition at line 660 of file test_Motif.py.

00660 
00661     def test_meme_parser_3(self):
00662         """Test if Motif can parse MEME output files (third test)
00663         """
00664         from Bio.Alphabet import IUPAC
00665         from Bio.Motif.Parsers import MEME
00666         handle = open("Motif/meme.protein.oops.txt")
00667         record = MEME.read(handle)
00668         self.assertEqual(record.version, '3.0')
00669         self.assertEqual(record.datafile, 'adh.s')
00670         self.assertEqual(record.alphabet, IUPAC.protein)
00671         self.assertEqual(len(record.sequence_names), 33)
00672         self.assertEqual(record.sequence_names[0], "2BHD_STREX")
00673         self.assertEqual(record.sequence_names[1], "3BHD_COMTE")
00674         self.assertEqual(record.sequence_names[2], "ADH_DROME")
00675         self.assertEqual(record.sequence_names[3], "AP27_MOUSE")
00676         self.assertEqual(record.sequence_names[4], "BA72_EUBSP")
00677         self.assertEqual(record.sequence_names[5], "BDH_HUMAN")
00678         self.assertEqual(record.sequence_names[6], "BPHB_PSEPS")
00679         self.assertEqual(record.sequence_names[7], "BUDC_KLETE")
00680         self.assertEqual(record.sequence_names[8], "DHES_HUMAN")
00681         self.assertEqual(record.sequence_names[9], "DHGB_BACME")
00682         self.assertEqual(record.sequence_names[10], "DHII_HUMAN")
00683         self.assertEqual(record.sequence_names[11], "DHMA_FLAS1")
00684         self.assertEqual(record.sequence_names[12], "ENTA_ECOLI")
00685         self.assertEqual(record.sequence_names[13], "FIXR_BRAJA")
00686         self.assertEqual(record.sequence_names[14], "GUTD_ECOLI")
00687         self.assertEqual(record.sequence_names[15], "HDE_CANTR")
00688         self.assertEqual(record.sequence_names[16], "HDHA_ECOLI")
00689         self.assertEqual(record.sequence_names[17], "LIGD_PSEPA")
00690         self.assertEqual(record.sequence_names[18], "NODG_RHIME")
00691         self.assertEqual(record.sequence_names[19], "RIDH_KLEAE")
00692         self.assertEqual(record.sequence_names[20], "YINL_LISMO")
00693         self.assertEqual(record.sequence_names[21], "YRTP_BACSU")
00694         self.assertEqual(record.sequence_names[22], "CSGA_MYXXA")
00695         self.assertEqual(record.sequence_names[23], "DHB2_HUMAN")
00696         self.assertEqual(record.sequence_names[24], "DHB3_HUMAN")
00697         self.assertEqual(record.sequence_names[25], "DHCA_HUMAN")
00698         self.assertEqual(record.sequence_names[26], "FABI_ECOLI")
00699         self.assertEqual(record.sequence_names[27], "FVT1_HUMAN")
00700         self.assertEqual(record.sequence_names[28], "HMTR_LEIMA")
00701         self.assertEqual(record.sequence_names[29], "MAS1_AGRRA")
00702         self.assertEqual(record.sequence_names[30], "PCR_PEA")
00703         self.assertEqual(record.sequence_names[31], "RFBB_NEIGO")
00704         self.assertEqual(record.sequence_names[32], "YURA_MYXXA")
00705         self.assertEqual(record.command, 'meme adh.s -mod oops -protein -nmotifs 2')
00706         self.assertEqual(len(record.motifs), 2)
00707         motif = record.motifs[0]
00708         self.assertEqual(motif.num_occurrences, 33)
00709         self.assertAlmostEqual(motif.evalue, 3.6e-165)
00710         self.assertEqual(motif.alphabet, IUPAC.protein)
00711         self.assertEqual(motif.name, "Motif 1")
00712         self.assertEqual(len(motif.instances), 33)
00713         self.assertAlmostEqual(motif.instances[0].pvalue, 1.64e-22)
00714         self.assertAlmostEqual(motif.instances[1].pvalue, 6.32e-22)
00715         self.assertAlmostEqual(motif.instances[2].pvalue, 1.13e-21)
00716         self.assertAlmostEqual(motif.instances[3].pvalue, 4.04e-21)
00717         self.assertAlmostEqual(motif.instances[4].pvalue, 6.12e-21)
00718         self.assertAlmostEqual(motif.instances[5].pvalue, 7.52e-20)
00719         self.assertAlmostEqual(motif.instances[6].pvalue, 3.35e-19)
00720         self.assertAlmostEqual(motif.instances[7].pvalue, 4.82e-19)
00721         self.assertAlmostEqual(motif.instances[8].pvalue, 4.82e-19)
00722         self.assertAlmostEqual(motif.instances[9].pvalue, 1.11e-18)
00723         self.assertAlmostEqual(motif.instances[10].pvalue, 1.25e-18)
00724         self.assertAlmostEqual(motif.instances[11].pvalue, 2.23e-18)
00725         self.assertAlmostEqual(motif.instances[12].pvalue, 5.53e-18)
00726         self.assertAlmostEqual(motif.instances[13].pvalue, 9.65e-18)
00727         self.assertAlmostEqual(motif.instances[14].pvalue, 2.86e-17)
00728         self.assertAlmostEqual(motif.instances[15].pvalue, 8.20e-17)
00729         self.assertAlmostEqual(motif.instances[16].pvalue, 9.09e-17)
00730         self.assertAlmostEqual(motif.instances[17].pvalue, 1.37e-16)
00731         self.assertAlmostEqual(motif.instances[18].pvalue, 2.52e-16)
00732         self.assertAlmostEqual(motif.instances[19].pvalue, 1.21e-15)
00733         self.assertAlmostEqual(motif.instances[20].pvalue, 1.61e-15)
00734         self.assertAlmostEqual(motif.instances[21].pvalue, 1.77e-15)
00735         self.assertAlmostEqual(motif.instances[22].pvalue, 7.81e-15)
00736         self.assertAlmostEqual(motif.instances[23].pvalue, 8.55e-15)
00737         self.assertAlmostEqual(motif.instances[24].pvalue, 1.47e-14)
00738         self.assertAlmostEqual(motif.instances[25].pvalue, 3.24e-14)
00739         self.assertAlmostEqual(motif.instances[26].pvalue, 1.80e-12)
00740         self.assertAlmostEqual(motif.instances[27].pvalue, 2.10e-12)
00741         self.assertAlmostEqual(motif.instances[28].pvalue, 4.15e-12)
00742         self.assertAlmostEqual(motif.instances[29].pvalue, 5.20e-12)
00743         self.assertAlmostEqual(motif.instances[30].pvalue, 4.80e-10)
00744         self.assertAlmostEqual(motif.instances[31].pvalue, 2.77e-08)
00745         self.assertAlmostEqual(motif.instances[32].pvalue, 5.72e-08)
00746         self.assertEqual(motif.instances[0].sequence_name, 'YRTP_BACSU')
00747         self.assertEqual(motif.instances[1].sequence_name, 'AP27_MOUSE')
00748         self.assertEqual(motif.instances[2].sequence_name, 'NODG_RHIME')
00749         self.assertEqual(motif.instances[3].sequence_name, 'BUDC_KLETE')
00750         self.assertEqual(motif.instances[4].sequence_name, 'FIXR_BRAJA')
00751         self.assertEqual(motif.instances[5].sequence_name, 'DHGB_BACME')
00752         self.assertEqual(motif.instances[6].sequence_name, 'HMTR_LEIMA')
00753         self.assertEqual(motif.instances[7].sequence_name, 'YURA_MYXXA')
00754         self.assertEqual(motif.instances[8].sequence_name, 'GUTD_ECOLI')
00755         self.assertEqual(motif.instances[9].sequence_name, '2BHD_STREX')
00756         self.assertEqual(motif.instances[10].sequence_name, 'HDHA_ECOLI')
00757         self.assertEqual(motif.instances[11].sequence_name, 'DHB2_HUMAN')
00758         self.assertEqual(motif.instances[12].sequence_name, 'DHMA_FLAS1')
00759         self.assertEqual(motif.instances[13].sequence_name, 'HDE_CANTR')
00760         self.assertEqual(motif.instances[14].sequence_name, 'FVT1_HUMAN')
00761         self.assertEqual(motif.instances[15].sequence_name, 'BDH_HUMAN')
00762         self.assertEqual(motif.instances[16].sequence_name, 'RIDH_KLEAE')
00763         self.assertEqual(motif.instances[17].sequence_name, 'DHES_HUMAN')
00764         self.assertEqual(motif.instances[18].sequence_name, 'BA72_EUBSP')
00765         self.assertEqual(motif.instances[19].sequence_name, 'LIGD_PSEPA')
00766         self.assertEqual(motif.instances[20].sequence_name, 'DHII_HUMAN')
00767         self.assertEqual(motif.instances[21].sequence_name, 'ENTA_ECOLI')
00768         self.assertEqual(motif.instances[22].sequence_name, '3BHD_COMTE')
00769         self.assertEqual(motif.instances[23].sequence_name, 'DHB3_HUMAN')
00770         self.assertEqual(motif.instances[24].sequence_name, 'RFBB_NEIGO')
00771         self.assertEqual(motif.instances[25].sequence_name, 'YINL_LISMO')
00772         self.assertEqual(motif.instances[26].sequence_name, 'BPHB_PSEPS')
00773         self.assertEqual(motif.instances[27].sequence_name, 'CSGA_MYXXA')
00774         self.assertEqual(motif.instances[28].sequence_name, 'FABI_ECOLI')
00775         self.assertEqual(motif.instances[29].sequence_name, 'ADH_DROME')
00776         self.assertEqual(motif.instances[30].sequence_name, 'DHCA_HUMAN')
00777         self.assertEqual(motif.instances[31].sequence_name, 'PCR_PEA')
00778         self.assertEqual(motif.instances[32].sequence_name, 'MAS1_AGRRA')
00779         self.assertEqual(motif.instances[0].strand, '+')
00780         self.assertEqual(motif.instances[1].strand, '+')
00781         self.assertEqual(motif.instances[2].strand, '+')
00782         self.assertEqual(motif.instances[3].strand, '+')
00783         self.assertEqual(motif.instances[4].strand, '+')
00784         self.assertEqual(motif.instances[5].strand, '+')
00785         self.assertEqual(motif.instances[6].strand, '+')
00786         self.assertEqual(motif.instances[7].strand, '+')
00787         self.assertEqual(motif.instances[8].strand, '+')
00788         self.assertEqual(motif.instances[9].strand, '+')
00789         self.assertEqual(motif.instances[10].strand, '+')
00790         self.assertEqual(motif.instances[11].strand, '+')
00791         self.assertEqual(motif.instances[12].strand, '+')
00792         self.assertEqual(motif.instances[13].strand, '+')
00793         self.assertEqual(motif.instances[14].strand, '+')
00794         self.assertEqual(motif.instances[15].strand, '+')
00795         self.assertEqual(motif.instances[16].strand, '+')
00796         self.assertEqual(motif.instances[17].strand, '+')
00797         self.assertEqual(motif.instances[18].strand, '+')
00798         self.assertEqual(motif.instances[19].strand, '+')
00799         self.assertEqual(motif.instances[20].strand, '+')
00800         self.assertEqual(motif.instances[21].strand, '+')
00801         self.assertEqual(motif.instances[22].strand, '+')
00802         self.assertEqual(motif.instances[23].strand, '+')
00803         self.assertEqual(motif.instances[24].strand, '+')
00804         self.assertEqual(motif.instances[25].strand, '+')
00805         self.assertEqual(motif.instances[26].strand, '+')
00806         self.assertEqual(motif.instances[27].strand, '+')
00807         self.assertEqual(motif.instances[28].strand, '+')
00808         self.assertEqual(motif.instances[29].strand, '+')
00809         self.assertEqual(motif.instances[30].strand, '+')
00810         self.assertEqual(motif.instances[31].strand, '+')
00811         self.assertEqual(motif.instances[32].strand, '+')
00812         self.assertEqual(motif.instances[0].length, 29)
00813         self.assertEqual(motif.instances[1].length, 29)
00814         self.assertEqual(motif.instances[2].length, 29)
00815         self.assertEqual(motif.instances[3].length, 29)
00816         self.assertEqual(motif.instances[4].length, 29)
00817         self.assertEqual(motif.instances[5].length, 29)
00818         self.assertEqual(motif.instances[6].length, 29)
00819         self.assertEqual(motif.instances[7].length, 29)
00820         self.assertEqual(motif.instances[8].length, 29)
00821         self.assertEqual(motif.instances[9].length, 29)
00822         self.assertEqual(motif.instances[10].length, 29)
00823         self.assertEqual(motif.instances[11].length, 29)
00824         self.assertEqual(motif.instances[12].length, 29)
00825         self.assertEqual(motif.instances[13].length, 29)
00826         self.assertEqual(motif.instances[14].length, 29)
00827         self.assertEqual(motif.instances[15].length, 29)
00828         self.assertEqual(motif.instances[16].length, 29)
00829         self.assertEqual(motif.instances[17].length, 29)
00830         self.assertEqual(motif.instances[18].length, 29)
00831         self.assertEqual(motif.instances[19].length, 29)
00832         self.assertEqual(motif.instances[20].length, 29)
00833         self.assertEqual(motif.instances[21].length, 29)
00834         self.assertEqual(motif.instances[22].length, 29)
00835         self.assertEqual(motif.instances[23].length, 29)
00836         self.assertEqual(motif.instances[24].length, 29)
00837         self.assertEqual(motif.instances[25].length, 29)
00838         self.assertEqual(motif.instances[26].length, 29)
00839         self.assertEqual(motif.instances[27].length, 29)
00840         self.assertEqual(motif.instances[28].length, 29)
00841         self.assertEqual(motif.instances[29].length, 29)
00842         self.assertEqual(motif.instances[30].length, 29)
00843         self.assertEqual(motif.instances[31].length, 29)
00844         self.assertEqual(motif.instances[32].length, 29)
00845         self.assertEqual(motif.instances[0].start, 155)
00846         self.assertEqual(motif.instances[1].start, 149)
00847         self.assertEqual(motif.instances[2].start, 152)
00848         self.assertEqual(motif.instances[3].start, 152)
00849         self.assertEqual(motif.instances[4].start, 189)
00850         self.assertEqual(motif.instances[5].start, 160)
00851         self.assertEqual(motif.instances[6].start, 193)
00852         self.assertEqual(motif.instances[7].start, 160)
00853         self.assertEqual(motif.instances[8].start, 154)
00854         self.assertEqual(motif.instances[9].start, 152)
00855         self.assertEqual(motif.instances[10].start, 159)
00856         self.assertEqual(motif.instances[11].start, 232)
00857         self.assertEqual(motif.instances[12].start, 165)
00858         self.assertEqual(motif.instances[13].start, 467)
00859         self.assertEqual(motif.instances[14].start, 186)
00860         self.assertEqual(motif.instances[15].start, 208)
00861         self.assertEqual(motif.instances[16].start, 160)
00862         self.assertEqual(motif.instances[17].start, 155)
00863         self.assertEqual(motif.instances[18].start, 157)
00864         self.assertEqual(motif.instances[19].start, 157)
00865         self.assertEqual(motif.instances[20].start, 183)
00866         self.assertEqual(motif.instances[21].start, 144)
00867         self.assertEqual(motif.instances[22].start, 151)
00868         self.assertEqual(motif.instances[23].start, 198)
00869         self.assertEqual(motif.instances[24].start, 165)
00870         self.assertEqual(motif.instances[25].start, 154)
00871         self.assertEqual(motif.instances[26].start, 153)
00872         self.assertEqual(motif.instances[27].start,  88)
00873         self.assertEqual(motif.instances[28].start, 159)
00874         self.assertEqual(motif.instances[29].start, 152)
00875         self.assertEqual(motif.instances[30].start, 193)
00876         self.assertEqual(motif.instances[31].start,  26)
00877         self.assertEqual(motif.instances[32].start, 349)
00878         self.assertEqual(motif.instances[0].tostring(), "YSASKFAVLGLTESLMQEVRKHNIRVSAL")
00879         self.assertEqual(motif.instances[1].tostring(), "YSSTKGAMTMLTKAMAMELGPHKIRVNSV")
00880         self.assertEqual(motif.instances[2].tostring(), "YCASKAGMIGFSKSLAQEIATRNITVNCV")
00881         self.assertEqual(motif.instances[3].tostring(), "YSSSKFAVRGLTQTAARDLAPLGITVNGF")
00882         self.assertEqual(motif.instances[4].tostring(), "YATSKAALASLTRELAHDYAPHGIRVNAI")
00883         self.assertEqual(motif.instances[5].tostring(), "YAASKGGMKLMTETLALEYAPKGIRVNNI")
00884         self.assertEqual(motif.instances[6].tostring(), "YTMAKGALEGLTRSAALELAPLQIRVNGV")
00885         self.assertEqual(motif.instances[7].tostring(), "YSASKAFLSTFMESLRVDLRGTGVRVTCI")
00886         self.assertEqual(motif.instances[8].tostring(), "YSAAKFGGVGLTQSLALDLAEYGITVHSL")
00887         self.assertEqual(motif.instances[9].tostring(), "YGASKWGVRGLSKLAAVELGTDRIRVNSV")
00888         self.assertEqual(motif.instances[10].tostring(), "YASSKAAASHLVRNMAFDLGEKNIRVNGI")
00889         self.assertEqual(motif.instances[11].tostring(), "YGSSKAAVTMFSSVMRLELSKWGIKVASI")
00890         self.assertEqual(motif.instances[12].tostring(), "YVAAKGGVAMLTRAMAVDLARHGILVNMI")
00891         self.assertEqual(motif.instances[13].tostring(), "YSSSKAGILGLSKTMAIEGAKNNIKVNIV")
00892         self.assertEqual(motif.instances[14].tostring(), "YSASKFAIRGLAEALQMEVKPYNVYITVA")
00893         self.assertEqual(motif.instances[15].tostring(), "YCITKFGVEAFSDCLRYEMYPLGVKVSVV")
00894         self.assertEqual(motif.instances[16].tostring(), "YTASKFAVQAFVHTTRRQVAQYGVRVGAV")
00895         self.assertEqual(motif.instances[17].tostring(), "YCASKFALEGLCESLAVLLLPFGVHLSLI")
00896         self.assertEqual(motif.instances[18].tostring(), "YPASKASVIGLTHGLGREIIRKNIRVVGV")
00897         self.assertEqual(motif.instances[19].tostring(), "YSAAKAASINLMEGYRQGLEKYGIGVSVC")
00898         self.assertEqual(motif.instances[20].tostring(), "YSASKFALDGFFSSIRKEYSVSRVNVSIT")
00899         self.assertEqual(motif.instances[21].tostring(), "YGASKAALKSLALSVGLELAGSGVRCNVV")
00900         self.assertEqual(motif.instances[22].tostring(), "YSASKAAVSALTRAAALSCRKQGYAIRVN")
00901         self.assertEqual(motif.instances[23].tostring(), "YSASKAFVCAFSKALQEEYKAKEVIIQVL")
00902         self.assertEqual(motif.instances[24].tostring(), "YSASKAAADHLVRAWQRTYRLPSIVSNCS")
00903         self.assertEqual(motif.instances[25].tostring(), "YGATKWAVRDLMEVLRMESAQEGTNIRTA")
00904         self.assertEqual(motif.instances[26].tostring(), "YTAAKQAIVGLVRELAFELAPYVRVNGVG")
00905         self.assertEqual(motif.instances[27].tostring(), "YRMSKAALNMAVRSMSTDLRPEGFVTVLL")
00906         self.assertEqual(motif.instances[28].tostring(), "MGLAKASLEANVRYMANAMGPEGVRVNAI")
00907         self.assertEqual(motif.instances[29].tostring(), "YSGTKAAVVNFTSSLAKLAPITGVTAYTV")
00908         self.assertEqual(motif.instances[30].tostring(), "YGVTKIGVTVLSRIHARKLSEQRKGDKIL")
00909         self.assertEqual(motif.instances[31].tostring(), "KDSTLFGVSSLSDSLKGDFTSSALRCKEL")
00910         self.assertEqual(motif.instances[32].tostring(), "YINCVAPLRMTELCLPHLYETGSGRIVNI")
00911         motif = record.motifs[1]
00912         self.assertEqual(motif.num_occurrences, 33)
00913         self.assertAlmostEqual(motif.evalue, 2.3e-159)
00914         self.assertEqual(motif.alphabet, IUPAC.protein)
00915         self.assertEqual(motif.name, "Motif 2")
00916         self.assertEqual(len(motif.instances), 33)
00917         self.assertAlmostEqual(motif.instances[0].pvalue, 2.44e-23)
00918         self.assertAlmostEqual(motif.instances[1].pvalue, 5.50e-23)
00919         self.assertAlmostEqual(motif.instances[2].pvalue, 5.38e-22)
00920         self.assertAlmostEqual(motif.instances[3].pvalue, 5.65e-20)
00921         self.assertAlmostEqual(motif.instances[4].pvalue, 1.17e-19)
00922         self.assertAlmostEqual(motif.instances[5].pvalue, 1.17e-19)
00923         self.assertAlmostEqual(motif.instances[6].pvalue, 4.74e-19)
00924         self.assertAlmostEqual(motif.instances[7].pvalue, 9.31e-19)
00925         self.assertAlmostEqual(motif.instances[8].pvalue, 2.50e-18)
00926         self.assertAlmostEqual(motif.instances[9].pvalue, 3.45e-18)
00927         self.assertAlmostEqual(motif.instances[10].pvalue, 5.86e-18)
00928         self.assertAlmostEqual(motif.instances[11].pvalue, 9.86e-18)
00929         self.assertAlmostEqual(motif.instances[12].pvalue, 2.47e-17)
00930         self.assertAlmostEqual(motif.instances[13].pvalue, 3.01e-17)
00931         self.assertAlmostEqual(motif.instances[14].pvalue, 3.33e-17)
00932         self.assertAlmostEqual(motif.instances[15].pvalue, 4.06e-17)
00933         self.assertAlmostEqual(motif.instances[16].pvalue, 4.06e-17)
00934         self.assertAlmostEqual(motif.instances[17].pvalue, 8.05e-17)
00935         self.assertAlmostEqual(motif.instances[18].pvalue, 1.90e-16)
00936         self.assertAlmostEqual(motif.instances[19].pvalue, 2.77e-16)
00937         self.assertAlmostEqual(motif.instances[20].pvalue, 3.65e-16)
00938         self.assertAlmostEqual(motif.instances[21].pvalue, 8.31e-16)
00939         self.assertAlmostEqual(motif.instances[22].pvalue, 4.05e-15)
00940         self.assertAlmostEqual(motif.instances[23].pvalue, 5.24e-15)
00941         self.assertAlmostEqual(motif.instances[24].pvalue, 3.00e-14)
00942         self.assertAlmostEqual(motif.instances[25].pvalue, 8.47e-14)
00943         self.assertAlmostEqual(motif.instances[26].pvalue, 1.46e-13)
00944         self.assertAlmostEqual(motif.instances[27].pvalue, 1.46e-13)
00945         self.assertAlmostEqual(motif.instances[28].pvalue, 1.59e-12)
00946         self.assertAlmostEqual(motif.instances[29].pvalue, 6.97e-10)
00947         self.assertAlmostEqual(motif.instances[30].pvalue, 3.15e-09)
00948         self.assertAlmostEqual(motif.instances[31].pvalue, 2.77e-07)
00949         self.assertAlmostEqual(motif.instances[32].pvalue, 4.24e-07)
00950         self.assertEqual(motif.instances[0].sequence_name, 'HDE_CANTR')
00951         self.assertEqual(motif.instances[1].sequence_name, 'DHII_HUMAN')
00952         self.assertEqual(motif.instances[2].sequence_name, 'YINL_LISMO')
00953         self.assertEqual(motif.instances[3].sequence_name, 'HDHA_ECOLI')
00954         self.assertEqual(motif.instances[4].sequence_name, 'RIDH_KLEAE')
00955         self.assertEqual(motif.instances[5].sequence_name, 'BUDC_KLETE')
00956         self.assertEqual(motif.instances[6].sequence_name, 'ENTA_ECOLI')
00957         self.assertEqual(motif.instances[7].sequence_name, 'AP27_MOUSE')
00958         self.assertEqual(motif.instances[8].sequence_name, 'DHMA_FLAS1')
00959         self.assertEqual(motif.instances[9].sequence_name, 'YRTP_BACSU')
00960         self.assertEqual(motif.instances[10].sequence_name, 'DHGB_BACME')
00961         self.assertEqual(motif.instances[11].sequence_name, 'DHB3_HUMAN')
00962         self.assertEqual(motif.instances[12].sequence_name, 'PCR_PEA')
00963         self.assertEqual(motif.instances[13].sequence_name, 'BDH_HUMAN')
00964         self.assertEqual(motif.instances[14].sequence_name, 'BA72_EUBSP')
00965         self.assertEqual(motif.instances[15].sequence_name, 'FIXR_BRAJA')
00966         self.assertEqual(motif.instances[16].sequence_name, '3BHD_COMTE')
00967         self.assertEqual(motif.instances[17].sequence_name, '2BHD_STREX')
00968         self.assertEqual(motif.instances[18].sequence_name, 'HMTR_LEIMA')
00969         self.assertEqual(motif.instances[19].sequence_name, 'FVT1_HUMAN')
00970         self.assertEqual(motif.instances[20].sequence_name, 'DHB2_HUMAN')
00971         self.assertEqual(motif.instances[21].sequence_name, 'LIGD_PSEPA')
00972         self.assertEqual(motif.instances[22].sequence_name, 'NODG_RHIME')
00973         self.assertEqual(motif.instances[23].sequence_name, 'DHCA_HUMAN')
00974         self.assertEqual(motif.instances[24].sequence_name, 'MAS1_AGRRA')
00975         self.assertEqual(motif.instances[25].sequence_name, 'BPHB_PSEPS')
00976         self.assertEqual(motif.instances[26].sequence_name, 'GUTD_ECOLI')
00977         self.assertEqual(motif.instances[27].sequence_name, 'DHES_HUMAN')
00978         self.assertEqual(motif.instances[28].sequence_name, 'RFBB_NEIGO')
00979         self.assertEqual(motif.instances[29].sequence_name, 'ADH_DROME')
00980         self.assertEqual(motif.instances[30].sequence_name, 'FABI_ECOLI')
00981         self.assertEqual(motif.instances[31].sequence_name, 'YURA_MYXXA')
00982         self.assertEqual(motif.instances[32].sequence_name, 'CSGA_MYXXA')
00983         self.assertEqual(motif.instances[0].start, 323)
00984         self.assertEqual(motif.instances[1].start, 35)
00985         self.assertEqual(motif.instances[2].start, 6)
00986         self.assertEqual(motif.instances[3].start, 12)
00987         self.assertEqual(motif.instances[4].start, 15)
00988         self.assertEqual(motif.instances[5].start, 3)
00989         self.assertEqual(motif.instances[6].start, 6)
00990         self.assertEqual(motif.instances[7].start, 8)
00991         self.assertEqual(motif.instances[8].start, 15)
00992         self.assertEqual(motif.instances[9].start, 7)
00993         self.assertEqual(motif.instances[10].start, 8)
00994         self.assertEqual(motif.instances[11].start, 49)
00995         self.assertEqual(motif.instances[12].start, 87)
00996         self.assertEqual(motif.instances[13].start, 56)
00997         self.assertEqual(motif.instances[14].start, 7)
00998         self.assertEqual(motif.instances[15].start, 37)
00999         self.assertEqual(motif.instances[16].start, 7)
01000         self.assertEqual(motif.instances[17].start, 7)
01001         self.assertEqual(motif.instances[18].start, 7)
01002         self.assertEqual(motif.instances[19].start, 33)
01003         self.assertEqual(motif.instances[20].start, 83)
01004         self.assertEqual(motif.instances[21].start, 7)
01005         self.assertEqual(motif.instances[22].start, 7)
01006         self.assertEqual(motif.instances[23].start, 5)
01007         self.assertEqual(motif.instances[24].start, 246)
01008         self.assertEqual(motif.instances[25].start, 6)
01009         self.assertEqual(motif.instances[26].start, 3)
01010         self.assertEqual(motif.instances[27].start, 3)
01011         self.assertEqual(motif.instances[28].start, 7)
01012         self.assertEqual(motif.instances[29].start, 7)
01013         self.assertEqual(motif.instances[30].start, 7)
01014         self.assertEqual(motif.instances[31].start, 117)
01015         self.assertEqual(motif.instances[32].start, 52)
01016         self.assertEqual(motif.instances[0].tostring(), 'KVVLITGAGAGLGKEYAKWFAKYGAKVVV')
01017         self.assertEqual(motif.instances[1].tostring(), 'KKVIVTGASKGIGREMAYHLAKMGAHVVV')
01018         self.assertEqual(motif.instances[2].tostring(), 'KVIIITGASSGIGKATALLLAEKGAKLVL')
01019         self.assertEqual(motif.instances[3].tostring(), 'KCAIITGAGAGIGKEIAITFATAGASVVV')
01020         self.assertEqual(motif.instances[4].tostring(), 'KVAAITGAASGIGLECARTLLGAGAKVVL')
01021         self.assertEqual(motif.instances[5].tostring(), 'KVALVTGAGQGIGKAIALRLVKDGFAVAI')
01022         self.assertEqual(motif.instances[6].tostring(), 'KNVWVTGAGKGIGYATALAFVEAGAKVTG')
01023         self.assertEqual(motif.instances[7].tostring(), 'LRALVTGAGKGIGRDTVKALHASGAKVVA')
01024         self.assertEqual(motif.instances[8].tostring(), 'KAAIVTGAAGGIGRATVEAYLREGASVVA')
01025         self.assertEqual(motif.instances[9].tostring(), 'KTALITGGGRGIGRATALALAKEGVNIGL')
01026         self.assertEqual(motif.instances[10].tostring(), 'KVVVITGSSTGLGKSMAIRFATEKAKVVV')
01027         self.assertEqual(motif.instances[11].tostring(), 'QWAVITGAGDGIGKAYSFELAKRGLNVVL')
01028         self.assertEqual(motif.instances[12].tostring(), 'GNVVITGASSGLGLATAKALAESGKWHVI')
01029         self.assertEqual(motif.instances[13].tostring(), 'KAVLVTGCDSGFGFSLAKHLHSKGFLVFA')
01030         self.assertEqual(motif.instances[14].tostring(), 'KVTIITGGTRGIGFAAAKIFIDNGAKVSI')
01031         self.assertEqual(motif.instances[15].tostring(), 'KVMLLTGASRGIGHATAKLFSEAGWRIIS')
01032         self.assertEqual(motif.instances[16].tostring(), 'KVALVTGGASGVGLEVVKLLLGEGAKVAF')
01033         self.assertEqual(motif.instances[17].tostring(), 'KTVIITGGARGLGAEAARQAVAAGARVVL')
01034         self.assertEqual(motif.instances[18].tostring(), 'PVALVTGAAKRLGRSIAEGLHAEGYAVCL')
01035         self.assertEqual(motif.instances[19].tostring(), 'AHVVVTGGSSGIGKCIAIECYKQGAFITL')
01036         self.assertEqual(motif.instances[20].tostring(), 'KAVLVTGGDCGLGHALCKYLDELGFTVFA')
01037         self.assertEqual(motif.instances[21].tostring(), 'QVAFITGGASGAGFGQAKVFGQAGAKIVV')
01038         self.assertEqual(motif.instances[22].tostring(), 'RKALVTGASGAIGGAIARVLHAQGAIVGL')
01039         self.assertEqual(motif.instances[23].tostring(), 'HVALVTGGNKGIGLAIVRDLCRLFSGDVV')
01040         self.assertEqual(motif.instances[24].tostring(), 'PVILVSGSNRGVGKAIAEDLIAHGYRLSL')
01041         self.assertEqual(motif.instances[25].tostring(), 'EAVLITGGASGLGRALVDRFVAEAKVAVL')
01042         self.assertEqual(motif.instances[26].tostring(), 'QVAVVIGGGQTLGAFLCHGLAAEGYRVAV')
01043         self.assertEqual(motif.instances[27].tostring(), 'TVVLITGCSSGIGLHLAVRLASDPSQSFK')
01044         self.assertEqual(motif.instances[28].tostring(), 'KNILVTGGAGFIGSAVVRHIIQNTRDSVV')
01045         self.assertEqual(motif.instances[29].tostring(), 'KNVIFVAGLGGIGLDTSKELLKRDLKNLV')
01046         self.assertEqual(motif.instances[30].tostring(), 'KRILVTGVASKLSIAYGIAQAMHREGAEL')
01047         self.assertEqual(motif.instances[31].tostring(), 'IDTNVTGAAATLSAVLPQMVERKRGHLVG')
01048         self.assertEqual(motif.instances[32].tostring(), 'TSAMLPGLRQGALRRVAHVTSRMGSLAAN')
01049         handle.close()

Here is the call graph for this function:

Test if Motif can parse MEME output files (fourth test)

Definition at line 1050 of file test_Motif.py.

01050 
01051     def test_meme_parser_4(self):
01052         """Test if Motif can parse MEME output files (fourth test)
01053         """
01054         from Bio.Alphabet import IUPAC
01055         from Bio.Motif.Parsers import MEME
01056         handle = open("Motif/meme.protein.tcm.txt")
01057         record = MEME.read(handle)
01058         self.assertEqual(record.version, '3.0')
01059         self.assertEqual(record.datafile, 'farntrans5.s')
01060         self.assertEqual(record.alphabet, IUPAC.protein)
01061         self.assertEqual(len(record.sequence_names), 5)
01062         self.assertEqual(record.sequence_names[0], "RAM1_YEAST")
01063         self.assertEqual(record.sequence_names[1], "PFTB_RAT")
01064         self.assertEqual(record.sequence_names[2], "BET2_YEAST")
01065         self.assertEqual(record.sequence_names[3], "RATRABGERB")
01066         self.assertEqual(record.sequence_names[4], "CAL1_YEAST")
01067         self.assertEqual(record.command, 'meme farntrans5.s -mod tcm -protein -nmotifs 2')
01068         self.assertEqual(len(record.motifs), 2)
01069         motif = record.motifs[0]
01070         self.assertEqual(motif.num_occurrences, 24)
01071         self.assertAlmostEqual(motif.evalue, 2.2e-94)
01072         self.assertEqual(motif.alphabet, IUPAC.protein)
01073         self.assertEqual(motif.name, "Motif 1")
01074         self.assertEqual(len(motif.instances), 24)
01075         self.assertAlmostEqual(motif.instances[0].pvalue, 7.28e-22)
01076         self.assertAlmostEqual(motif.instances[1].pvalue, 6.18e-21)
01077         self.assertAlmostEqual(motif.instances[2].pvalue, 9.17e-20)
01078         self.assertAlmostEqual(motif.instances[3].pvalue, 1.15e-19)
01079         self.assertAlmostEqual(motif.instances[4].pvalue, 4.30e-19)
01080         self.assertAlmostEqual(motif.instances[5].pvalue, 7.36e-19)
01081         self.assertAlmostEqual(motif.instances[6].pvalue, 8.19e-19)
01082         self.assertAlmostEqual(motif.instances[7].pvalue, 2.10e-18)
01083         self.assertAlmostEqual(motif.instances[8].pvalue, 1.43e-17)
01084         self.assertAlmostEqual(motif.instances[9].pvalue, 3.41e-17)
01085         self.assertAlmostEqual(motif.instances[10].pvalue, 5.00e-17)
01086         self.assertAlmostEqual(motif.instances[11].pvalue, 6.64e-17)
01087         self.assertAlmostEqual(motif.instances[12].pvalue, 1.27e-16)
01088         self.assertAlmostEqual(motif.instances[13].pvalue, 3.17e-16)
01089         self.assertAlmostEqual(motif.instances[14].pvalue, 3.47e-16)
01090         self.assertAlmostEqual(motif.instances[15].pvalue, 4.30e-15)
01091         self.assertAlmostEqual(motif.instances[16].pvalue, 2.40e-14)
01092         self.assertAlmostEqual(motif.instances[17].pvalue, 2.81e-14)
01093         self.assertAlmostEqual(motif.instances[18].pvalue, 7.78e-14)
01094         self.assertAlmostEqual(motif.instances[19].pvalue, 1.14e-13)
01095         self.assertAlmostEqual(motif.instances[20].pvalue, 1.33e-13)
01096         self.assertAlmostEqual(motif.instances[21].pvalue, 3.52e-13)
01097         self.assertAlmostEqual(motif.instances[22].pvalue, 5.47e-13)
01098         self.assertAlmostEqual(motif.instances[23].pvalue, 3.11e-10)
01099         self.assertEqual(motif.instances[0].sequence_name, "BET2_YEAST")
01100         self.assertEqual(motif.instances[1].sequence_name, "RATRABGERB")
01101         self.assertEqual(motif.instances[2].sequence_name, "CAL1_YEAST")
01102         self.assertEqual(motif.instances[3].sequence_name, "PFTB_RAT")
01103         self.assertEqual(motif.instances[4].sequence_name, "PFTB_RAT")
01104         self.assertEqual(motif.instances[5].sequence_name, "RATRABGERB")
01105         self.assertEqual(motif.instances[6].sequence_name, "RATRABGERB")
01106         self.assertEqual(motif.instances[7].sequence_name, "BET2_YEAST")
01107         self.assertEqual(motif.instances[8].sequence_name, "RATRABGERB")
01108         self.assertEqual(motif.instances[9].sequence_name, "BET2_YEAST")
01109         self.assertEqual(motif.instances[10].sequence_name, "RAM1_YEAST")
01110         self.assertEqual(motif.instances[11].sequence_name, "BET2_YEAST")
01111         self.assertEqual(motif.instances[12].sequence_name, "RAM1_YEAST")
01112         self.assertEqual(motif.instances[13].sequence_name, "PFTB_RAT")
01113         self.assertEqual(motif.instances[14].sequence_name, "RAM1_YEAST")
01114         self.assertEqual(motif.instances[15].sequence_name, "PFTB_RAT")
01115         self.assertEqual(motif.instances[16].sequence_name, "RATRABGERB")
01116         self.assertEqual(motif.instances[17].sequence_name, "PFTB_RAT")
01117         self.assertEqual(motif.instances[18].sequence_name, "BET2_YEAST")
01118         self.assertEqual(motif.instances[19].sequence_name, "CAL1_YEAST")
01119         self.assertEqual(motif.instances[20].sequence_name, "RAM1_YEAST")
01120         self.assertEqual(motif.instances[21].sequence_name, "RAM1_YEAST")
01121         self.assertEqual(motif.instances[22].sequence_name, "CAL1_YEAST")
01122         self.assertEqual(motif.instances[23].sequence_name, "BET2_YEAST")
01123         self.assertEqual(motif.instances[0].strand, '+')
01124         self.assertEqual(motif.instances[1].strand, '+')
01125         self.assertEqual(motif.instances[2].strand, '+')
01126         self.assertEqual(motif.instances[3].strand, '+')
01127         self.assertEqual(motif.instances[4].strand, '+')
01128         self.assertEqual(motif.instances[5].strand, '+')
01129         self.assertEqual(motif.instances[6].strand, '+')
01130         self.assertEqual(motif.instances[7].strand, '+')
01131         self.assertEqual(motif.instances[8].strand, '+')
01132         self.assertEqual(motif.instances[9].strand, '+')
01133         self.assertEqual(motif.instances[10].strand, '+')
01134         self.assertEqual(motif.instances[11].strand, '+')
01135         self.assertEqual(motif.instances[12].strand, '+')
01136         self.assertEqual(motif.instances[13].strand, '+')
01137         self.assertEqual(motif.instances[14].strand, '+')
01138         self.assertEqual(motif.instances[15].strand, '+')
01139         self.assertEqual(motif.instances[16].strand, '+')
01140         self.assertEqual(motif.instances[17].strand, '+')
01141         self.assertEqual(motif.instances[18].strand, '+')
01142         self.assertEqual(motif.instances[19].strand, '+')
01143         self.assertEqual(motif.instances[20].strand, '+')
01144         self.assertEqual(motif.instances[21].strand, '+')
01145         self.assertEqual(motif.instances[22].strand, '+')
01146         self.assertEqual(motif.instances[23].strand, '+')
01147         self.assertEqual(motif.instances[0].length, 30)
01148         self.assertEqual(motif.instances[1].length, 30)
01149         self.assertEqual(motif.instances[2].length, 30)
01150         self.assertEqual(motif.instances[3].length, 30)
01151         self.assertEqual(motif.instances[4].length, 30)
01152         self.assertEqual(motif.instances[5].length, 30)
01153         self.assertEqual(motif.instances[6].length, 30)
01154         self.assertEqual(motif.instances[7].length, 30)
01155         self.assertEqual(motif.instances[8].length, 30)
01156         self.assertEqual(motif.instances[9].length, 30)
01157         self.assertEqual(motif.instances[10].length, 30)
01158         self.assertEqual(motif.instances[11].length, 30)
01159         self.assertEqual(motif.instances[12].length, 30)
01160         self.assertEqual(motif.instances[13].length, 30)
01161         self.assertEqual(motif.instances[14].length, 30)
01162         self.assertEqual(motif.instances[15].length, 30)
01163         self.assertEqual(motif.instances[16].length, 30)
01164         self.assertEqual(motif.instances[17].length, 30)
01165         self.assertEqual(motif.instances[18].length, 30)
01166         self.assertEqual(motif.instances[19].length, 30)
01167         self.assertEqual(motif.instances[20].length, 30)
01168         self.assertEqual(motif.instances[21].length, 30)
01169         self.assertEqual(motif.instances[22].length, 30)
01170         self.assertEqual(motif.instances[23].length, 30)
01171         self.assertEqual(motif.instances[0].start, 223)
01172         self.assertEqual(motif.instances[1].start, 227)
01173         self.assertEqual(motif.instances[2].start, 275)
01174         self.assertEqual(motif.instances[3].start, 237)
01175         self.assertEqual(motif.instances[4].start, 138)
01176         self.assertEqual(motif.instances[5].start, 179)
01177         self.assertEqual(motif.instances[6].start, 131)
01178         self.assertEqual(motif.instances[7].start, 172)
01179         self.assertEqual(motif.instances[8].start, 276)
01180         self.assertEqual(motif.instances[9].start, 124)
01181         self.assertEqual(motif.instances[10].start, 247)
01182         self.assertEqual(motif.instances[11].start, 272)
01183         self.assertEqual(motif.instances[12].start, 145)
01184         self.assertEqual(motif.instances[13].start, 286)
01185         self.assertEqual(motif.instances[14].start, 296)
01186         self.assertEqual(motif.instances[15].start, 348)
01187         self.assertEqual(motif.instances[16].start, 83)
01188         self.assertEqual(motif.instances[17].start, 189)
01189         self.assertEqual(motif.instances[18].start, 73)
01190         self.assertEqual(motif.instances[19].start, 205)
01191         self.assertEqual(motif.instances[20].start, 198)
01192         self.assertEqual(motif.instances[21].start, 349)
01193         self.assertEqual(motif.instances[22].start, 327)
01194         self.assertEqual(motif.instances[23].start, 24)
01195         self.assertEqual(motif.instances[0].tostring(), "GGLNGRPSKLPDVCYSWWVLSSLAIIGRLD")
01196         self.assertEqual(motif.instances[1].tostring(), "GGLNGRPEKLPDVCYSWWVLASLKIIGRLH")
01197         self.assertEqual(motif.instances[2].tostring(), "GGFQGRENKFADTCYAFWCLNSLHLLTKDW")
01198         self.assertEqual(motif.instances[3].tostring(), "GGIGGVPGMEAHGGYTFCGLAALVILKKER")
01199         self.assertEqual(motif.instances[4].tostring(), "GGFGGGPGQYPHLAPTYAAVNALCIIGTEE")
01200         self.assertEqual(motif.instances[5].tostring(), "GGFGCRPGSESHAGQIYCCTGFLAITSQLH")
01201         self.assertEqual(motif.instances[6].tostring(), "GSFAGDIWGEIDTRFSFCAVATLALLGKLD")
01202         self.assertEqual(motif.instances[7].tostring(), "GGFGLCPNAESHAAQAFTCLGALAIANKLD")
01203         self.assertEqual(motif.instances[8].tostring(), "GGFADRPGDMVDPFHTLFGIAGLSLLGEEQ")
01204         self.assertEqual(motif.instances[9].tostring(), "GSFQGDRFGEVDTRFVYTALSALSILGELT")
01205         self.assertEqual(motif.instances[10].tostring(), "GFGSCPHVDEAHGGYTFCATASLAILRSMD")
01206         self.assertEqual(motif.instances[11].tostring(), "GGISDRPENEVDVFHTVFGVAGLSLMGYDN")
01207         self.assertEqual(motif.instances[12].tostring(), "GPFGGGPGQLSHLASTYAAINALSLCDNID")
01208         self.assertEqual(motif.instances[13].tostring(), "GGFQGRCNKLVDGCYSFWQAGLLPLLHRAL")
01209         self.assertEqual(motif.instances[14].tostring(), "RGFCGRSNKLVDGCYSFWVGGSAAILEAFG")
01210         self.assertEqual(motif.instances[15].tostring(), "GGLLDKPGKSRDFYHTCYCLSGLSIAQHFG")
01211         self.assertEqual(motif.instances[16].tostring(), "GGVSASIGHDPHLLYTLSAVQILTLYDSIH")
01212         self.assertEqual(motif.instances[17].tostring(), "GSFLMHVGGEVDVRSAYCAASVASLTNIIT")
01213         self.assertEqual(motif.instances[18].tostring(), "GAFAPFPRHDAHLLTTLSAVQILATYDALD")
01214         self.assertEqual(motif.instances[19].tostring(), "YNGAFGAHNEPHSGYTSCALSTLALLSSLE")
01215         self.assertEqual(motif.instances[20].tostring(), "GFKTCLEVGEVDTRGIYCALSIATLLNILT")
01216         self.assertEqual(motif.instances[21].tostring(), "PGLRDKPGAHSDFYHTNYCLLGLAVAESSY")
01217         self.assertEqual(motif.instances[22].tostring(), "GGFSKNDEEDADLYHSCLGSAALALIEGKF")
01218         self.assertEqual(motif.instances[23].tostring(), "HNFEYWLTEHLRLNGIYWGLTALCVLDSPE")
01219         motif = record.motifs[1]
01220         self.assertEqual(motif.num_occurrences, 21)
01221         self.assertAlmostEqual(motif.evalue, 3.1e-19)
01222         self.assertEqual(motif.alphabet, IUPAC.protein)
01223         self.assertEqual(motif.name, "Motif 2")
01224         self.assertEqual(len(motif.instances), 21)
01225         self.assertAlmostEqual(motif.instances[0].pvalue, 2.24e-13)
01226         self.assertAlmostEqual(motif.instances[1].pvalue, 1.30e-12)
01227         self.assertAlmostEqual(motif.instances[2].pvalue, 4.20e-12)
01228         self.assertAlmostEqual(motif.instances[3].pvalue, 9.60e-12)
01229         self.assertAlmostEqual(motif.instances[4].pvalue, 5.08e-11)
01230         self.assertAlmostEqual(motif.instances[5].pvalue, 5.01e-10)
01231         self.assertAlmostEqual(motif.instances[6].pvalue, 6.90e-10)
01232         self.assertAlmostEqual(motif.instances[7].pvalue, 1.57e-09)
01233         self.assertAlmostEqual(motif.instances[8].pvalue, 2.34e-09)
01234         self.assertAlmostEqual(motif.instances[9].pvalue, 4.59e-09)
01235         self.assertAlmostEqual(motif.instances[10].pvalue, 1.65e-08)
01236         self.assertAlmostEqual(motif.instances[11].pvalue, 1.65e-08)
01237         self.assertAlmostEqual(motif.instances[12].pvalue, 1.65e-08)
01238         self.assertAlmostEqual(motif.instances[13].pvalue, 2.54e-08)
01239         self.assertAlmostEqual(motif.instances[14].pvalue, 4.58e-08)
01240         self.assertAlmostEqual(motif.instances[15].pvalue, 5.86e-08)
01241         self.assertAlmostEqual(motif.instances[16].pvalue, 1.52e-07)
01242         self.assertAlmostEqual(motif.instances[17].pvalue, 1.91e-07)
01243         self.assertAlmostEqual(motif.instances[18].pvalue, 4.34e-07)
01244         self.assertAlmostEqual(motif.instances[19].pvalue, 5.01e-07)
01245         self.assertAlmostEqual(motif.instances[20].pvalue, 5.78e-07)
01246         self.assertEqual(motif.instances[0].sequence_name, "BET2_YEAST")
01247         self.assertEqual(motif.instances[1].sequence_name, "RATRABGERB")
01248         self.assertEqual(motif.instances[2].sequence_name, "RATRABGERB")
01249         self.assertEqual(motif.instances[3].sequence_name, "RATRABGERB")
01250         self.assertEqual(motif.instances[4].sequence_name, "RAM1_YEAST")
01251         self.assertEqual(motif.instances[5].sequence_name, "CAL1_YEAST")
01252         self.assertEqual(motif.instances[6].sequence_name, "BET2_YEAST")
01253         self.assertEqual(motif.instances[7].sequence_name, "RATRABGERB")
01254         self.assertEqual(motif.instances[8].sequence_name, "PFTB_RAT")
01255         self.assertEqual(motif.instances[9].sequence_name, "RAM1_YEAST")
01256         self.assertEqual(motif.instances[10].sequence_name, "CAL1_YEAST")
01257         self.assertEqual(motif.instances[11].sequence_name, "PFTB_RAT")
01258         self.assertEqual(motif.instances[12].sequence_name, "PFTB_RAT")
01259         self.assertEqual(motif.instances[13].sequence_name, "RAM1_YEAST")
01260         self.assertEqual(motif.instances[14].sequence_name, "PFTB_RAT")
01261         self.assertEqual(motif.instances[15].sequence_name, "CAL1_YEAST")
01262         self.assertEqual(motif.instances[16].sequence_name, "PFTB_RAT")
01263         self.assertEqual(motif.instances[17].sequence_name, "CAL1_YEAST")
01264         self.assertEqual(motif.instances[18].sequence_name, "BET2_YEAST")
01265         self.assertEqual(motif.instances[19].sequence_name, "BET2_YEAST")
01266         self.assertEqual(motif.instances[20].sequence_name, "RAM1_YEAST")
01267         self.assertEqual(motif.instances[0].strand, '+')
01268         self.assertEqual(motif.instances[1].strand, '+')
01269         self.assertEqual(motif.instances[2].strand, '+')
01270         self.assertEqual(motif.instances[3].strand, '+')
01271         self.assertEqual(motif.instances[4].strand, '+')
01272         self.assertEqual(motif.instances[5].strand, '+')
01273         self.assertEqual(motif.instances[6].strand, '+')
01274         self.assertEqual(motif.instances[7].strand, '+')
01275         self.assertEqual(motif.instances[8].strand, '+')
01276         self.assertEqual(motif.instances[9].strand, '+')
01277         self.assertEqual(motif.instances[10].strand, '+')
01278         self.assertEqual(motif.instances[11].strand, '+')
01279         self.assertEqual(motif.instances[12].strand, '+')
01280         self.assertEqual(motif.instances[13].strand, '+')
01281         self.assertEqual(motif.instances[14].strand, '+')
01282         self.assertEqual(motif.instances[15].strand, '+')
01283         self.assertEqual(motif.instances[16].strand, '+')
01284         self.assertEqual(motif.instances[17].strand, '+')
01285         self.assertEqual(motif.instances[18].strand, '+')
01286         self.assertEqual(motif.instances[19].strand, '+')
01287         self.assertEqual(motif.instances[20].strand, '+')
01288         self.assertEqual(motif.instances[0].length, 14)
01289         self.assertEqual(motif.instances[1].length, 14)
01290         self.assertEqual(motif.instances[2].length, 14)
01291         self.assertEqual(motif.instances[3].length, 14)
01292         self.assertEqual(motif.instances[4].length, 14)
01293         self.assertEqual(motif.instances[5].length, 14)
01294         self.assertEqual(motif.instances[6].length, 14)
01295         self.assertEqual(motif.instances[7].length, 14)
01296         self.assertEqual(motif.instances[8].length, 14)
01297         self.assertEqual(motif.instances[9].length, 14)
01298         self.assertEqual(motif.instances[10].length, 14)
01299         self.assertEqual(motif.instances[11].length, 14)
01300         self.assertEqual(motif.instances[12].length, 14)
01301         self.assertEqual(motif.instances[13].length, 14)
01302         self.assertEqual(motif.instances[14].length, 14)
01303         self.assertEqual(motif.instances[15].length, 14)
01304         self.assertEqual(motif.instances[16].length, 14)
01305         self.assertEqual(motif.instances[17].length, 14)
01306         self.assertEqual(motif.instances[18].length, 14)
01307         self.assertEqual(motif.instances[19].length, 14)
01308         self.assertEqual(motif.instances[20].length, 14)
01309         self.assertEqual(motif.instances[0].start, 254)
01310         self.assertEqual(motif.instances[1].start, 258)
01311         self.assertEqual(motif.instances[2].start, 162)
01312         self.assertEqual(motif.instances[3].start,  66)
01313         self.assertEqual(motif.instances[4].start, 278)
01314         self.assertEqual(motif.instances[5].start, 190)
01315         self.assertEqual(motif.instances[6].start,  55)
01316         self.assertEqual(motif.instances[7].start, 114)
01317         self.assertEqual(motif.instances[8].start, 172)
01318         self.assertEqual(motif.instances[9].start, 330)
01319         self.assertEqual(motif.instances[10].start, 126)
01320         self.assertEqual(motif.instances[11].start, 268)
01321         self.assertEqual(motif.instances[12].start, 220)
01322         self.assertEqual(motif.instances[13].start, 229)
01323         self.assertEqual(motif.instances[14].start, 330)
01324         self.assertEqual(motif.instances[15].start, 239)
01325         self.assertEqual(motif.instances[16].start, 121)
01326         self.assertEqual(motif.instances[17].start, 362)
01327         self.assertEqual(motif.instances[18].start, 107)
01328         self.assertEqual(motif.instances[19].start, 155)
01329         self.assertEqual(motif.instances[20].start, 180)
01330         self.assertEqual(motif.instances[0].tostring(), "INYEKLTEFILKCQ")
01331         self.assertEqual(motif.instances[1].tostring(), "IDREKLRSFILACQ")
01332         self.assertEqual(motif.instances[2].tostring(), "INVEKAIEFVLSCM")
01333         self.assertEqual(motif.instances[3].tostring(), "MNKEEILVFIKSCQ")
01334         self.assertEqual(motif.instances[4].tostring(), "INVEKLLEWSSARQ")
01335         self.assertEqual(motif.instances[5].tostring(), "IDTEKLLGYIMSQQ")
01336         self.assertEqual(motif.instances[6].tostring(), "FVKEEVISFVLSCW")
01337         self.assertEqual(motif.instances[7].tostring(), "INVDKVVAYVQSLQ")
01338         self.assertEqual(motif.instances[8].tostring(), "INREKLLQYLYSLK")
01339         self.assertEqual(motif.instances[9].tostring(), "FNKHALRDYILYCC")
01340         self.assertEqual(motif.instances[10].tostring(), "LDKRSLARFVSKCQ")
01341         self.assertEqual(motif.instances[11].tostring(), "LNLKSLLQWVTSRQ")
01342         self.assertEqual(motif.instances[12].tostring(), "DLFEGTAEWIARCQ")
01343         self.assertEqual(motif.instances[13].tostring(), "ELTEGVLNYLKNCQ")
01344         self.assertEqual(motif.instances[14].tostring(), "FHQQALQEYILMCC")
01345         self.assertEqual(motif.instances[15].tostring(), "KFKEDTITWLLHRQ")
01346         self.assertEqual(motif.instances[16].tostring(), "IVATDVCQFLELCQ")
01347         self.assertEqual(motif.instances[17].tostring(), "IPQEIFNDFSKRCC")
01348         self.assertEqual(motif.instances[18].tostring(), "DRKVRLISFIRGNQ")
01349         self.assertEqual(motif.instances[19].tostring(), "EVVDPAVDFVLKCY")
01350         self.assertEqual(motif.instances[20].tostring(), "IDRKGIYQWLISLK")
01351         handle.close()

Here is the call graph for this function:


The documentation for this class was generated from the following file: