admixture
A Python wrapper around OpenADMIXTURE.jl
admixture provides a Python interface for running OpenADMIXTURE.jl on binary PLINK datasets and parsing the results into Python objects.
Important
This package is not the original OpenADMIXTURE implementation and does not reimplement the algorithm. It is a subprocess-based wrapper around the upstream Julia package from the OpenMendel project.
What the wrapper does
- validates a binary PLINK
.bed/.bim/.famprefix; - locates Julia or accepts an explicit Julia executable path;
- checks whether
OpenADMIXTURE.jlimports in the chosen Julia environment; - runs a packaged Julia bridge script via
subprocess.run(..., shell=False); - parses
.Q,.P, and.logoutputs; - returns an
OpenAdmixtureResultwithpandas.DataFrameresults.
Minimal example
from admixture import OpenAdmixtureRunner
runner = OpenAdmixtureRunner()
result = runner.run(
bfile="data/example",
k=3,
out_prefix="results/example_k3",
seed=42,
threads=4,
)
print(result.q)Upstream resources
- OpenADMIXTURE.jl: https://github.com/OpenMendel/OpenADMIXTURE.jl
- OpenMendel: https://openmendel.github.io/
- OpenADMIXTURE paper: https://pmc.ncbi.nlm.nih.gov/articles/PMC9943729/