Back to index

python-biopython  1.60
Public Member Functions | Public Attributes | Static Public Attributes
test_PAML_codeml.ModTest Class Reference

List of all members.

Public Member Functions

def tearDown
def setUp
def testAlignmentFileIsValid
def testAlignmentExists
def testTreeFileValid
def testTreeExists
def testWorkingDirValid
def testOutputFileValid
def testOptionExists
def testAlignmentSpecified
def testTreeSpecified
def testOutputFileSpecified
def testPamlErrorsCaught
def testCtlFileValidOnRun
def testCtlFileExistsOnRun
def testCtlFileValidOnRead
def testCtlFileExistsOnRead
def testResultsValid
def testResultsExist
def testResultsParsable
def testParseSEs
def testParseAllNSsites
def testParseNSsite3
def testParseBranchSiteA
def testParseCladeModelC
def testParseNgene2Mgene02
def testParseNgene2Mgene1
def testParseNgene2Mgene34
def testParseFreeRatio
def testParsePairwise
def testParseAA
def testParseAAPairwise

Public Attributes

 cml

Static Public Attributes

tuple align_dir = os.path.join("PAML", "Alignments")
tuple tree_dir = os.path.join("PAML", "Trees")
tuple ctl_dir = os.path.join("PAML", "Control_files")
tuple results_dir = os.path.join("PAML", "Results")
tuple working_dir = os.path.join("PAML", "codeml_test")
tuple align_file = os.path.join(align_dir, "alignment.phylip")
tuple tree_file = os.path.join(tree_dir, "species.tree")
tuple bad_tree_file = os.path.join(tree_dir, "bad.tree")
tuple out_file = os.path.join(results_dir, "test.out")
tuple results_file = os.path.join(results_dir, "bad_results.out")
tuple bad_ctl_file1 = os.path.join(ctl_dir, "bad1.ctl")
tuple bad_ctl_file2 = os.path.join(ctl_dir, "bad2.ctl")
tuple bad_ctl_file3 = os.path.join(ctl_dir, "bad3.ctl")
tuple ctl_file = os.path.join(ctl_dir, "codeml", "codeml.ctl")

Detailed Description

Definition at line 22 of file test_PAML_codeml.py.


Member Function Documentation

Definition at line 53 of file test_PAML_codeml.py.

00053 
00054     def setUp(self):
00055         self.cml = codeml.Codeml()
        
Just in case CODEML creates some junk files, do a clean-up.

Definition at line 40 of file test_PAML_codeml.py.

00040 
00041     def tearDown(self):
00042         """Just in case CODEML creates some junk files, do a clean-up."""
00043         del_files = [self.out_file, "2NG.dN", "2NG.dS", "2NG.t", "codeml.ctl", 
00044                 "lnf", "rst", "rst1", "rub"]
00045         for filename in del_files:
00046             if os.path.exists(filename):
00047                 os.remove(filename)
00048         if os.path.exists(self.working_dir):
00049             for filename in os.listdir(self.working_dir):
00050                 filepath = os.path.join(self.working_dir, filename)
00051                 os.remove(filepath)
00052             os.rmdir(self.working_dir)
    

Definition at line 65 of file test_PAML_codeml.py.

00065 
00066     def testAlignmentExists(self):
00067         self.assertRaises((EnvironmentError, IOError), codeml.Codeml, 
00068             alignment = "nonexistent")
00069         self.cml.alignment = "nonexistent"
00070         self.cml.tree = self.tree_file
00071         self.cml.out_file = self.out_file
00072         self.assertRaises(IOError, self.cml.run)
    

Definition at line 56 of file test_PAML_codeml.py.

00056 
00057     def testAlignmentFileIsValid(self):
00058         self.assertRaises((AttributeError, TypeError),
00059             codeml.Codeml, alignment = 1)
00060         self.cml.alignment = 1
00061         self.cml.tree = self.tree_file
00062         self.cml.out_file = self.out_file
00063         self.assertRaises((AttributeError, TypeError),
00064             self.cml.run)
        

Definition at line 111 of file test_PAML_codeml.py.

00111 
00112     def testAlignmentSpecified(self):
00113         self.cml.tree = self.tree_file
00114         self.cml.out_file = self.out_file
00115         self.assertRaises((AttributeError, ValueError),
00116             self.cml.run)
        

Definition at line 195 of file test_PAML_codeml.py.

00195 
00196     def testCtlFileExistsOnRead(self):
00197         self.assertRaises((EnvironmentError, IOError),
00198             self.cml.read_ctl_file, ctl_file = "nonexistent")
        

Definition at line 143 of file test_PAML_codeml.py.

00143 
00144     def testCtlFileExistsOnRun(self):
00145         self.cml.alignment = self.align_file
00146         self.cml.tree = self.tree_file
00147         self.cml.out_file = self.out_file
00148         self.assertRaises((EnvironmentError, IOError),
00149             self.cml.run, ctl_file = "nonexistent")
            

Definition at line 150 of file test_PAML_codeml.py.

00150 
00151     def testCtlFileValidOnRead(self):
00152         self.assertRaises((AttributeError, TypeError),
00153             self.cml.read_ctl_file, 1)
00154         self.assertRaises((AttributeError, KeyError), 
00155             self.cml.read_ctl_file, self.bad_ctl_file1)
00156         self.assertRaises(AttributeError, 
00157             self.cml.read_ctl_file, self.bad_ctl_file2)
00158         self.assertRaises(TypeError, 
00159             self.cml.read_ctl_file, self.bad_ctl_file3)
00160         target_options = {"noisy": 0,
00161                         "verbose": 0,
00162                         "runmode": 0,
00163                         "seqtype": 1, 
00164                         "CodonFreq": 2,
00165                         "ndata": None,
00166                         "clock": 0,
00167                         "aaDist": None,
00168                         "aaRatefile": None,
00169                         "model": 0,
00170                         "NSsites": [0],
00171                         "icode": 0,
00172                         "Mgene": 0,
00173                         "fix_kappa": 0,
00174                         "kappa": 4.54006,
00175                         "fix_omega": 0,
00176                         "omega": 1,
00177                         "fix_alpha": 1,
00178                         "alpha": 0,
00179                         "Malpha": 0,
00180                         "ncatG": None,
00181                         "getSE": 0,
00182                         "RateAncestor": 0,
00183                         "Small_Diff": None,
00184                         "cleandata": 1,
00185                         "fix_blength": 1,
00186                         "method": 0,
00187                         "rho": None,
00188                         "fix_rho": None}
00189         self.cml.read_ctl_file(self.ctl_file)
00190         self.assertEqual(sorted(self.cml._options.keys()), sorted(target_options.keys()))
00191         for key in target_options:
00192             self.assertEqual(self.cml._options[key], target_options[key], \
00193                              "%s: %r vs %r" \
00194                              % (key, self.cml._options[key], target_options[key]))
        

Definition at line 136 of file test_PAML_codeml.py.

00136 
00137     def testCtlFileValidOnRun(self):
00138         self.cml.alignment = self.align_file
00139         self.cml.tree = self.tree_file
00140         self.cml.out_file = self.out_file
00141         self.assertRaises((AttributeError, TypeError),
00142             self.cml.run, ctl_file = 1)
        

Definition at line 105 of file test_PAML_codeml.py.

00105 
00106     def testOptionExists(self):
00107         self.assertRaises((AttributeError, KeyError),
00108                           self.cml.set_options, xxxx=1)
00109         self.assertRaises((AttributeError, KeyError),
00110                           self.cml.get_option, "xxxx")
    

Definition at line 123 of file test_PAML_codeml.py.

00123 
00124     def testOutputFileSpecified(self):
00125         self.cml.alignment = self.align_file
00126         self.cml.tree = self.tree_file
00127         self.assertRaises((AttributeError, ValueError),
00128             self.cml.run)
        

Definition at line 98 of file test_PAML_codeml.py.

00098 
00099     def testOutputFileValid(self):
00100         self.cml.tree = self.tree_file
00101         self.cml.alignment = self.align_file
00102         self.cml.out_file = 1
00103         self.assertRaises((AttributeError, TypeError),
00104             self.cml.run)
    

Definition at line 129 of file test_PAML_codeml.py.

00129 
00130     def testPamlErrorsCaught(self):
00131         self.cml.alignment = self.align_file
00132         self.cml.tree = self.bad_tree_file
00133         self.cml.out_file = self.out_file
00134         self.assertRaises((EnvironmentError, PamlError),
00135             self.cml.run)
        

Definition at line 474 of file test_PAML_codeml.py.

00474 
00475     def testParseAA(self):
00476         res_dir = os.path.join(self.results_dir, "codeml", "aa_model0")
00477         for results_file in os.listdir(res_dir):
00478             version = results_file.split('-')[1].split('.')[0]  
00479             version_msg = "Improper parsing for version %s" \
00480                         % version.replace('_', '.')
00481             results_path = os.path.join(res_dir, results_file)
00482             results = codeml.read(results_path)
00483             # Amino Acid analysis has different top-levels:
00484             # 'NSsites', 'model', 'version', 'lnL max', 'distances'
00485             # Version 4.1 doesn't seem to produce distances in the results
00486             if version == "4_1":
00487                 self.assertEqual(len(results), 4, version_msg)
00488                 self.assertTrue("lnL max" in results, version_msg)
00489             else:
00490                 self.assertEqual(len(results), 5, version_msg)
00491                 self.assertTrue("lnL max" in results, version_msg)
00492                 self.assertTrue("distances" in results, version_msg)
00493                 distances = results["distances"]
00494                 # non-pairwise AA analysis only gives raw distances
00495                 self.assertEqual(len(distances), 1, version_msg) 

Definition at line 496 of file test_PAML_codeml.py.

00496 
00497     def testParseAAPairwise(self):
00498         res_dir = os.path.join(self.results_dir, "codeml", "aa_pairwise")
00499         for results_file in os.listdir(res_dir):
00500             version = results_file.split('-')[1].split('.')[0]    
00501             version_msg = "Improper parsing for version %s" \
00502                         % version.replace('_', '.')
00503             results_path = os.path.join(res_dir, results_file)
00504             results = codeml.read(results_path)
00505             # Pairwise AA analysis has one top-level fewer than non-pairwise
00506             self.assertEqual(len(results), 4, version_msg)
00507             self.assertTrue("lnL max" in results, version_msg)
00508             self.assertTrue("distances" in results, version_msg)
00509             distances = results["distances"]
00510             # Pairwise AA analysis has ML & raw distances
00511             self.assertEqual(len(distances), 2, version_msg) 
    

Definition at line 232 of file test_PAML_codeml.py.

00232 
00233     def testParseAllNSsites(self):
00234         res_dir = os.path.join(self.results_dir, "codeml", "all_NSsites")
00235         for results_file in os.listdir(res_dir):
00236             version = results_file.split('-')[1].split('.')[0]
00237             version_msg = "Improper parsing for version %s" \
00238                         % version.replace('_', '.')                    
00239             results_path = os.path.join(res_dir, results_file)
00240             results = codeml.read(results_path)
00241             # There should be 4 top-level items: 'codon model', 'model', 
00242             # 'version', & 'NSsites'
00243             self.assertEqual(len(results), 4, version_msg)
00244             self.assertTrue("NSsites" in results, version_msg)
00245             # There should be 6 NSsites classes: 0, 1, 2, 3, 7 & 8
00246             self.assertEqual(len(results["NSsites"]), 6, version_msg)
00247             # Each site class model should have 5 sub-items: 'lnL', 'tree', 
00248             # 'description', 'parameters', & 'tree length'. It should
00249             # have the correct number of parameters also.
00250             for model_num in [0, 1, 2, 3, 7, 8]:
00251                 model = results["NSsites"][model_num]
00252                 self.assertEqual(len(model), 5, version_msg)
00253                 self.assertTrue("parameters" in model, version_msg)
00254                 params = model["parameters"]
00255                 self.assertEqual(len(params), SITECLASS_PARAMS[model_num],
00256                     version)
00257                 self.assertTrue("branches" in params, version_msg)
00258                 branches = params["branches"]
00259                 # There are 7 branches in the test case (specific to these
00260                 # test cases)
00261                 self.assertEqual(len(branches), 7, version_msg)
00262                 if "site classes" in params:
00263                     self.assertEqual(len(params["site classes"]),
00264                                  SITECLASSES[model_num], version_msg)

Definition at line 296 of file test_PAML_codeml.py.

00296 
00297     def testParseBranchSiteA(self):
00298         res_dir = os.path.join(self.results_dir, "codeml", "branchsiteA")
00299         for results_file in os.listdir(res_dir):
00300             version = results_file.split('-')[1].split('.')[0]    
00301             version_msg = "Improper parsing for version %s" \
00302                         % version.replace('_', '.')                
00303             results_path = os.path.join(res_dir, results_file)
00304             results = codeml.read(results_path)
00305             # There are 5 top-level items in this case:
00306             # 'codon model', 'model', 'version', 'NSsites' & 'site-class model'
00307             self.assertEqual(len(results), 5, version_msg)
00308             self.assertTrue("NSsites" in results, version_msg)
00309             models = results["NSsites"]
00310             # Only site class model 2 is simulated for Branch Site A
00311             self.assertEqual(len(models), 1, version_msg)
00312             self.assertTrue(2 in models, version_msg)
00313             model = models[2]
00314             self.assertEqual(len(model), 5, version_msg)
00315             self.assertTrue("parameters" in model, version_msg)
00316             params = model["parameters"]
00317             # Branch Site A results lack a "branches" parameter     
00318             self.assertEqual(len(params), SITECLASS_PARAMS[2]-1, version_msg)
00319             self.assertTrue("site classes" in params, version_msg)
00320             site_classes = params["site classes"]
00321             # Branch Site A adds another site class
00322             self.assertEqual(len(site_classes), SITECLASSES[2]+1,
00323                 version)        
00324             for class_num in [0, 1, 2, 3]:
00325                 self.assertTrue(class_num in site_classes, version_msg)
00326                 site_class = site_classes[class_num]
00327                 self.assertEqual(len(site_class), 2, version_msg)
00328                 self.assertTrue("branch types" in site_class, version_msg)
00329                 branches = site_class["branch types"]
00330                 self.assertEqual(len(branches), 2, version_msg)

Definition at line 331 of file test_PAML_codeml.py.

00331 
00332     def testParseCladeModelC(self):
00333         cladeC_res_dir = os.path.join(self.results_dir, "codeml",
00334             "clademodelC")
00335         for results_file in os.listdir(cladeC_res_dir):
00336             version = results_file.split('-')[1].split('.')[0]
00337             version_msg = "Improper parsing for version %s" \
00338                         % version.replace('_', '.')
00339             results_path = os.path.join(cladeC_res_dir, results_file)
00340             results = codeml.read(results_path)
00341             # 5 top-level items again in this case
00342             self.assertEqual(len(results), 5, version_msg)
00343             self.assertTrue("NSsites" in results, version_msg)
00344             models = results["NSsites"]
00345             # Only site class model 2 is simulated for Clade Model C
00346             self.assertEqual(len(models), 1, version_msg)
00347             self.assertTrue(2 in models, version_msg)
00348             model = models[2]
00349             self.assertEqual(len(model), 5, version_msg)
00350             self.assertTrue("parameters" in model, version_msg)
00351             params = model["parameters"]
00352             # Clade Model C results lack a "branches" parameter     
00353             self.assertEqual(len(params), SITECLASS_PARAMS[2] - 1, version_msg)
00354             self.assertTrue("site classes" in params, version_msg)
00355             site_classes = params["site classes"]
00356             self.assertEqual(len(site_classes), SITECLASSES[2],
00357                 version)        
00358             for class_num in [0, 1, 2]:
00359                 self.assertTrue(class_num in site_classes, version_msg)
00360                 site_class = site_classes[class_num]
00361                 self.assertEqual(len(site_class), 2, version_msg)
00362                 self.assertTrue("branch types" in site_class, version_msg)
00363                 branches = site_class["branch types"]
00364                 self.assertEqual(len(branches), 2, version_msg)

Definition at line 432 of file test_PAML_codeml.py.

00432 
00433     def testParseFreeRatio(self):
00434         res_dir = os.path.join(self.results_dir, "codeml", "freeratio")
00435         for results_file in os.listdir(res_dir):
00436             version = results_file.split('-')[1].split('.')[0]    
00437             version_msg = "Improper parsing for version %s" \
00438                         % version.replace('_', '.')
00439             results_path = os.path.join(res_dir, results_file)
00440             results = codeml.read(results_path)
00441             self.assertEqual(len(results), 4, version_msg)
00442             self.assertTrue("NSsites" in results, version_msg)
00443             models = results["NSsites"]
00444             self.assertEqual(len(models), 1, version_msg)
00445             self.assertTrue(0 in models, version_msg)
00446             model = models[0]
00447             # With the free ratio model, you get 3 extra trees: dN tree,
00448             # dS tree and omega tree
00449             self.assertEqual(len(model), 8, version_msg)
00450             self.assertTrue("parameters" in model, version_msg)
00451             params = model["parameters"]
00452             self.assertEqual(len(params), SITECLASS_PARAMS[0], version_msg)
00453             self.assertTrue("branches" in params, version_msg)
00454             # There should be 7 branches
00455             branches = params["branches"]
00456             self.assertEqual(len(branches), 7, version_msg) 
00457             self.assertTrue("omega" in params, version_msg)
00458             omega = params["omega"]
00459             self.assertEqual(len(omega), 7, version_msg)

Definition at line 365 of file test_PAML_codeml.py.

00365 
00366     def testParseNgene2Mgene02(self):
00367         res_dir = os.path.join(self.results_dir, "codeml", "ngene2_mgene02")
00368         for results_file in os.listdir(res_dir):
00369             version = results_file.split('-')[1].split('.')[0]
00370             version_msg = "Improper parsing for version %s" \
00371                         % version.replace('_', '.')
00372             results_path = os.path.join(res_dir, results_file)
00373             results = codeml.read(results_path)
00374             self.assertEqual(len(results), 4, version_msg)
00375             self.assertTrue("NSsites" in results, version_msg)
00376             models = results["NSsites"]
00377             self.assertEqual(len(models), 1, version_msg)
00378             self.assertTrue(0 in models, version_msg)
00379             model = models[0]
00380             self.assertEqual(len(model), 5, version_msg)
00381             self.assertTrue("parameters" in model, version_msg)
00382             params = model["parameters"]
00383             # This type of model has fewer parameters for model 0
00384             self.assertEqual(len(params), 4, version_msg)
00385             self.assertTrue("rates" in params, version_msg)
00386             rates = params["rates"]
00387             self.assertEqual(len(rates), 2, version_msg)        

Definition at line 388 of file test_PAML_codeml.py.

00388 
00389     def testParseNgene2Mgene1(self):
00390         res_dir = os.path.join(self.results_dir, "codeml", "ngene2_mgene1")
00391         for results_file in os.listdir(res_dir):
00392             version = results_file.split('-')[1].split('.')[0]
00393             version_msg = "Improper parsing for version %s" \
00394                         % version.replace('_', '.')
00395             results_path = os.path.join(res_dir, results_file)
00396             results = codeml.read(results_path)
00397             self.assertEqual(len(results), 4, version_msg)
00398             self.assertTrue("genes" in results, version_msg)
00399             genes = results["genes"]
00400             self.assertEqual(len(genes), 2, version_msg)
00401             model = genes[0]
00402             self.assertEqual(len(model), 5, version_msg)
00403             self.assertTrue("parameters" in model, version_msg)
00404             params = model["parameters"]
00405             self.assertEqual(len(params), SITECLASS_PARAMS[0], version_msg)

Definition at line 406 of file test_PAML_codeml.py.

00406 
00407     def testParseNgene2Mgene34(self):
00408         res_dir = os.path.join(self.results_dir, "codeml", "ngene2_mgene34")
00409         for results_file in os.listdir(res_dir):
00410             version = results_file.split('-')[1].split('.')[0]    
00411             version_msg = "Improper parsing for version %s" \
00412                         % version.replace('_', '.')
00413             results_path = os.path.join(res_dir, results_file)
00414             results = codeml.read(results_path)
00415             self.assertEqual(len(results), 4, version_msg)
00416             self.assertTrue("NSsites" in results, version_msg)
00417             models = results["NSsites"]
00418             self.assertEqual(len(models), 1, version_msg)
00419             self.assertTrue(0 in models, version_msg)
00420             model = models[0]
00421             self.assertEqual(len(model), 5, version_msg)
00422             self.assertTrue("parameters" in model, version_msg)
00423             params = model["parameters"]
00424             # This type of model has fewer parameters for model 0
00425             self.assertEqual(len(params), 3, version_msg)
00426             self.assertTrue("rates" in params, version_msg)
00427             rates = params["rates"]
00428             self.assertEqual(len(rates), 2, version_msg)        
00429             self.assertTrue("genes" in params, version_msg)
00430             genes = params["genes"]
00431             self.assertEqual(len(genes), 2, version_msg)   

Definition at line 265 of file test_PAML_codeml.py.

00265 
00266     def testParseNSsite3(self):
00267         res_dir = os.path.join(self.results_dir, "codeml", "NSsite3")
00268         for results_file in os.listdir(res_dir):
00269             version = results_file.split('-')[1].split('.')[0]
00270             version_msg = "Improper parsing for version %s" \
00271                         % version.replace('_', '.')                    
00272             results_path = os.path.join(res_dir, results_file)
00273             results = codeml.read(results_path)
00274             # There should be 5 top-level items: 'codon model', 'model', 
00275             # 'version', 'NSsites' & site-class model, the last of which
00276             # is only there when only one NSsites class is used
00277             self.assertEqual(len(results), 5, version_msg)
00278             self.assertTrue('site-class model' in results, version_msg)
00279             self.assertEqual(results['site-class model'], 'discrete', 
00280                     version_msg)
00281             self.assertTrue("NSsites" in results, version_msg)
00282             # There should be 1 NSsites classe: 3
00283             self.assertEqual(len(results["NSsites"]), 1, version_msg)
00284             # Each site class model should have 5 sub-items: 'lnL', 'tree', 
00285             # 'description', 'parameters', & 'tree length'. It should
00286             # have the correct number of parameters also.
00287             model = results["NSsites"][3]
00288             self.assertEqual(len(model), 5, version_msg)
00289             self.assertTrue("parameters" in model, version_msg)
00290             params = model["parameters"]
00291             self.assertEqual(len(params), SITECLASS_PARAMS[3],
00292                 version)
00293             self.assertTrue("site classes" in params, version_msg)
00294             site_classes = params["site classes"]
00295             self.assertEqual(len(site_classes), 4, version_msg)
        

Definition at line 460 of file test_PAML_codeml.py.

00460 
00461     def testParsePairwise(self):
00462         res_dir = os.path.join(self.results_dir, "codeml", "pairwise")
00463         for results_file in os.listdir(res_dir):
00464             version = results_file.split('-')[1].split('.')[0] 
00465             version_msg = "Improper parsing for version %s" \
00466                         % version.replace('_', '.')
00467             results_path = os.path.join(res_dir, results_file)
00468             results = codeml.read(results_path)
00469             # Pairwise models have an extra top-level item: pairwise
00470             self.assertEqual(len(results), 5, version_msg)
00471             self.assertTrue("pairwise" in results, version_msg)
00472             pairwise = results["pairwise"]
00473             self.assertEqual(len(pairwise), 5, version_msg) 

Definition at line 210 of file test_PAML_codeml.py.

00210 
00211     def testParseSEs(self):
00212         res_dir = os.path.join(self.results_dir, "codeml", "SE")
00213         for results_file in os.listdir(res_dir):
00214             version = results_file.split('-')[1].split('.')[0]
00215             version_msg = "Improper parsing for version %s" \
00216                         % version.replace('_', '.')
00217             results_path = os.path.join(res_dir, results_file)
00218             results = codeml.read(results_path)
00219             self.assertEqual(len(results), 4, version_msg)
00220             self.assertTrue("NSsites" in results, version_msg)
00221             models = results["NSsites"]
00222             # Only site class model 0 was simulated
00223             self.assertEqual(len(models), 1, version_msg)
00224             self.assertTrue(0 in models, version_msg)
00225             model = models[0]
00226             self.assertEqual(len(model), 5, version_msg)
00227             self.assertTrue("parameters" in model, version_msg)
00228             params = model["parameters"]
00229             # There should be one new item in the parameters, "SEs" 
00230             self.assertEqual(len(params), SITECLASS_PARAMS[0] + 1, version_msg)
00231             self.assertTrue("SEs" in params, version_msg)

Definition at line 203 of file test_PAML_codeml.py.

00203 
00204     def testResultsExist(self):
00205         self.assertRaises((EnvironmentError, IOError),
00206             codeml.read, "nonexistent")
        

Definition at line 207 of file test_PAML_codeml.py.

00207 
00208     def testResultsParsable(self):
00209         self.assertRaises(ValueError, codeml.read, self.results_file)
        

Definition at line 199 of file test_PAML_codeml.py.

00199 
00200     def testResultsValid(self):
00201         self.assertRaises((AttributeError, TypeError),
00202             codeml.read, 1)
    

Definition at line 82 of file test_PAML_codeml.py.

00082 
00083     def testTreeExists(self):
00084         self.assertRaises((EnvironmentError, IOError), codeml.Codeml, 
00085             tree = "nonexistent")
00086         self.cml.alignment = self.align_file
00087         self.cml.tree = "nonexistent"
00088         self.cml.out_file = self.out_file
00089         self.assertRaises(IOError, self.cml.run)
    

Definition at line 73 of file test_PAML_codeml.py.

00073 
00074     def testTreeFileValid(self):
00075         self.assertRaises((AttributeError, TypeError),
00076             codeml.Codeml, tree = 1)
00077         self.cml.alignment = self.align_file
00078         self.cml.tree = 1
00079         self.cml.out_file = self.out_file
00080         self.assertRaises((AttributeError, TypeError),
00081             self.cml.run)
        

Definition at line 117 of file test_PAML_codeml.py.

00117 
00118     def testTreeSpecified(self):
00119         self.cml.alignment = self.align_file
00120         self.cml.out_file = self.out_file
00121         self.assertRaises((AttributeError, ValueError),
00122             self.cml.run)
        

Definition at line 90 of file test_PAML_codeml.py.

00090 
00091     def testWorkingDirValid(self):
00092         self.cml.tree = self.tree_file
00093         self.cml.alignment = self.align_file
00094         self.cml.out_file = self.out_file
00095         self.cml.working_dir = 1
00096         self.assertRaises((AttributeError, TypeError),
00097             self.cml.run)
    

Member Data Documentation

tuple test_PAML_codeml.ModTest.align_dir = os.path.join("PAML", "Alignments") [static]

Definition at line 24 of file test_PAML_codeml.py.

tuple test_PAML_codeml.ModTest.align_file = os.path.join(align_dir, "alignment.phylip") [static]

Definition at line 30 of file test_PAML_codeml.py.

tuple test_PAML_codeml.ModTest.bad_ctl_file1 = os.path.join(ctl_dir, "bad1.ctl") [static]

Definition at line 35 of file test_PAML_codeml.py.

tuple test_PAML_codeml.ModTest.bad_ctl_file2 = os.path.join(ctl_dir, "bad2.ctl") [static]

Definition at line 36 of file test_PAML_codeml.py.

tuple test_PAML_codeml.ModTest.bad_ctl_file3 = os.path.join(ctl_dir, "bad3.ctl") [static]

Definition at line 37 of file test_PAML_codeml.py.

tuple test_PAML_codeml.ModTest.bad_tree_file = os.path.join(tree_dir, "bad.tree") [static]

Definition at line 32 of file test_PAML_codeml.py.

Definition at line 54 of file test_PAML_codeml.py.

tuple test_PAML_codeml.ModTest.ctl_dir = os.path.join("PAML", "Control_files") [static]

Definition at line 26 of file test_PAML_codeml.py.

tuple test_PAML_codeml.ModTest.ctl_file = os.path.join(ctl_dir, "codeml", "codeml.ctl") [static]

Definition at line 38 of file test_PAML_codeml.py.

tuple test_PAML_codeml.ModTest.out_file = os.path.join(results_dir, "test.out") [static]

Definition at line 33 of file test_PAML_codeml.py.

tuple test_PAML_codeml.ModTest.results_dir = os.path.join("PAML", "Results") [static]

Definition at line 27 of file test_PAML_codeml.py.

tuple test_PAML_codeml.ModTest.results_file = os.path.join(results_dir, "bad_results.out") [static]

Definition at line 34 of file test_PAML_codeml.py.

tuple test_PAML_codeml.ModTest.tree_dir = os.path.join("PAML", "Trees") [static]

Definition at line 25 of file test_PAML_codeml.py.

tuple test_PAML_codeml.ModTest.tree_file = os.path.join(tree_dir, "species.tree") [static]

Definition at line 31 of file test_PAML_codeml.py.

tuple test_PAML_codeml.ModTest.working_dir = os.path.join("PAML", "codeml_test") [static]

Definition at line 28 of file test_PAML_codeml.py.


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