Compute the Tajimas-D, Pi-Estimator or Watterson-Estimator for multiple sequences.
Project description
Compute the Tajima's-D, Pi-Estimator or Watterson-Estimator for multiple sequences.
Tajima's D is a population genetic test statistic that computes the difference between the mean number of pairwise differences and the number of segregating sites. It is used to determine whether a population is expanding or shrinking.
Tajima's D
Tajima's D is defined as follows:
If , there are many rare variants, indicating an expanding population.
Whereas , indicates an declining population as there are many intermediate variants.
A result is consideres significant if or .
Pi-Estimator
The π estimator is the average number of pairwise differences between any two sequences:
Watterson-Estimator
The Watterson estimator is the expected number of segregating sites.
Installation
Using pip / pip3:
pip install tajimas_d
Or by source:
git clone git@github.com:not-a-feature/tajimas_d.git
cd tajimas_d
pip install .
How to use
from tajimas_d import tajimas_d, watterson_estimator, pi_estimator
sequences = ["AAAA", "AAAT", "AAGT", "AAGT"]
theta_tajima = tajimas_d(sequences)
theta_pi = pi_estimator(sequences)
theta_w = watterson_estimator(sequences)
Standalone version
Clone the repository and cd into it. Intall the requirements (miniFasta >= 2.2, for fasta reading).
usage: tajimas-d.py [-h] -f PATH [-p] [-t] [-w]
tajimas-d: Compute the Tajima s-D, Pi-Estimator or Watterson-Estimator for multiple
sequences.
optional arguments:
-h, --help show this help message and exit
-f PATH, --file PATH Path to fasta file with all sequences.
-p, --pi Compute the Pi-Estimator score. (default)
-t, --tajima Compute the Pi-Estimator score.
-w, --watterson Compute the Watterson-Estimator score.
License
Copyright (C) 2022 by Jules Kreuer - @not_a_feature
This piece of software is published unter the GNU General Public License v3.0
TLDR:
| Permissions | Conditions | Limitations |
| ---------------- | ---------------------------- | ----------- |
| ✓ Commercial use | Disclose source | ✕ Liability |
| ✓ Distribution | License and copyright notice | ✕ Warranty |
| ✓ Modification | Same license | |
| ✓ Patent use | State changes | |
| ✓ Private use | | |
Go to LICENSE.md to see the full version.
Dependencies
In addition to packages included in Python 3, this piece of software uses 3rd-party software packages for development purposes that are not required in the published version. Go to DEPENDENCIES.md to see all dependencies and licenses.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for tajimas_d-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02f2657e11d465aae2206355476700637c99f8c3fb21404bd636b5c6db321b12 |
|
MD5 | b1bb5d594502e209aa62d4323899fbf1 |
|
BLAKE2b-256 | c7c57ca3ab8297088103de841e3e60709c0582558da638efa576f1f5a2a8150b |