Skip to main content

A Python interface for PHAST (phylogenetic analysis with space/time models).

Project description

phasty

PyPI version Codacy Badge codecov

A Python interface for PHAST (phylogenetic analysis with space/time models).

Description

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.

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:

pip install phasty

Or install from source after git clone:

cd phasty
pip install -e .

Run tests:

pip install -e .[dev]
python -m pytest --cov=phasty tests/

Uninstall:

pip uninstall phasty

Notes

This package uses Semantic Versioning.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phasty-0.5.3.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

phasty-0.5.3-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page