Object model defining a sequence alignment (DNA, RNA, protein sequences). Handle input biological sequence alignment files for the purposes of phylogenetic inference. Will read all types of alignment files by utilizing the P4 python phylogenetic library.
Bases: object
Wrap a biological sequence alignment to enable functionality necessary for phylogenetic inference. Makes use of temporary files; requires to be closed once no longer needed.
Instantiate an object intended to wrap an alignment for the purposes of running phylogenetic inference.
| Parameters: | inal – An alignment file path (most formats are accepted). |
|---|
Get a tree in newick format via use of FastTree that serves as an approximation of the maximum likelihood tree for this data.
| Returns: | a Newick or New Hampshire string |
|---|
Get a tree object for an approximation of the maximum likelihood tree for this data using FastTree.
| Returns: | a tree.tree object |
|---|
Get the data type associated with this alignment (e.g., protein).
| Returns: | a string indicating the data type (‘protein’, ‘DNA’) |
|---|
Return the dimensionality of the sequence alignment (how many different types of characters).
| Returns: | an integer |
|---|
Get (and create if not already) a path to a temporary FASTA file. This will be deleted upon closure of the alignment instance.
| Returns: | a string associated with a path in the file system |
|---|
Return the number of sequences that are present in the sequence alignment.
| Returns: | an integer |
|---|
Acquire the ith sequence as a string.
| Parameters: | i (an integer) – an index in the alignment (associated with a sequence) |
|---|---|
| Returns: | a string associated with the sequence |
Return the size of the alignment, or how many characters there are in each respective item in the alignment.
| Returns: | an integer |
|---|
Get the state model associated with this alignment. See model module for more information.
| Returns: | a model.DiscreteStateModel object |
|---|
Bases: pylogeny.alignment.alignment
An alignment object that renames all comprising taxa in order to be able to be written as a strict Phylip file.
Return a Newick string with (original) taxa names that are replaced with the shortened forms as they are defined in this object.
| Parameters: | tr (a string) – a Newick string |
|---|---|
| Returns: | a Newick string with all replaced names |
Get (and create if not already) a path to a temporary Phylip file. This will be deleted upon closure of the alignment instance.
| Returns: | a string associated with a path in the file system |
|---|
Return the actual name for an integer-based sequence name that was reassigned at initialization.
| Parameters: | n (a string) – a shortened taxon name from this object |
|---|---|
| Returns: | a string (replaced with the original taxon name) |
Return current taxa names in the alignment.
| Returns: | a list of shortened taxa names |
|---|