Back to index

python-biopython  1.60
Functions | Variables
gen_results Namespace Reference

Functions

def codeml
def baseml
def yn00

Variables

list VERSIONS = ["4_1", "4_3", "4_4", "4_4c", "4_5"]
 VERBOSE = True

Function Documentation

Definition at line 41 of file gen_results.py.

00041 
00042 def baseml():
00043     from Bio.Phylo.PAML import baseml
00044     
00045     tests = [("model", range(0, 9)), ("nhomo", [1, 3, 4]),
00046             ("nparK", range(1, 5)), ("alpha1rho1", None), ("SE", None)]
00047     alignment = os.path.join("Alignments", "alignment.phylip")
00048     tree = os.path.join("Trees", "species.tree")
00049     for test in tests:
00050         print test[0]
00051         bml = baseml.Baseml()
00052         for version in VERSIONS:
00053             print "\t{0}".format(version.replace('_', '.'))
00054             if test[1] is not None:
00055                 for n in test[1]:
00056                     if (version in ["4_3", "4_4", "4_4c", "4_5"] and 
00057                             test[0] == "nparK" and n in [3, 4]):
00058                         continue
00059                     print "\t\tn = {0}".format(n)
00060                     ctl_file = os.path.join("Control_files", "baseml", 
00061                         "{0}{1}.ctl".format(test[0], n))                   
00062                     bml.read_ctl_file(ctl_file)
00063                     bml.alignment = alignment
00064                     bml.tree = tree                
00065                     out_file = "{0}{1}-{2}.out".format(test[0], n, version)  
00066                     bml.out_file = os.path.join("Results", "baseml", test[0],
00067                         out_file)
00068                     bin = "baseml{0}".format(version)
00069                     bml.run(command=bin, verbose=VERBOSE)               
00070             else:
00071                 if (version in ["4_3", "4_4", "4_4c", "4_5"] and
00072                         test[0] == "alpha1rho1"):
00073                     continue
00074                 ctl_file = os.path.join("Control_files", "baseml",
00075                     "{0}.ctl".format(test[0]))
00076                 bml.read_ctl_file(ctl_file)
00077                 bml.alignment = alignment
00078                 bml.tree = tree                                  
00079                 out_file = "{0}-{1}.out".format(test[0], version)
00080                 bml.out_file = os.path.join("Results", "baseml", test[0],
00081                     out_file)
00082                 bin = "baseml{0}".format(version)
00083                 bml.run(command=bin, verbose=VERBOSE)

Here is the caller graph for this function:

Definition at line 8 of file gen_results.py.

00008 
00009 def codeml():
00010     from Bio.Phylo.PAML import codeml
00011     tests = [("aa_model0", "aa_alignment.phylip", "species.tree"),
00012             ("aa_pairwise", "aa_alignment.phylip", "species.tree"),
00013             ("all_NSsites", "alignment.phylip", "species.tree"),
00014             ("branchsiteA", "alignment.phylip", "species.tree"),
00015             ("clademodelC", "alignment.phylip", "species.tree"),
00016             ("freeratio", "alignment.phylip", "species.tree"),
00017             ("ngene2_mgene012", "lysinYangSwanson2002.nuc", "lysin.trees"),
00018             ("ngene2_mgene34", "lysinYangSwanson2002.nuc", "lysin.trees"),
00019             ("pairwise", "alignment.phylip", "species.tree"),
00020             ("SE", "alignment.phylip", "species.tree")]
00021 
00022     for test in tests:
00023         print test[0]
00024         cml = codeml.Codeml()
00025         cml.working_dir = "temp"
00026         ctl_file = os.path.join("Control_files",
00027                                 "codeml", 
00028                                 '.'.join([test[0], "ctl"]))
00029         alignment = os.path.join("Alignments", test[1])
00030         tree = os.path.join("Trees", test[2])                   
00031         cml.read_ctl_file(ctl_file)
00032         cml.alignment = alignment
00033         cml.tree = tree
00034         for version in VERSIONS:
00035             print "\t{0}".format(version.replace('_', '.'))
00036             out_file = '.'.join(['-'.join([test[0], version]), "out"])
00037             cml.out_file = os.path.join("Results", "codeml", test[0], out_file)
00038             bin = ''.join(["codeml", version])
00039             cml.run(command=bin, verbose=VERBOSE)
00040          

Here is the caller graph for this function:

Definition at line 84 of file gen_results.py.

00084 
00085 def yn00():
00086     from Bio.Phylo.PAML import yn00
00087     
00088     tests = ["yn00"]
00089     alignment = os.path.join("Alignments", "alignment.phylip")
00090     for test in tests:
00091         print test[0]
00092         yn = yn00.Yn00()
00093         for version in VERSIONS:
00094             print "\t{0}".format(version.replace('_', '.'))
00095             ctl_file = os.path.join("Control_files", "yn00",
00096                 "{0}.ctl".format(test))
00097             yn.read_ctl_file(ctl_file)
00098             yn.alignment = alignment
00099             out_file = "{0}-{1}.out".format(test, version)
00100             yn.out_file = os.path.join("Results", "yn00", out_file)
00101             bin = "yn00{0}".format(version)
00102             yn.run(command=bin, verbose=VERBOSE)

Here is the call graph for this function:


Variable Documentation

Definition at line 6 of file gen_results.py.

list gen_results.VERSIONS = ["4_1", "4_3", "4_4", "4_4c", "4_5"]

Definition at line 5 of file gen_results.py.