Skip to main content

Population Structure Package

A package for performing transformation between fst, coalescence, and migration matrices. The transformation between coalescence and migration is based on Wilkinson-Herbot's equations (2003). The transformation between fst and coalescence is based on the Slatkin's equations (1991).

Install package using pip

pip install population-structure

Example usuage

import population_structure.utils as psu
import numpy as np
m = np.array([[0, 1, 1], 
              [1, 0, 1], 
              [1, 1, 0]]) # A conservative migration matrix
t = psu.m_to_t(m) # The corresponding coalescence matrix according to W.H. (2003)
f = psu.m_to_f(m) # The corresponding fst matrix according to Slatkin (1991)
print(f"{t}\n{f}")
"""
prints:
[[3. 4. 4.]
 [4. 3. 4.]
 [4. 4. 3.]]
[[0.         0.14285714 0.14285714]
 [0.14285714 0.         0.14285714]
 [0.14285714 0.14285714 0.        ]]
"""
f = np.array([[0,0.1,0.2],
              [0.1,0,0.3],
              [0.2,0.3,0]]) # An fst matrix
psu.f_to_t(f) # Generates a possilbe corresponding coalescence matrix
psu.f_to_m(f) # Generate a possible corresponding migration matrix

Metadata

Release files for population-structure 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for population-structure 1.0.1
File Size Uploaded Provenance Actions
population_structure-1.0.1.tar.gz 34.6 kB Without provenance Details for population_structure-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for population-structure 1.0.1
File Interpreter ABI Platform Actions
population_structure-1.0.1-py3-none-any.whl Python 3 none any Details for population_structure-1.0.1-py3-none-any.whl

Total release size: 71.9 kB

Release files / population_structure-1.0.1.tar.gz

Download URL population_structure-1.0.1.tar.gz
Size 34.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0b91a42ff95bd07cf811a21948d0603735c781263ffa7ded3c06369d2c154667
BLAKE2b-256 checksum
How to use checksums
2cde37b8b14a8adda61f832a22a9b21af6a5d6d5a317f3adb8a453147b19c006
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.5

Release files / population_structure-1.0.1-py3-none-any.whl

Download URL population_structure-1.0.1-py3-none-any.whl
Size 37.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ad68c1b2dc90a50c54d9db64e375d3e119e12079d3fc0e74c38fd20ff41b0b8
BLAKE2b-256 checksum
How to use checksums
4003c8744cb586d6de20d82406cfac18b20bf57defdefab2e510fb0a1d538735
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.5

Security for population-structure 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page