https://github.com/zsailer/pyasr
Ancestral Sequence Reconstruction in Python
https://github.com/zsailer/pyasr
evolution pandas phylogenetics python
Last synced: 6 months ago
JSON representation
Ancestral Sequence Reconstruction in Python
- Host: GitHub
- URL: https://github.com/zsailer/pyasr
- Owner: Zsailer
- License: bsd-3-clause
- Created: 2017-10-26T15:59:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-09T15:30:20.000Z (almost 7 years ago)
- Last Synced: 2025-03-04T18:02:41.811Z (about 1 year ago)
- Topics: evolution, pandas, phylogenetics, python
- Language: Python
- Size: 678 KB
- Stars: 13
- Watchers: 1
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyASR
**Ancestral Sequence Reconstruction in Python**
PyASR offers a modern Python interface to [PAML](http://abacus.gene.ucl.ac.uk/software/paml.html) ("Phylogenetic Analysis by Maximum Likelihood")--tuned specifically for reconstruction
ancestral protein/DNA sequences.
**NOTE:** PyASR currently only supports protein reconstructions. This is a work in progress.
## Basic Usage
```python
import phylopandas as pd
import dendropy as d
import pyasr
# Use phylopandas to read a set of ancestor.s
df_seqs = pd.read_fasta('test.fasta')
# Use dendropy to read in tree.
tree = d.Tree.get(path='tree.newick', schema='newick')
# Reconstruct nodes in tree.
tree, df_seqs, df_anc = pyasr.reconstruct(df_seqs, tree, working_dir='test', alpha=1.235)
# Write out ancestor dataframe to a CSV file.
df_anc.to_csv('ancestors.csv')
```
We can visualize the ancestors side-by-side with the tree using inside of JupyterLab
thanks to the ToyTree library.

## Install
This package is released on PyPi. You can install using pip:
```
pip install pyasr
```
To get the development version:
```
git clone
cd
pip install -e .
```
## Dependencies
The actual reconstruction calculation are done using [PAML](http://abacus.gene.ucl.ac.uk/software/paml.html). This requires PAML to be
installed and the `codeml`/`baseml` executables exported to your `$PATH` environment variable. Directions for installing PAML can be found on the PAML website.
The following Python dependencies are required for PyASR to work.
- Pandas
- Biopython
- PhyloPandas
- DendroPy