https://github.com/yuanx749/phasty
A Python interface for PHAST (phylogenetic analysis with space/time models).
https://github.com/yuanx749/phasty
package phylogenetics tool
Last synced: over 1 year ago
JSON representation
A Python interface for PHAST (phylogenetic analysis with space/time models).
- Host: GitHub
- URL: https://github.com/yuanx749/phasty
- Owner: yuanx749
- License: bsd-3-clause
- Created: 2023-04-09T10:38:38.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-14T16:05:28.000Z (over 2 years ago)
- Last Synced: 2025-02-23T06:11:31.485Z (over 1 year ago)
- Topics: package, phylogenetics, tool
- Language: Python
- Homepage: https://yuanx749.github.io/phasty/
- Size: 16.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# phasty
[](https://badge.fury.io/py/phasty)
[](https://app.codacy.com/gh/yuanx749/phasty/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://codecov.io/gh/yuanx749/phasty)
A Python interface for PHAST (phylogenetic analysis with space/time models).
## Description
[PHAST](http://compgen.cshl.edu/phast/) is a package consisting of command-line programs for comparative genomics. It supports several nucleotide substitution models. This package phasty provides Python wrappers for some major programs so that it is easier to integrate them into complicated workflows. It can also parse some files from plain text to more computer-friendly forms to help downstream analysis.
## Usage
The design idea of phasty is to be robust and compatible with version changes of PHAST. Therefore, the signatures of functions are written in a general way. Please refer to the corresponding websites for detailed usage of specific options.
### Example
Assume `hmrc.fa` exists in the current directory. After running `phylo_fit` and reading the .mod file, the content is stored in a list of objects holding attributes with proper data types. Each object represents a fitted model.
```Python
from phasty import phylo_fit, parse_mod
output = phylo_fit(
"hmrc.fa",
tree="((human,(mouse,rat)),cow)",
subst_mod="U2S",
EM=True,
precision="MED",
non_overlapping=True,
out_root="hmrc-u2s",
)
mod_lst = parse_mod("hmrc-u2s.mod")
print(mod_lst[0].rate_mat)
```
## Installation
Download and install PHAST first.
Install from PyPI:
```bash
pip install phasty
```
Or install from source after git clone:
```bash
cd phasty
pip install -e .
```
Run tests:
```bash
pip install -e .[dev]
python -m pytest --cov=phasty tests/
```
Uninstall:
```bash
pip uninstall phasty
```
## Notes
This package uses [Semantic Versioning](https://semver.org/).