Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_EmbossPrimer.Primer3ParseTest Class Reference

List of all members.

Public Member Functions

def setUp
def test_simple_parse
def test_indepth_regular_parse
def test_in_depth_single_parse
def test_internal_oligo_single_parse
def test_mutli_record_fwd
def test_mutli_record_full

Public Attributes

 test_files

Detailed Description

Definition at line 13 of file test_EmbossPrimer.py.


Member Function Documentation

Definition at line 14 of file test_EmbossPrimer.py.

00014 
00015     def setUp(self):
00016         self.test_files = \
00017           [os.path.join("Emboss", "bac_find.primer3"),
00018            os.path.join("Emboss", "cds_forward.primer3"),
00019            os.path.join("Emboss", "cds_reverse.primer3"),
00020            os.path.join("Emboss", "short.primer3"),
00021            os.path.join("Emboss", "internal_oligo.primer3"),
00022            ]

Make sure we get info right from a single primer find.

Definition at line 62 of file test_EmbossPrimer.py.

00062 
00063     def test_in_depth_single_parse(self):
00064         """Make sure we get info right from a single primer find.
00065         """
00066         file = self.test_files[1]
00067         h = open(file, "r")
00068         primer_info = Primer3.read(h)
00069         h.close()
00070 
00071         self.assertEqual(len(primer_info.primers), 5)
00072         self.assertEqual(primer_info.comments,
00073                          "# PRIMER3 RESULTS FOR 26964-28647#\n")
00074         self.assertEqual(primer_info.primers[1].reverse_seq, "")
00075         self.assertEqual(primer_info.primers[1].internal_seq, "")
00076         self.assertEqual(primer_info.primers[3].forward_seq, "TGTGATTGCTTGAGCTGGAC")
00077         self.assertEqual(primer_info.primers[3].internal_seq, "")
00078         self.assertEqual(primer_info.primers[3].forward_start, 253)

Here is the call graph for this function:

Make sure we get the data from normal primer3 files okay.

Definition at line 36 of file test_EmbossPrimer.py.

00036 
00037     def test_indepth_regular_parse(self):
00038         """Make sure we get the data from normal primer3 files okay.
00039         """
00040         regular_file = self.test_files[0]
00041         h = open(regular_file, "r")
00042         primer_info = Primer3.read(h)
00043         h.close()
00044 
00045         self.assertEqual(len(primer_info.primers), 5)
00046         self.assertEqual(primer_info.comments,
00047                          "# PRIMER3 RESULTS FOR AC074298\n")
00048         self.assertEqual(primer_info.primers[1].forward_seq,
00049                          "CCGGTTTCTCTGGTTGAAAA")
00050         self.assertEqual(primer_info.primers[2].reverse_seq,
00051                          "TCACATTCCCAAATGTAGATCG")
00052         self.assertEqual(primer_info.primers[0].size, 218)
00053         self.assertEqual(len(primer_info.primers[0]), 218)
00054         self.assertEqual(primer_info.primers[3].forward_start, 112)
00055         self.assertEqual(primer_info.primers[3].forward_length, 20)
00056         self.assertEqual(primer_info.primers[3].forward_tm, 59.57)
00057         self.assertEqual(primer_info.primers[3].forward_gc, 45.00)
00058         self.assertEqual(primer_info.primers[4].reverse_start, 304)
00059         self.assertEqual(primer_info.primers[4].reverse_length, 22)
00060         self.assertEqual(primer_info.primers[4].reverse_tm, 59.61)
00061         self.assertEqual(primer_info.primers[4].reverse_gc, 40.91)

Here is the call graph for this function:

Make sure we can parse an internal oligo file correctly 

Definition at line 79 of file test_EmbossPrimer.py.

00079 
00080     def test_internal_oligo_single_parse(self):
00081         ''' Make sure we can parse an internal oligo file correctly '''
00082         # these files are generated when designing hybridization probes.
00083         file = self.test_files[4]
00084         h = open(file, "r")
00085         primer_info = Primer3.read(h)
00086         h.close()
00087 
00088         self.assertEqual(len(primer_info.primers), 5)
00089         self.assertEqual(primer_info.comments,
00090                          "# EPRIMER3 RESULTS FOR YNL138W-A\n")
00091         self.assertEqual(primer_info.primers[0].internal_length, 22)
00092         self.assertEqual(primer_info.primers[1].internal_seq,
00093                          'TTGCGCTTTAGTTTGAATTGAA')
00094         self.assertEqual(primer_info.primers[2].internal_tm, 58.62)
00095         self.assertEqual(primer_info.primers[3].internal_start, 16)
00096         self.assertEqual(primer_info.primers[4].internal_gc, 35.00)

Here is the call graph for this function:

Test parsing multiple primer sets (NirK full)

Definition at line 141 of file test_EmbossPrimer.py.

00141 
00142     def test_mutli_record_full(self):
00143         """Test parsing multiple primer sets (NirK full)"""
00144         h = open(os.path.join("Emboss", "NirK_full.primer3"))
00145         targets = list(Primer3.parse(h))
00146         h.close()
00147 
00148         self.assertEqual(len(targets), 16)
00149         for target in targets:
00150             self.assertEqual(len(target.primers), 5)
00151 
00152         self.assertEqual(targets[15].primers[0].forward_seq,
00153                          "ACTCACTTCGGCTGAATGCT")
00154         self.assertEqual(targets[15].primers[1].forward_seq,
00155                          "GGCGATTAGCGCTGTCTATC")
00156         self.assertEqual(targets[15].primers[2].forward_seq,
00157                          "ACTCACTTCGGCTGAATGCT")
00158         self.assertEqual(targets[15].primers[3].forward_seq,
00159                          "TAGGCGTATAGACCGGGTTG")
00160         self.assertEqual(targets[15].primers[4].forward_seq,
00161                          "AGCAAGCTGACCACTGGTTT")
00162 
00163         self.assertEqual(targets[15].primers[0].reverse_seq,
00164                          "CATTTAATCCGGATGCCAAC")
00165         self.assertEqual(targets[15].primers[1].reverse_seq,
00166                          "TGGCCTTTCTCTCCTCTTCA")
00167         self.assertEqual(targets[15].primers[2].reverse_seq,
00168                          "ATTTAATCCGGATGCCAACA")
00169         self.assertEqual(targets[15].primers[3].reverse_seq,
00170                          "CACACATTATTGGCGGTCAC")
00171         self.assertEqual(targets[15].primers[4].reverse_seq,
00172                          "TCTGAAACCACCAAGGAAGC")
00173 
00174         self.assertEqual(targets[15].primers[0].internal_seq,
00175                          "CCCACCAATATTTGGCTAGC")
00176         self.assertEqual(targets[15].primers[1].internal_seq,
00177                          "AATCTTCTGTGCACCTTGCC")
00178         self.assertEqual(targets[15].primers[2].internal_seq,
00179                          "CCCACCAATATTTGGCTAGC")
00180         self.assertEqual(targets[15].primers[3].internal_seq,
00181                          "TGAGCCTGTGTTCCACACAT")
00182         self.assertEqual(targets[15].primers[4].internal_seq,
00183                          "CTATGCCCTTCTGCCACAAT")
00184 

Here is the call graph for this function:

Test parsing multiple primer sets (NirK forward)

Definition at line 97 of file test_EmbossPrimer.py.

00097 
00098     def test_mutli_record_fwd(self):
00099         """Test parsing multiple primer sets (NirK forward)"""
00100         h = open(os.path.join("Emboss", "NirK.primer3"))
00101         targets = list(Primer3.parse(h))
00102         h.close()
00103 
00104         self.assertEqual(len(targets), 16)
00105         for target in targets:
00106             self.assertEqual(len(target.primers), 5)
00107 
00108         self.assertEqual(targets[0].primers[0].forward_seq,
00109                          "GCAAACTGAAAAGCGGACTC")
00110         self.assertEqual(targets[0].primers[1].forward_seq,
00111                          "GGGACGTACTTTCGCACAAT")
00112         self.assertEqual(targets[0].primers[2].forward_seq,
00113                          "GTCTTATGCGTGGTGGAGGT")
00114         self.assertEqual(targets[0].primers[3].forward_seq,
00115                          "GTACATCAACATCCGCAACG")
00116         self.assertEqual(targets[0].primers[4].forward_seq,
00117                          "CGTACATCAACATCCGCAAC")
00118 
00119         self.assertEqual(targets[1].primers[0].forward_seq,
00120                          "GGAAGTGCTTCTCGTTTTCG")
00121         self.assertEqual(targets[1].primers[1].forward_seq,
00122                          "TACAGAGCGTCACGGATGAG")
00123         self.assertEqual(targets[1].primers[2].forward_seq,
00124                          "TTGTCATCGTGCTCTTCGTC")
00125         self.assertEqual(targets[1].primers[3].forward_seq,
00126                          "GACTCCAACCTCAGCTTTCG")
00127         self.assertEqual(targets[1].primers[4].forward_seq,
00128                          "GGCACGAAGAAGGACAGAAG")
00129 
00130         self.assertEqual(targets[15].primers[0].forward_seq,
00131                          "TGCTTGAAAATGACGCACTC")
00132         self.assertEqual(targets[15].primers[1].forward_seq,
00133                          "CTCGCTGGCTAGGTCATAGG")
00134         self.assertEqual(targets[15].primers[2].forward_seq,
00135                          "TATCGCACCAAACACGGTAA")
00136         self.assertEqual(targets[15].primers[3].forward_seq,
00137                          "CGATTACCCTCACCGTCACT")
00138         self.assertEqual(targets[15].primers[4].forward_seq,
00139                          "TATCGCAACCACTGAGCAAG")
00140 

Here is the call graph for this function:

Make sure that we can use all single target primer3 files.

Definition at line 23 of file test_EmbossPrimer.py.

00023 
00024     def test_simple_parse(self):
00025         """Make sure that we can use all single target primer3 files.
00026         """
00027         for file in self.test_files:
00028             # First using read...
00029             h = open(file, "r")
00030             Primer3.read(h)
00031             h.close()
00032             # Now using parse...
00033             h = open(file, "r")
00034             self.assertEqual(1, len(list(Primer3.parse(h))))
00035             h.close()

Here is the call graph for this function:


Member Data Documentation

Definition at line 15 of file test_EmbossPrimer.py.


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