Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_Motif.MotifTestsBasic Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_alignace_parsing
def test_pfm_parsing
def test_sites_parsing
def test_FAoutput
def test_TFoutput
def test_pfm_output

Public Attributes

 PFMin
 SITESin
 TFout
 FAout
 PFMout
 m

Detailed Description

Definition at line 13 of file test_Motif.py.


Member Function Documentation

Definition at line 14 of file test_Motif.py.

00014 
00015     def setUp(self):
00016         self.PFMin = open("Motif/SRF.pfm")
00017         self.SITESin = open("Motif/Arnt.sites")
00018         self.TFout = "Motif/tf.out"
00019         self.FAout = "Motif/fa.out"
00020         self.PFMout = "Motif/fa.out"
00021         self.m=Motif.Motif()
00022         self.m.add_instance(Seq("ATATA",self.m.alphabet))
        

Definition at line 23 of file test_Motif.py.

00023 
00024     def tearDown(self):
00025         self.PFMin.close()
00026         self.SITESin.close()
00027         if os.path.exists(self.TFout):
00028             os.remove(self.TFout)
00029         if os.path.exists(self.FAout):
00030             os.remove(self.FAout)

Test if Motif can parse AlignAce output files.

Definition at line 31 of file test_Motif.py.

00031 
00032     def test_alignace_parsing(self):
00033         """Test if Motif can parse AlignAce output files.
00034         """
00035         from Bio.Alphabet import IUPAC
00036         from Bio.Motif.Parsers import AlignAce
00037         handle = open("Motif/alignace.out")
00038         record = AlignAce.read(handle)
00039         handle.close()
00040         self.assertEqual(record.ver, "AlignACE 4.0 05/13/04\n")
00041         self.assertEqual(record.cmd_line, "./AlignACE -i test.fa \n")
00042         self.assertEqual(len(record.param_dict), 7)
00043         self.assertEqual(record.param_dict['expect'], "10")
00044         self.assertEqual(record.param_dict['gcback'], "0.38")
00045         self.assertEqual(record.param_dict['minpass'], "200")
00046         self.assertEqual(record.param_dict['seed'], "1227623309")
00047         self.assertEqual(record.param_dict['numcols'], "10")
00048         self.assertEqual(record.param_dict['undersample'], "1")
00049         self.assertEqual(record.param_dict['oversample'], "1")
00050         self.assertEqual(len(record.seq_dict), 10)
00051         self.assertEqual(record.seq_dict[0], "SEQ1; M: CTCAATCGTAGA at 52\n")
00052         self.assertEqual(record.seq_dict[1], "SEQ2; M: CTCAATCGTAGA at 172\n")
00053         self.assertEqual(record.seq_dict[2], "SEQ3; M: CTCAATCGTAGA at 112\n")
00054         self.assertEqual(record.seq_dict[3], "SEQ4; M: CTCAATCGTAGA at 173\n")
00055         self.assertEqual(record.seq_dict[4], "SEQ5; M: CTCAATCGTAGA at 185\n")
00056         self.assertEqual(record.seq_dict[5], "SEQ6; M: CTCAATCGTAGA at 105\n")
00057         self.assertEqual(record.seq_dict[6], "SEQ7; M: CTCAATCGTAGA at 177\n")
00058         self.assertEqual(record.seq_dict[7], "SEQ8; M: CTCAATCGTAGA at 172\n")
00059         self.assertEqual(record.seq_dict[8], "SEQ9; M: CTCAATCGTAGA at 93\n")
00060         self.assertEqual(record.seq_dict[9], "SEQ10; M: CTCAATCGTAGA at 3\n")
00061         self.assertEqual(len(record.motifs), 16)
00062         self.assertEqual(record.motifs[0].alphabet, IUPAC.unambiguous_dna)
00063         self.assertEqual(len(record.motifs[0].instances), 11)
00064         self.assertEqual(record.motifs[0].instances[0].tostring(), "TCTACGATTGAG")
00065         self.assertEqual(record.motifs[0].instances[1].tostring(), "TCTACGATTGAG")
00066         self.assertEqual(record.motifs[0].instances[2].tostring(), "TCTACGATTGAG")
00067         self.assertEqual(record.motifs[0].instances[3].tostring(), "TCTACGATTGAG")
00068         self.assertEqual(record.motifs[0].instances[4].tostring(), "TCTACGATTGAG")
00069         self.assertEqual(record.motifs[0].instances[5].tostring(), "TCTACGATTGAG")
00070         self.assertEqual(record.motifs[0].instances[6].tostring(), "TCTACGATTGAG")
00071         self.assertEqual(record.motifs[0].instances[7].tostring(), "TCTACGATTGAG")
00072         self.assertEqual(record.motifs[0].instances[8].tostring(), "TCTACGATTGAG")
00073         self.assertEqual(record.motifs[0].instances[9].tostring(), "TCAAAGATAGAG")
00074         self.assertEqual(record.motifs[0].instances[10].tostring(), "TCTACGATTGAG")
00075         self.assertEqual(record.motifs[0].mask, [1,1,0,1,1,1,1,1,0,1,1,1])
00076         self.assertAlmostEqual(record.motifs[0].score, 57.9079)
00077         self.assertEqual(record.motifs[1].alphabet, IUPAC.unambiguous_dna)
00078         self.assertEqual(len(record.motifs[1].instances), 22)
00079         self.assertEqual(record.motifs[1].instances[0].tostring(), "GCGAAGGAAGCAGCGCGTGTG")
00080         self.assertEqual(record.motifs[1].instances[1].tostring(), "GGCACCGCCTCTACGATTGAG")
00081         self.assertEqual(record.motifs[1].instances[2].tostring(), "CAGAGCTTAGCATTGAACGCG")
00082         self.assertEqual(record.motifs[1].instances[3].tostring(), "CTAATGAAAGCAATGAGAGTG")
00083         self.assertEqual(record.motifs[1].instances[4].tostring(), "CTTGTGCCCTCTAAGCGTCCG")
00084         self.assertEqual(record.motifs[1].instances[5].tostring(), "GAGCACGACGCTTTGTACCTG")
00085         self.assertEqual(record.motifs[1].instances[6].tostring(), "CGGCACTTAGCAGCGTATCGT")
00086         self.assertEqual(record.motifs[1].instances[7].tostring(), "CTGGTTTCATCTACGATTGAG")
00087         self.assertEqual(record.motifs[1].instances[8].tostring(), "GGGCCAATAGCGGCGCCGGAG")
00088         self.assertEqual(record.motifs[1].instances[9].tostring(), "GTGGAGTTATCTTAGTGCGCG")
00089         self.assertEqual(record.motifs[1].instances[10].tostring(), "GAGAGGTTATCTACGATTGAG")
00090         self.assertEqual(record.motifs[1].instances[11].tostring(), "CTGCTCCCCGCATACAGCGCG")
00091         self.assertEqual(record.motifs[1].instances[12].tostring(), "CAGAACCGAGGTCCGGTACGG")
00092         self.assertEqual(record.motifs[1].instances[13].tostring(), "GTGCCCCAAGCTTACCCAGGG")
00093         self.assertEqual(record.motifs[1].instances[14].tostring(), "CGCCTCTGATCTACGATTGAG")
00094         self.assertEqual(record.motifs[1].instances[15].tostring(), "GTGCTCATAGGGACGTCGCGG")
00095         self.assertEqual(record.motifs[1].instances[16].tostring(), "CTGCCCCCCGCATAGTAGGGG")
00096         self.assertEqual(record.motifs[1].instances[17].tostring(), "GTAAAGAAATCGATGTGCCAG")
00097         self.assertEqual(record.motifs[1].instances[18].tostring(), "CACCTGCAATTGCTGGCAGCG")
00098         self.assertEqual(record.motifs[1].instances[19].tostring(), "GGCGGGCCATCCCTGTATGAA")
00099         self.assertEqual(record.motifs[1].instances[20].tostring(), "CTCCAGGTCGCATGGAGAGAG")
00100         self.assertEqual(record.motifs[1].instances[21].tostring(), "CCTCGGATCGCTTGGGAAGAG")
00101         self.assertEqual(record.motifs[1].mask, [1,0,1,1,0,1,0,0,1,1,1,0,0,0,1,0,0,0,1,0,1])
00102         self.assertAlmostEqual(record.motifs[1].score, 19.6235)
00103 
00104         self.assertEqual(record.motifs[2].alphabet, IUPAC.unambiguous_dna)
00105         self.assertEqual(len(record.motifs[2].instances), 18)
00106         self.assertEqual(record.motifs[2].instances[0].tostring(), "GTGCGCGAAGGAAGCAGCGCG")
00107         self.assertEqual(record.motifs[2].instances[1].tostring(), "CAGAGCTTAGCATTGAACGCG")
00108         self.assertEqual(record.motifs[2].instances[2].tostring(), "GTGCCCGATGACCACCCGTCG")
00109         self.assertEqual(record.motifs[2].instances[3].tostring(), "GCCCTCTAAGCGTCCGCGGAT")
00110         self.assertEqual(record.motifs[2].instances[4].tostring(), "GAGCACGACGCTTTGTACCTG")
00111         self.assertEqual(record.motifs[2].instances[5].tostring(), "CGGCACTTAGCAGCGTATCGT")
00112         self.assertEqual(record.motifs[2].instances[6].tostring(), "GGGCCAATAGCGGCGCCGGAG")
00113         self.assertEqual(record.motifs[2].instances[7].tostring(), "GCGCACTAAGATAACTCCACG")
00114         self.assertEqual(record.motifs[2].instances[8].tostring(), "CGGCCCGTTGTCCAGCAGACG")
00115         self.assertEqual(record.motifs[2].instances[9].tostring(), "CTGCTCCCCGCATACAGCGCG")
00116         self.assertEqual(record.motifs[2].instances[10].tostring(), "GTGCCCCAAGCTTACCCAGGG")
00117         self.assertEqual(record.motifs[2].instances[11].tostring(), "GTGCTCATAGGGACGTCGCGG")
00118         self.assertEqual(record.motifs[2].instances[12].tostring(), "CTGCCCCCCGCATAGTAGGGG")
00119         self.assertEqual(record.motifs[2].instances[13].tostring(), "CGCCGCCATGCGACGCAGAGG")
00120         self.assertEqual(record.motifs[2].instances[14].tostring(), "AACCTCTAAGCATACTCTACG")
00121         self.assertEqual(record.motifs[2].instances[15].tostring(), "GACCTGGAGGCTTAGACTTGG")
00122         self.assertEqual(record.motifs[2].instances[16].tostring(), "GCGCTCTTCCCAAGCGATCCG")
00123         self.assertEqual(record.motifs[2].instances[17].tostring(), "GGGCCGTCAGCTCTCAAGTCT")
00124         self.assertEqual(record.motifs[2].mask, [1,0,1,1,0,1,0,0,0,1,1,0,0,0,1,0,1,0,0,1,1])
00125         self.assertAlmostEqual(record.motifs[2].score, 19.1804)
00126 
00127         self.assertEqual(record.motifs[3].alphabet, IUPAC.unambiguous_dna)
00128         self.assertEqual(len(record.motifs[3].instances), 16)
00129         self.assertEqual(record.motifs[3].instances[0].tostring(), "GCCCCAAGCTTACCCAGGGAC")
00130         self.assertEqual(record.motifs[3].instances[1].tostring(), "GCCGTCTGCTGGACAACGGGC")
00131         self.assertEqual(record.motifs[3].instances[2].tostring(), "GCCGACGGGTGGTCATCGGGC")
00132         self.assertEqual(record.motifs[3].instances[3].tostring(), "GCCAATAGCGGCGCCGGAGTC")
00133         self.assertEqual(record.motifs[3].instances[4].tostring(), "GCCCCCCGCATAGTAGGGGGA")
00134         self.assertEqual(record.motifs[3].instances[5].tostring(), "GCCCGTACCGGACCTCGGTTC")
00135         self.assertEqual(record.motifs[3].instances[6].tostring(), "GCCTCATGTACCGGAAGGGAC")
00136         self.assertEqual(record.motifs[3].instances[7].tostring(), "GACACGCGCCTGGGAGGGTTC")
00137         self.assertEqual(record.motifs[3].instances[8].tostring(), "GCCTTTGGCCTTGGATGAGAA")
00138         self.assertEqual(record.motifs[3].instances[9].tostring(), "GGCCCTCGGATCGCTTGGGAA")
00139         self.assertEqual(record.motifs[3].instances[10].tostring(), "GCATGTTGGGAATCCGCGGAC")
00140         self.assertEqual(record.motifs[3].instances[11].tostring(), "GACACGCGCTGTATGCGGGGA")
00141         self.assertEqual(record.motifs[3].instances[12].tostring(), "GCCAGGTACAAAGCGTCGTGC")
00142         self.assertEqual(record.motifs[3].instances[13].tostring(), "GCGATCAGCTTGTGGGCGTGC")
00143         self.assertEqual(record.motifs[3].instances[14].tostring(), "GACAAATCGGATACTGGGGCA")
00144         self.assertEqual(record.motifs[3].instances[15].tostring(), "GCACTTAGCAGCGTATCGTTA")
00145         self.assertEqual(record.motifs[3].mask, [1,1,1,0,0,0,0,1,1,0,0,0,0,1,0,0,1,1,1,0,1])
00146         self.assertAlmostEqual(record.motifs[3].score, 18.0097)
00147         self.assertEqual(record.motifs[4].alphabet, IUPAC.unambiguous_dna)
00148         self.assertEqual(len(record.motifs[4].instances), 15)
00149         self.assertEqual(record.motifs[4].instances[0].tostring(), "CGGCACAGAGCTT")
00150         self.assertEqual(record.motifs[4].instances[1].tostring(), "ATCCGCGGACGCT")
00151         self.assertEqual(record.motifs[4].instances[2].tostring(), "CGCCTGGGAGGGT")
00152         self.assertEqual(record.motifs[4].instances[3].tostring(), "CGGAAGGGACGTT")
00153         self.assertEqual(record.motifs[4].instances[4].tostring(), "ACACACAGACGGT")
00154         self.assertEqual(record.motifs[4].instances[5].tostring(), "TGCCAGAGAGGTT")
00155         self.assertEqual(record.motifs[4].instances[6].tostring(), "AGACTGAGACGTT")
00156         self.assertEqual(record.motifs[4].instances[7].tostring(), "AATCGTAGAGGAT")
00157         self.assertEqual(record.motifs[4].instances[8].tostring(), "CGTCTCGTAGGGT")
00158         self.assertEqual(record.motifs[4].instances[9].tostring(), "CGTCGCGGAGGAT")
00159         self.assertEqual(record.motifs[4].instances[10].tostring(), "CTTCTTAGACGCT")
00160         self.assertEqual(record.motifs[4].instances[11].tostring(), "CGACGCAGAGGAT")
00161         self.assertEqual(record.motifs[4].instances[12].tostring(), "ATGCTTAGAGGTT")
00162         self.assertEqual(record.motifs[4].instances[13].tostring(), "AGACTTGGGCGAT")
00163         self.assertEqual(record.motifs[4].instances[14].tostring(), "CGACCTGGAGGCT")
00164         self.assertEqual(record.motifs[4].mask, [1,1,0,1,0,1,1,1,1,1,1,0,1])
00165         self.assertAlmostEqual(record.motifs[4].score, 16.8287)
00166         self.assertEqual(record.motifs[5].alphabet, IUPAC.unambiguous_dna)
00167         self.assertEqual(len(record.motifs[5].instances), 18)
00168         self.assertEqual(record.motifs[5].instances[0].tostring(), "GTGCGCGAAGGAAGCAGCGCGTG")
00169         self.assertEqual(record.motifs[5].instances[1].tostring(), "TTGAGCCGAGTAAAGGGCTGGTG")
00170         self.assertEqual(record.motifs[5].instances[2].tostring(), "CAATGCTAAGCTCTGTGCCGACG")
00171         self.assertEqual(record.motifs[5].instances[3].tostring(), "CAACTCTCTATGTAGTGCCCGAG")
00172         self.assertEqual(record.motifs[5].instances[4].tostring(), "CGACGCTTTGTACCTGGCTTGCG")
00173         self.assertEqual(record.motifs[5].instances[5].tostring(), "CGAGTCAATGACACGCGCCTGGG")
00174         self.assertEqual(record.motifs[5].instances[6].tostring(), "CGATACGCTGCTAAGTGCCGTCC")
00175         self.assertEqual(record.motifs[5].instances[7].tostring(), "CCGGGCCAATAGCGGCGCCGGAG")
00176         self.assertEqual(record.motifs[5].instances[8].tostring(), "CCACGCTTCGACACGTGGTATAG")
00177         self.assertEqual(record.motifs[5].instances[9].tostring(), "CCGAGCCTCATGTACCGGAAGGG")
00178         self.assertEqual(record.motifs[5].instances[10].tostring(), "CTGCTCCCCGCATACAGCGCGTG")
00179         self.assertEqual(record.motifs[5].instances[11].tostring(), "CCGAGGTCCGGTACGGGCAAGCC")
00180         self.assertEqual(record.motifs[5].instances[12].tostring(), "GTGCTCATAGGGACGTCGCGGAG")
00181         self.assertEqual(record.motifs[5].instances[13].tostring(), "CCCTACTATGCGGGGGGCAGGTC")
00182         self.assertEqual(record.motifs[5].instances[14].tostring(), "GCCAGCAATTGCAGGTGGTCGTG")
00183         self.assertEqual(record.motifs[5].instances[15].tostring(), "CTCTGCGTCGCATGGCGGCGTGG")
00184         self.assertEqual(record.motifs[5].instances[16].tostring(), "GGAGGCTTAGACTTGGGCGATAC")
00185         self.assertEqual(record.motifs[5].instances[17].tostring(), "GCATGGAGAGAGATCCGGAGGAG")
00186         self.assertEqual(record.motifs[5].mask, [1,0,1,0,1,1,0,0,0,1,0,0,0,0,1,0,1,1,0,0,1,0,1])
00187         self.assertAlmostEqual(record.motifs[5].score, 15.0441)
00188         self.assertEqual(record.motifs[6].alphabet, IUPAC.unambiguous_dna)
00189         self.assertEqual(len(record.motifs[6].instances), 20)
00190         self.assertEqual(record.motifs[6].instances[0].tostring(), "GCGCGTGTGTGTAAC")
00191         self.assertEqual(record.motifs[6].instances[1].tostring(), "GCACAGAGCTTAGCA")
00192         self.assertEqual(record.motifs[6].instances[2].tostring(), "GGTGGTCATCGGGCA")
00193         self.assertEqual(record.motifs[6].instances[3].tostring(), "GCGCGTGTCATTGAC")
00194         self.assertEqual(record.motifs[6].instances[4].tostring(), "GGACGGCACTTAGCA")
00195         self.assertEqual(record.motifs[6].instances[5].tostring(), "GCGCGTCCCGGGCCA")
00196         self.assertEqual(record.motifs[6].instances[6].tostring(), "GCTCGGCCCGTTGTC")
00197         self.assertEqual(record.motifs[6].instances[7].tostring(), "GCGCGTGTCCTTTAA")
00198         self.assertEqual(record.motifs[6].instances[8].tostring(), "GCTGATCGCTGCTCC")
00199         self.assertEqual(record.motifs[6].instances[9].tostring(), "GCCCGTACCGGACCT")
00200         self.assertEqual(record.motifs[6].instances[10].tostring(), "GGACGTCGCGGAGGA")
00201         self.assertEqual(record.motifs[6].instances[11].tostring(), "GCGGGGGGCAGGTCA")
00202         self.assertEqual(record.motifs[6].instances[12].tostring(), "GGACGTACTGGCACA")
00203         self.assertEqual(record.motifs[6].instances[13].tostring(), "GCAGGTGGTCGTGCA")
00204         self.assertEqual(record.motifs[6].instances[14].tostring(), "GCGCATACCTTAACA")
00205         self.assertEqual(record.motifs[6].instances[15].tostring(), "GCACGGGACTTCAAC")
00206         self.assertEqual(record.motifs[6].instances[16].tostring(), "GCACGTAGCTGGTAA")
00207         self.assertEqual(record.motifs[6].instances[17].tostring(), "GCTCGTCTATGGTCA")
00208         self.assertEqual(record.motifs[6].instances[18].tostring(), "GCGCATGCTGGATCC")
00209         self.assertEqual(record.motifs[6].instances[19].tostring(), "GGCCGTCAGCTCTCA")
00210         self.assertEqual(record.motifs[6].mask, [1,1,0,1,1,1,1,0,1,0,1,0,0,1,1])
00211         self.assertAlmostEqual(record.motifs[6].score, 13.3145)
00212         self.assertEqual(record.motifs[7].alphabet, IUPAC.unambiguous_dna)
00213         self.assertEqual(len(record.motifs[7].instances), 20)
00214         self.assertEqual(record.motifs[7].instances[0].tostring(), "GAACCGAGGTCCGGTACGGGC")
00215         self.assertEqual(record.motifs[7].instances[1].tostring(), "GCCCCCCGCATAGTAGGGGGA")
00216         self.assertEqual(record.motifs[7].instances[2].tostring(), "GTCCCTGGGTAAGCTTGGGGC")
00217         self.assertEqual(record.motifs[7].instances[3].tostring(), "ACTCCACGCTTCGACACGTGG")
00218         self.assertEqual(record.motifs[7].instances[4].tostring(), "ATCCTCTGCGTCGCATGGCGG")
00219         self.assertEqual(record.motifs[7].instances[5].tostring(), "GTTCAATGCTAAGCTCTGTGC")
00220         self.assertEqual(record.motifs[7].instances[6].tostring(), "GCTCATAGGGACGTCGCGGAG")
00221         self.assertEqual(record.motifs[7].instances[7].tostring(), "GTCCCGGGCCAATAGCGGCGC")
00222         self.assertEqual(record.motifs[7].instances[8].tostring(), "GCACTTAGCAGCGTATCGTTA")
00223         self.assertEqual(record.motifs[7].instances[9].tostring(), "GGCCCTCGGATCGCTTGGGAA")
00224         self.assertEqual(record.motifs[7].instances[10].tostring(), "CTGCTGGACAACGGGCCGAGC")
00225         self.assertEqual(record.motifs[7].instances[11].tostring(), "GGGCACTACATAGAGAGTTGC")
00226         self.assertEqual(record.motifs[7].instances[12].tostring(), "AGCCTCCAGGTCGCATGGAGA")
00227         self.assertEqual(record.motifs[7].instances[13].tostring(), "AATCGTAGATCAGAGGCGAGA")
00228         self.assertEqual(record.motifs[7].instances[14].tostring(), "GAACTCCACTAAGACTTGAGA")
00229         self.assertEqual(record.motifs[7].instances[15].tostring(), "GAGCAGCGATCAGCTTGTGGG")
00230         self.assertEqual(record.motifs[7].instances[16].tostring(), "GCCAGGTACAAAGCGTCGTGC")
00231         self.assertEqual(record.motifs[7].instances[17].tostring(), "AGTCAATGACACGCGCCTGGG")
00232         self.assertEqual(record.motifs[7].instances[18].tostring(), "GGTCATGGAATCTTATGTAGC")
00233         self.assertEqual(record.motifs[7].instances[19].tostring(), "GTAGATAACAGAGGTCGGGGG")
00234         self.assertEqual(record.motifs[7].mask, [1,0,0,1,0,0,0,1,1,0,0,1,1,0,0,0,1,1,0,1,1])
00235         self.assertAlmostEqual(record.motifs[7].score, 11.6098)
00236         self.assertEqual(record.motifs[8].alphabet, IUPAC.unambiguous_dna)
00237         self.assertEqual(len(record.motifs[8].instances), 14)
00238         self.assertEqual(record.motifs[8].instances[0].tostring(), "CCGAGTAAAGGGCTG")
00239         self.assertEqual(record.motifs[8].instances[1].tostring(), "GTGGTCATCGGGCAC")
00240         self.assertEqual(record.motifs[8].instances[2].tostring(), "GATAACAGAGGTCGG")
00241         self.assertEqual(record.motifs[8].instances[3].tostring(), "CGGCGCCGGAGTCTG")
00242         self.assertEqual(record.motifs[8].instances[4].tostring(), "GCGCGTCCCGGGCCA")
00243         self.assertEqual(record.motifs[8].instances[5].tostring(), "CTGGACAACGGGCCG")
00244         self.assertEqual(record.motifs[8].instances[6].tostring(), "CGGATACTGGGGCAG")
00245         self.assertEqual(record.motifs[8].instances[7].tostring(), "GGGAGCAGCGATCAG")
00246         self.assertEqual(record.motifs[8].instances[8].tostring(), "CAGAACCGAGGTCCG")
00247         self.assertEqual(record.motifs[8].instances[9].tostring(), "GGGTCCCTGGGTAAG")
00248         self.assertEqual(record.motifs[8].instances[10].tostring(), "GTGCTCATAGGGACG")
00249         self.assertEqual(record.motifs[8].instances[11].tostring(), "GAGATCCGGAGGAGG")
00250         self.assertEqual(record.motifs[8].instances[12].tostring(), "GCGATCCGAGGGCCG")
00251         self.assertEqual(record.motifs[8].instances[13].tostring(), "GAGTTCACATGGCTG")
00252         self.assertEqual(record.motifs[8].mask, [1,0,1,0,0,1,1,0,1,1,1,1,1,0,1])
00253         self.assertAlmostEqual(record.motifs[8].score, 11.2943)
00254         self.assertEqual(record.motifs[9].alphabet, IUPAC.unambiguous_dna)
00255         self.assertEqual(len(record.motifs[9].instances), 18)
00256         self.assertEqual(record.motifs[9].instances[0].tostring(), "TAGAGGCGGTG")
00257         self.assertEqual(record.motifs[9].instances[1].tostring(), "GCTAAGCTCTG")
00258         self.assertEqual(record.motifs[9].instances[2].tostring(), "TGGAAGCAGTG")
00259         self.assertEqual(record.motifs[9].instances[3].tostring(), "GCGAGGCTGTG")
00260         self.assertEqual(record.motifs[9].instances[4].tostring(), "ACGACGCTTTG")
00261         self.assertEqual(record.motifs[9].instances[5].tostring(), "GGGACGCGCAC")
00262         self.assertEqual(record.motifs[9].instances[6].tostring(), "TCGAAGCGTGG")
00263         self.assertEqual(record.motifs[9].instances[7].tostring(), "TGTATGCGGGG")
00264         self.assertEqual(record.motifs[9].instances[8].tostring(), "GGTAAGCTTGG")
00265         self.assertEqual(record.motifs[9].instances[9].tostring(), "TGTACGCTGGG")
00266         self.assertEqual(record.motifs[9].instances[10].tostring(), "ACTATGCGGGG")
00267         self.assertEqual(record.motifs[9].instances[11].tostring(), "GGTATGCGCTG")
00268         self.assertEqual(record.motifs[9].instances[12].tostring(), "GGTACCCGGAG")
00269         self.assertEqual(record.motifs[9].instances[13].tostring(), "GCGACGCAGAG")
00270         self.assertEqual(record.motifs[9].instances[14].tostring(), "TGGCGGCGTGG")
00271         self.assertEqual(record.motifs[9].instances[15].tostring(), "TCTAGGCGGGC")
00272         self.assertEqual(record.motifs[9].instances[16].tostring(), "AGTATGCTTAG")
00273         self.assertEqual(record.motifs[9].instances[17].tostring(), "TGGAGGCTTAG")
00274         self.assertEqual(record.motifs[9].mask, [1,1,1,1,0,1,1,1,1,1,1])
00275         self.assertAlmostEqual(record.motifs[9].score, 9.7924)
00276         self.assertEqual(record.motifs[10].alphabet, IUPAC.unambiguous_dna)
00277         self.assertEqual(len(record.motifs[10].instances), 13)
00278         self.assertEqual(record.motifs[10].instances[0].tostring(), "GCACAGAGCTTAGCATTGAAC")
00279         self.assertEqual(record.motifs[10].instances[1].tostring(), "GTCCGCGGATTCCCAACATGC")
00280         self.assertEqual(record.motifs[10].instances[2].tostring(), "ATACACAGCCTCGCAAGCCAG")
00281         self.assertEqual(record.motifs[10].instances[3].tostring(), "GGCCCGGGACGCGCACTAAGA")
00282         self.assertEqual(record.motifs[10].instances[4].tostring(), "GCCCGTTGTCCAGCAGACGGC")
00283         self.assertEqual(record.motifs[10].instances[5].tostring(), "GAGCAGCGATCAGCTTGTGGG")
00284         self.assertEqual(record.motifs[10].instances[6].tostring(), "GAACCGAGGTCCGGTACGGGC")
00285         self.assertEqual(record.motifs[10].instances[7].tostring(), "GTCCCTGGGTAAGCTTGGGGC")
00286         self.assertEqual(record.motifs[10].instances[8].tostring(), "GACCTGCCCCCCGCATAGTAG")
00287         self.assertEqual(record.motifs[10].instances[9].tostring(), "AACCAGCGCATACCTTAACAG")
00288         self.assertEqual(record.motifs[10].instances[10].tostring(), "ATCCTCTGCGTCGCATGGCGG")
00289         self.assertEqual(record.motifs[10].instances[11].tostring(), "GACCATAGACGAGCATCAAAG")
00290         self.assertEqual(record.motifs[10].instances[12].tostring(), "GGCCCTCGGATCGCTTGGGAA")
00291         self.assertEqual(record.motifs[10].mask, [1,0,1,1,0,0,0,1,0,0,0,1,1,1,1,0,0,0,0,1,1])
00292         self.assertAlmostEqual(record.motifs[10].score, 9.01393)
00293         self.assertEqual(record.motifs[11].alphabet, IUPAC.unambiguous_dna)
00294         self.assertEqual(len(record.motifs[11].instances), 16)
00295         self.assertEqual(record.motifs[11].instances[0].tostring(), "GCCGTCCGTC")
00296         self.assertEqual(record.motifs[11].instances[1].tostring(), "GGCGTGCGCG")
00297         self.assertEqual(record.motifs[11].instances[2].tostring(), "GGCGCGTGTC")
00298         self.assertEqual(record.motifs[11].instances[3].tostring(), "AGCGCGTGTG")
00299         self.assertEqual(record.motifs[11].instances[4].tostring(), "GCGGTGCGTG")
00300         self.assertEqual(record.motifs[11].instances[5].tostring(), "AGCGCGTGTC")
00301         self.assertEqual(record.motifs[11].instances[6].tostring(), "AGCGTCCGCG")
00302         self.assertEqual(record.motifs[11].instances[7].tostring(), "ACCGTCTGTG")
00303         self.assertEqual(record.motifs[11].instances[8].tostring(), "GCCATGCGAC")
00304         self.assertEqual(record.motifs[11].instances[9].tostring(), "ACCACCCGTC")
00305         self.assertEqual(record.motifs[11].instances[10].tostring(), "GGCGCCGGAG")
00306         self.assertEqual(record.motifs[11].instances[11].tostring(), "ACCACGTGTC")
00307         self.assertEqual(record.motifs[11].instances[12].tostring(), "GGCTTGCGAG")
00308         self.assertEqual(record.motifs[11].instances[13].tostring(), "GCGATCCGAG")
00309         self.assertEqual(record.motifs[11].instances[14].tostring(), "AGTGCGCGTC")
00310         self.assertEqual(record.motifs[11].instances[15].tostring(), "AGTGCCCGAG")
00311         self.assertEqual(record.motifs[11].mask, [1,1,1,1,1,1,1,1,1,1])
00312         self.assertAlmostEqual(record.motifs[11].score, 7.51121)
00313         self.assertEqual(record.motifs[12].alphabet, IUPAC.unambiguous_dna)
00314         self.assertEqual(len(record.motifs[12].instances), 16)
00315         self.assertEqual(record.motifs[12].instances[0].tostring(), "GCCGACGGGTGGTCATCGGG")
00316         self.assertEqual(record.motifs[12].instances[1].tostring(), "GCACGACGCTTTGTACCTGG")
00317         self.assertEqual(record.motifs[12].instances[2].tostring(), "CCTGGGAGGGTTCAATAACG")
00318         self.assertEqual(record.motifs[12].instances[3].tostring(), "GCGCGTCCCGGGCCAATAGC")
00319         self.assertEqual(record.motifs[12].instances[4].tostring(), "GCCGTCTGCTGGACAACGGG")
00320         self.assertEqual(record.motifs[12].instances[5].tostring(), "GTCCCTTCCGGTACATGAGG")
00321         self.assertEqual(record.motifs[12].instances[6].tostring(), "GCTGCTCCCCGCATACAGCG")
00322         self.assertEqual(record.motifs[12].instances[7].tostring(), "GCCCCAAGCTTACCCAGGGA")
00323         self.assertEqual(record.motifs[12].instances[8].tostring(), "ACCGGCTGACGCTAATACGG")
00324         self.assertEqual(record.motifs[12].instances[9].tostring(), "GCGGGGGGCAGGTCATTACA")
00325         self.assertEqual(record.motifs[12].instances[10].tostring(), "GCTGGCAGCGTCTAAGAAGG")
00326         self.assertEqual(record.motifs[12].instances[11].tostring(), "GCAGGTGGTCGTGCAATACG")
00327         self.assertEqual(record.motifs[12].instances[12].tostring(), "GCTGGTTGAAGTCCCGTGCG")
00328         self.assertEqual(record.motifs[12].instances[13].tostring(), "GCACGTAGCTGGTAAATAGG")
00329         self.assertEqual(record.motifs[12].instances[14].tostring(), "GCGGCGTGGATTTCATACAG")
00330         self.assertEqual(record.motifs[12].instances[15].tostring(), "CCTGGAGGCTTAGACTTGGG")
00331         self.assertEqual(record.motifs[12].mask, [1,1,0,1,1,0,0,1,1,0,1,0,0,0,1,0,0,0,1,1])
00332         self.assertAlmostEqual(record.motifs[12].score, 5.63667)
00333         self.assertEqual(record.motifs[13].alphabet, IUPAC.unambiguous_dna)
00334         self.assertEqual(len(record.motifs[13].instances), 15)
00335         self.assertEqual(record.motifs[13].instances[0].tostring(), "GCCGACGGGTGGTCATCGGG")
00336         self.assertEqual(record.motifs[13].instances[1].tostring(), "ATCCGCGGACGCTTAGAGGG")
00337         self.assertEqual(record.motifs[13].instances[2].tostring(), "ACGCTTTGTACCTGGCTTGC")
00338         self.assertEqual(record.motifs[13].instances[3].tostring(), "ACGGACGGCACTTAGCAGCG")
00339         self.assertEqual(record.motifs[13].instances[4].tostring(), "GCCGTCTGCTGGACAACGGG")
00340         self.assertEqual(record.motifs[13].instances[5].tostring(), "ACACACAGACGGTTGAAAGG")
00341         self.assertEqual(record.motifs[13].instances[6].tostring(), "GCCGATAGTGCTTAAGTTCG")
00342         self.assertEqual(record.motifs[13].instances[7].tostring(), "CTTGCCCGTACCGGACCTCG")
00343         self.assertEqual(record.motifs[13].instances[8].tostring(), "ACCGGCTGACGCTAATACGG")
00344         self.assertEqual(record.motifs[13].instances[9].tostring(), "GCCCCCCGCATAGTAGGGGG")
00345         self.assertEqual(record.motifs[13].instances[10].tostring(), "GCTGGCAGCGTCTAAGAAGG")
00346         self.assertEqual(record.motifs[13].instances[11].tostring(), "GCAGGTGGTCGTGCAATACG")
00347         self.assertEqual(record.motifs[13].instances[12].tostring(), "ACGCACGGGACTTCAACCAG")
00348         self.assertEqual(record.motifs[13].instances[13].tostring(), "GCACGTAGCTGGTAAATAGG")
00349         self.assertEqual(record.motifs[13].instances[14].tostring(), "ATCCTCTGCGTCGCATGGCG")
00350         self.assertEqual(record.motifs[13].mask, [1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,0,1,1])
00351         self.assertAlmostEqual(record.motifs[13].score, 3.89842)
00352         self.assertEqual(record.motifs[14].alphabet, IUPAC.unambiguous_dna)
00353         self.assertEqual(len(record.motifs[14].instances), 14)
00354         self.assertEqual(record.motifs[14].instances[0].tostring(), "GAGGCTGTGTAT")
00355         self.assertEqual(record.motifs[14].instances[1].tostring(), "GAGGTCGGGGGT")
00356         self.assertEqual(record.motifs[14].instances[2].tostring(), "GACGGACGGCAC")
00357         self.assertEqual(record.motifs[14].instances[3].tostring(), "TTGGCCCGGGAC")
00358         self.assertEqual(record.motifs[14].instances[4].tostring(), "GAGGCTCGGCCC")
00359         self.assertEqual(record.motifs[14].instances[5].tostring(), "CACGCGCTGTAT")
00360         self.assertEqual(record.motifs[14].instances[6].tostring(), "TAGGCCAGGTAT")
00361         self.assertEqual(record.motifs[14].instances[7].tostring(), "GAGGTCCGGTAC")
00362         self.assertEqual(record.motifs[14].instances[8].tostring(), "TACGCTGGGGAT")
00363         self.assertEqual(record.motifs[14].instances[9].tostring(), "GTCGCGGAGGAT")
00364         self.assertEqual(record.motifs[14].instances[10].tostring(), "TACGCACGGGAC")
00365         self.assertEqual(record.motifs[14].instances[11].tostring(), "TACTCCGGGTAC")
00366         self.assertEqual(record.motifs[14].instances[12].tostring(), "GACGCAGAGGAT")
00367         self.assertEqual(record.motifs[14].instances[13].tostring(), "TAGGCGGGCCAT")
00368         self.assertEqual(record.motifs[14].mask, [1,1,1,1,1,0,1,1,1,0,1,1])
00369         self.assertAlmostEqual(record.motifs[14].score, 3.33444)
00370         self.assertEqual(record.motifs[15].alphabet, IUPAC.unambiguous_dna)
00371         self.assertEqual(len(record.motifs[15].instances), 21)
00372         self.assertEqual(record.motifs[15].instances[0].tostring(), "CGGCTCAATCGTAGAGGC")
00373         self.assertEqual(record.motifs[15].instances[1].tostring(), "CGACGGGTGGTCATCGGG")
00374         self.assertEqual(record.motifs[15].instances[2].tostring(), "CGCTTAGAGGGCACAAGC")
00375         self.assertEqual(record.motifs[15].instances[3].tostring(), "TGACACGCGCCTGGGAGG")
00376         self.assertEqual(record.motifs[15].instances[4].tostring(), "CGATACGCTGCTAAGTGC")
00377         self.assertEqual(record.motifs[15].instances[5].tostring(), "CGTCCCGGGCCAATAGCG")
00378         self.assertEqual(record.motifs[15].instances[6].tostring(), "CCACGCTTCGACACGTGG")
00379         self.assertEqual(record.motifs[15].instances[7].tostring(), "CGTCTGCTGGACAACGGG")
00380         self.assertEqual(record.motifs[15].instances[8].tostring(), "ACACAGACGGTTGAAAGG")
00381         self.assertEqual(record.motifs[15].instances[9].tostring(), "TGCTCCCCGCATACAGCG")
00382         self.assertEqual(record.motifs[15].instances[10].tostring(), "TGAGGCTTGCCCGTACCG")
00383         self.assertEqual(record.motifs[15].instances[11].tostring(), "TGCCCCAAGCTTACCCAG")
00384         self.assertEqual(record.motifs[15].instances[12].tostring(), "CGGCTGACGCTAATACGG")
00385         self.assertEqual(record.motifs[15].instances[13].tostring(), "CGCGACGTCCCTATGAGC")
00386         self.assertEqual(record.motifs[15].instances[14].tostring(), "TGCCCCCCGCATAGTAGG")
00387         self.assertEqual(record.motifs[15].instances[15].tostring(), "CGTTGCCTTCTTAGACGC")
00388         self.assertEqual(record.motifs[15].instances[16].tostring(), "TGACTCAATCGTAGACCC")
00389         self.assertEqual(record.motifs[15].instances[17].tostring(), "AGTCCCGTGCGTATGTGG")
00390         self.assertEqual(record.motifs[15].instances[18].tostring(), "AGGCTCGCACGTAGCTGG")
00391         self.assertEqual(record.motifs[15].instances[19].tostring(), "CCACGCCGCCATGCGACG")
00392         self.assertEqual(record.motifs[15].instances[20].tostring(), "AGCCTCCAGGTCGCATGG")
00393         self.assertEqual(record.motifs[15].mask, [1,1,0,1,0,1,0,0,1,1,0,1,1,0,0,0,1,1])
00394         self.assertAlmostEqual(record.motifs[15].score, 1.0395)
 

Here is the call graph for this function:

Ensure that we can write proper FASTA output files.

Definition at line 407 of file test_Motif.py.

00407 
00408     def test_FAoutput(self):
00409         """Ensure that we can write proper FASTA output files.
00410         """
00411         output_handle = open(self.FAout, "w")
00412         output_handle.write(self.m.format("fasta"))
00413         output_handle.close()

Here is the call graph for this function:

Ensure that we can write proper pfm output files.

Definition at line 421 of file test_Motif.py.

00421 
00422     def test_pfm_output(self):
00423         """Ensure that we can write proper pfm output files.
00424         """
00425         output_handle = open(self.PFMout, "w")
00426         output_handle.write(self.m.format("jaspar-pfm"))
00427         output_handle.close()
00428         
        

Here is the call graph for this function:

Test to be sure that Motif can parse pfm  files.

Definition at line 395 of file test_Motif.py.

00395 
00396     def test_pfm_parsing(self):
00397         """Test to be sure that Motif can parse pfm  files.
00398         """
00399         motif= Motif.read(self.PFMin,"jaspar-pfm")
00400         assert motif.length==12

Test to be sure that Motif can parse sites files.

Definition at line 401 of file test_Motif.py.

00401 
00402     def test_sites_parsing(self):
00403         """Test to be sure that Motif can parse sites files.
00404         """
00405         motif= Motif.read(self.SITESin,"jaspar-sites")
00406         assert motif.length==6

Ensure that we can write proper TransFac output files.

Definition at line 414 of file test_Motif.py.

00414 
00415     def test_TFoutput(self):
00416         """Ensure that we can write proper TransFac output files.
00417         """
00418         output_handle = open(self.TFout, "w")
00419         output_handle.write(self.m.format("transfac"))
00420         output_handle.close()

Here is the call graph for this function:


Member Data Documentation

Definition at line 18 of file test_Motif.py.

Definition at line 20 of file test_Motif.py.

Definition at line 15 of file test_Motif.py.

Definition at line 19 of file test_Motif.py.

Definition at line 16 of file test_Motif.py.

Definition at line 17 of file test_Motif.py.


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