Skip to main content

Pepkio HWE Equilibrium Studio

Call the Pepkio hwe-equilibrium-studio REST API from Python to test multiallelic Hardy-Weinberg equilibrium and run Wright-Fisher allele-frequency simulations.

What It Does

Population genetics QC and teaching workflows need chi-square and exact HWE tests for loci with 2–6 alleles, plus optional Wright-Fisher simulation under selection, drift, mutation, and migration. Rebuilding multinomial expected counts and Guo-Thompson exact tests in a notebook for each locus is slow and error-prone.

This package submits genotype counts, allele frequencies, or biallelic disease incidence to the same Pepkio Tools engine as the hosted HWE Equilibrium Studio web calculator. It returns observed-vs-expected genotypes, chi-square and exact p-values, inbreeding F, plain-language verdicts, simulator trajectories, and shareable run permalinks.

Programmatic runs require a network connection and a Pepkio API key. Calculations are not bundled for offline use.

Features

  • Calculator: genotype_counts, allele_frequencies (expected only), or carrier_incidence (biallelic q² → 2pq)
  • 2–6 alleles with scalable genotype keys (A1_A1, A1_A2, …)
  • Chi-square and Guo-Thompson exact p-values; exact primary when expected counts < 5
  • Inbreeding coefficient F and structured verdict
  • Simulator: selection, drift (Ne), mutation, migration; 1–10000 generations
  • Manifest examples: mn_blood_group, cystic_fibrosis_carrier, triallelic_counts, simulator_fixation, and more
  • CLI: pepkio-hwe-equilibrium-studio manifest and run
  • Configuration via PEPKIO_API_KEY, LOCAL_PEPKIO_API_KEY, and PEPKIO_API_BASE_URL

Installation

pip install pepkio-hwe-equilibrium-studio

Set an API key with tools:run scope before calling run():

export PEPKIO_API_KEY="your-key"

Create a key in your Pepkio account API keys settings.

Quick Example

from pepkio_hwe_equilibrium_studio import PepkioClient

with PepkioClient() as client:
    inp = client.get_example_input("mn_blood_group")
    result = client.run(inp)
    stats = result.result["stats"]
    print(result.permalink)
    print("chi-square p:", stats["chi_square_p"])
    print("verdict:", result.result["verdict"]["title"])

CLI:

pepkio-hwe-equilibrium-studio run --example mn_blood_group

Manifest inspection does not require an API key.

Typical Use Cases

  • HWE test for a microsatellite or multiallelic SNP locus from genotype counts
  • Carrier frequency from disease incidence (e.g. 1 in 2500 recessive incidence)
  • Triallelic or higher-allele contingency tables without hand-built spreadsheets
  • Wright-Fisher drift and selection simulations for teaching
  • Automated reanalysis of genotype tables in notebooks or CI

Scientific Background

Under Hardy-Weinberg equilibrium, expected genotype frequencies follow the multinomial expansion from allele frequencies (biallelic: p² + 2pq + q² = 1). Chi-square goodness-of-fit uses df = k(k+1)/2 − k for k alleles. Guo-Thompson exact tests are preferred when expected counts are sparse. F = 1 − H_obs/H_exp measures inbreeding deviation. The simulator uses a discrete-generation Wright-Fisher model.

Web Application

For researchers who prefer a graphical interface, an interactive HWE Equilibrium Studio is available in the browser.

The web interface adds De Finetti ternary plots (2–3 alleles), bar charts (4+ alleles), observed-vs-expected tables, dynamic equation display, PNG/SVG export, CSV download, copy-ready methods text, animated simulator trajectories, and shareable permalinks.

Documentation and Resources

Source code and issue tracking: github.com/pepkio/pepkio-hwe-equilibrium-studio

Web calculator: pepkio.com/tools/hwe-equilibrium-studio

About Pepkio

Pepkio develops software tools and provides bioinformatics analysis services for life science research. See pepkio.com for additional calculators and analysis services.

Keywords

Hardy-Weinberg equilibrium, HWE test, multiallelic HWE, population genetics, Guo-Thompson exact test, inbreeding coefficient F, Wright-Fisher simulation, carrier frequency 2pq, genotype counts expected, chi-square Hardy-Weinberg, allele frequency drift, effective population size Ne, microsatellite HWE QC, MN blood group HWE, pepkio-hwe-equilibrium-studio, Python HWE API, REST API population genetics, disease incidence carrier risk, triallelic Hardy-Weinberg test, how to test Hardy-Weinberg for three alleles Python, carrier frequency from 1 in 2500 incidence API, multiallelic genotype HWE without R, Wright-Fisher selection drift simulation script, exact test when expected count below 5, automate Hardy-Weinberg notebook Pepkio, share HWE analysis permalink, population genetics teaching Hardy-Weinberg CLI

Metadata

Release files for pepkio-hwe-equilibrium-studio 0.1.0

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

Source distribution (sdist)

Source distribution for pepkio-hwe-equilibrium-studio 0.1.0
File Size Uploaded Provenance
pepkio_hwe_equilibrium_studio-0.1.0.tar.gz 34.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pepkio-hwe-equilibrium-studio 0.1.0
File Interpreter ABI Platform
pepkio_hwe_equilibrium_studio-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.0 kB

Release files / pepkio_hwe_equilibrium_studio-0.1.0.tar.gz

Download URL pepkio_hwe_equilibrium_studio-0.1.0.tar.gz
Size 34.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d1eecaaeb75693b41a305db8332fe8cd48660e6d970bac0a6262d5e3f54d963e
BLAKE2b-256 checksum
How to use checksums
d99bf36465c6817fc08ec9c35233bbdd2adaaa680cdbc33f54861c18ac27e7a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pepkio_hwe_equilibrium_studio-0.1.0-py3-none-any.whl

Download URL pepkio_hwe_equilibrium_studio-0.1.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f0500e0f1bdab4d136668c27bebbabca7c5a93651fb5c8a0b28ee2fb34c89bc
BLAKE2b-256 checksum
How to use checksums
24a271cffdfb5664e91e9f76e697fe48ce9dc8bf985e025406afbe8eb7465669
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pepkio-hwe-equilibrium-studio 0.1.0

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

0.1.0 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