Bio.Phylo.PAML.baseml module

Classes for the support of BASEML.

Maximum likelihood analysis of nucleotide sequences.

exception Bio.Phylo.PAML.baseml.BasemlError

Bases: OSError

BASEML failed. Run with verbose=True to view BASEML’s error message.

class Bio.Phylo.PAML.baseml.Baseml(alignment=None, tree=None, working_dir=None, out_file=None)

Bases: Paml

An interface to BASEML, part of the PAML package.

__init__(alignment=None, tree=None, working_dir=None, out_file=None)

Initialize the Baseml instance.

The user may optionally pass in strings specifying the locations of the input alignment and tree files, the working directory and the final output file.

write_ctl_file()

Dynamically build a BASEML control file from the options.

The control file is written to the location specified by the ctl_file property of the Baseml class.

read_ctl_file(ctl_file)

Parse a control file and load the options into the Baseml instance.

Update each BASEML option to the new option if supplied or None if not supplied. Raise an exception if the control file does not exist, a line is malformed, or an option is invalid.

run(ctl_file=None, verbose=False, command='baseml', parse=True)

Run baseml using the current configuration.

Check that the tree file is specified and exists, and then run baseml. If parse is True then read and return the results, otherwise return None. An exception is raised if the return code of the baseml command is non-zero.

The arguments may be passed as either absolute or relative paths, despite the fact that baseml requires relative paths.

Bio.Phylo.PAML.baseml.read(results_file)

Parse a BASEML results file.

Parse the file and return the results. Raise an exception if the results file does not exist, is empty, or is invalid.