Skip to main content

ADAMIXTURE logo

Fast Biobank-Scale Population Genetics Clustering

Python Version PyPI Version License Status Downloads


ADAMIXTURE is a fast CPU/GPU implementation of ADMIXTURE for biobank-scale genetic clustering. .P and .Q outputs remain compatible with ADMIXTURE.

System requirements

Hardware & Platform compatibility

ADAMIXTURE runs cross-platform on Linux, macOS, and Windows, supporting CPU computation as well as GPU acceleration on NVIDIA GPUs (CUDA) and Apple Silicon (MPS).

Software requirements

We recommend creating a fresh Python 3.10+ virtual environment. For a faster installation experience, we highly recommend using uv.

As an example, using uv (recommended):

$ uv venv --python 3.10
$ source .venv/bin/activate
$ uv pip install adamixture

Installation Guide

The package can be installed using pip:

Basic Installation (CPU default)

Uses the pre-compiled C/Cython wheel and does not install PyTorch:

$ pip install adamixture

GPU Installation (NVIDIA CUDA / Apple Silicon MPS)

Includes PyTorch and Ninja for hardware-accelerated execution:

$ pip install "adamixture[gpu]"

The commands above use the binary wheel when one is available for the Python version and platform. Installing directly from a source checkout (for example, with pip install -e .) requires a local C/Cython build toolchain.

Running ADAMIXTURE

To train a model, simply invoke the following commands from the root directory of the project. For more info about all the arguments, please run adamixture --help. Note that BED, VCF, PGEN and BCF are supported.

Supported input files include:

  • PLINK BED: .bed, .bed.gz, .bed.zst, with .bim/.fam sidecars that may also be plain, .gz or .zst.
  • PLINK PGEN: .pgen or .pgen.zst, with .pvar/.psam sidecars that may be plain, .gz or .zst.
  • VCF: .vcf, .vcf.gz and .vcf.zst.
  • BCF: .bcf, .bcf.gz and .bcf.zst.

As an example, the following ADMIXTURE call

$ ./admixture snps_data.bed 8 -s 42

would be equivalent in ADAMIXTURE by running

$ adamixture -k 8 --data_path snps_data.bed --save_dir SAVE_PATH --name snps_data -s 42

By default, the following files will be output to the SAVE_PATH directory (the name parameter will be used to create the full filenames):

  • A .P file, similar to ADMIXTURE.
  • A .Q file, similar to ADMIXTURE.
  • A .png plot file containing the visualization of the inferred ancestry proportions (Q matrix).

Logs are printed to the stdout channel by default. If you want to save them to a file, you can use the command tee along with a pipe:

$ adamixture -k 8 ... | tee run.log

Running with multi-threading

To run ADAMIXTURE using multiple CPU threads, use the -t flag:

$ adamixture -k 8 --data_path data.bed --save_dir out/ --name test -t 8

Running with GPU acceleration

To leverage GPU acceleration (highly recommended for large datasets), use the --device flag:

  • NVIDIA GPU (CUDA):
    $ adamixture -k 8 --data_path data.bed --save_dir out/ --name test --device gpu
    
  • macOS Apple Silicon (MPS):
    $ adamixture -k 8 --data_path data.bed --save_dir out/ --name test --device mps
    

For a step-by-step guide on how to run a complete analysis workflow, see the 1000 Genomes Tutorial.

Multi-K Sweep

Instead of running ADAMIXTURE for a single K, you can automatically sweep over a range of K values using --min_k and --max_k. The data is loaded once, and each K is trained sequentially. K=1 is the no-structure null model and is a valid start for a sweep or a CV baseline:

$ adamixture --min_k 1 --max_k 10 --data_path snps_data.bed --save_dir SAVE_PATH --name snps_sweep

Cross-validation

Use --cv to estimate the optimal K by masking a fraction of genotype entries and measuring prediction error. → Full documentation

$ adamixture -k 8 --cv --data_path data.bed --save_dir out/ --name test

Plotting

By default, ADAMIXTURE automatically generates a png plot at 300 DPI without needing any additional flags. Following the method of Clumppling, it automatically aligns clusters across runs and K values. → Full documentation

Plots can include hierarchical population labels if you provide the arguments (--labels, --labels2, --labels3).

If you want to customize the format and resolution (e.g., to generate a PDF), use --plot (or --plot_single for individual per-K plots in multi-K sweeps):

  • Single K runs (-k): Use --plot.

    $ adamixture -k 8 --data_path data.bed --save_dir out/ --name test --plot pdf 300
    
  • Multi-K sweeps (--min_k and --max_k): Use --plot to configure the combined sweep plot (or --plot_single for individual plots per K).

    $ adamixture --min_k 2 --max_k 10 --data_path data.bed --save_dir out/ --name test --plot pdf 300
    

Projection Mode

Estimate ancestry proportions for new samples using a pre-trained, fixed P matrix (Q-only optimisation). K is detected automatically from P. → Full documentation

$ adamixture-project \
    --data_path new_samples.bed \
    --p_path trained_model/results.8.P \
    --save_dir projection_out/ \
    --name projected

Supervised Mode

Anchor the model with known population labels for a subset of samples while estimating Q freely for unlabeled ones. Labels use the same format as --labels (population name or -). → Full documentation

$ adamixture-supervised \
    --data_path all_samples.bed \
    --labels labels.txt \
    --save_dir supervised_out/ \
    --name supervised_run

K is the number of distinct population names in the labels file, so -k is not passed.

Other options

All hyperparameters and flags can be explored with:

$ adamixture --help

The help groups the options by purpose (required arguments, number of populations, general, input filtering, optimization, initialization and plotting).

Key arguments:

Argument                                          Default Description
--algorithm brqn Solver: SQP + ZAL quasi-Newton (brqn) or Adam-EM (adamem).
--init svd Initialization: SVD+ALS (svd) or random EM priming (random). For a given K the likelihood is highly multimodal, with one majority mode and minority modes for different population substructure; with multiple seeds, svd repeats the optimal mode and random explores the others.
--tol 0.1 BR-QN convergence tolerance on the log-likelihood change. Adam-EM uses --tol_adam (default 0.1).
--max_iter 10000 Maximum solver iterations (BR-QN or Adam-EM).
--patience 3 Iterations without log-likelihood improvement before stopping.
-t 1 Number of CPU threads.
-s 42 Random seed.
--device cpu Device to use: cpu, gpu, or mps.
--chunk_size 8192 Number of SNPs in chunk operations.
--n_inits 3 Number of initializations: ALS starts on the same SVD (or random EM primings with --init random); keeps the one with best log-likelihood.
--chrom_mode all Chromosome filter: all keeps every chromosome; autosomes keeps autosomes 1 to --autosomes.
--autosomes 22 Number of autosomes kept when --chrom_mode autosomes (equivalent to --specific_chrom 1 2 ... 22).
--specific_chrom None List of specific chromosomes to analyze when --chrom_mode autosomes (overrides --autosomes).
--no_freqs False Do not save the .P allele-frequency matrix.

Algorithm note

The ADAMIXTURE paper introduced Adam-EM as an adaptive first-order optimizer for admixture inference. The package still includes this solver via --algorithm adamem.

In the current implementation, the default is --algorithm brqn. Empirical benchmarking showed that block relaxation with ZAL quasi-Newton acceleration, when paired with our improved SVD+ALS initialization, reaches high-quality solutions in fewer iterations and better wall-clock time. For that reason, BR-QN is the default solver, while Adam-EM remains available for experimentation and reproducibility. Adam-EM tuning parameters are documented in Troubleshooting and Tips.

Troubleshooting and Tips

Common issues and platform notes:

  • macOS: Install libomp via Homebrew (brew install libomp) before compiling.
  • Windows: Pre-compiled wheels are provided on PyPI (pip install adamixture). If compiling from source (pip install -e .), install Build Tools for Visual Studio with Desktop development with C++.
  • CUDA: Set CUDA_HOME or install nvcc via Conda (conda install -c nvidia nvcc).
  • Adam-EM options: only relevant with --algorithm adamem, so they are hidden from --help; list them with adamixture --help-adam (or adamixture-supervised --help-adam).

→ Full documentation

License

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

Cite

When using this software, please cite the following paper:

@article{saurina2026adamixture,
  title={ADAMIXTURE: adaptive first-order optimization for biobank-scale genetic clustering},
  author={Saurina-i-Ricos, Joan and Mas Montserrat, Daniel and Ioannidis, Alexander G.},
  journal={Bioinformatics},
  volume={42},
  number={Supplement\_1},
  pages={btag236},
  year={2026},
  doi={10.1093/bioinformatics/btag236},
  url={https://doi.org/10.1093/bioinformatics/btag236}
}

Metadata

Release files for adamixture 1.9.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 adamixture 1.9.0
File Size Uploaded Provenance Actions
adamixture-1.9.0.tar.gz 23.3 MB Without provenance Details for adamixture-1.9.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for adamixture 1.9.0
File Actions
adamixture-1.9.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for adamixture-1.9.0-cp312-cp312-win_amd64.whl
adamixture-1.9.0-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for adamixture-1.9.0-cp312-cp312-manylinux_2_28_x86_64.whl
adamixture-1.9.0-cp312-cp312-macosx_14_0_x86_64.whl CPython 3.12 CPython 3.12 macOS 14.0+ x86-64 Details for adamixture-1.9.0-cp312-cp312-macosx_14_0_x86_64.whl
adamixture-1.9.0-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details for adamixture-1.9.0-cp312-cp312-macosx_14_0_arm64.whl
adamixture-1.9.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for adamixture-1.9.0-cp311-cp311-win_amd64.whl
adamixture-1.9.0-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for adamixture-1.9.0-cp311-cp311-manylinux_2_28_x86_64.whl
adamixture-1.9.0-cp311-cp311-macosx_14_0_x86_64.whl CPython 3.11 CPython 3.11 macOS 14.0+ x86-64 Details for adamixture-1.9.0-cp311-cp311-macosx_14_0_x86_64.whl
adamixture-1.9.0-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details for adamixture-1.9.0-cp311-cp311-macosx_14_0_arm64.whl
adamixture-1.9.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for adamixture-1.9.0-cp310-cp310-win_amd64.whl
adamixture-1.9.0-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for adamixture-1.9.0-cp310-cp310-manylinux_2_28_x86_64.whl
adamixture-1.9.0-cp310-cp310-macosx_14_0_x86_64.whl CPython 3.10 CPython 3.10 macOS 14.0+ x86-64 Details for adamixture-1.9.0-cp310-cp310-macosx_14_0_x86_64.whl
adamixture-1.9.0-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details for adamixture-1.9.0-cp310-cp310-macosx_14_0_arm64.whl

Total release size: 186.7 MB

Release files / adamixture-1.9.0.tar.gz

Download URL adamixture-1.9.0.tar.gz
Size 23.3 MB
Tags Source
SHA-256 checksum
How to use checksums
93968ed5d57a0a1836680835a25fa710aaeb5b00e6e6522eb75451fd1694f8fa
BLAKE2b-256 checksum
How to use checksums
2a43b341c3b6cb8b47ec8e244d6431286a8feea2b019a4f2d0d9f3d94a43ab9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / adamixture-1.9.0-cp312-cp312-win_amd64.whl

Download URL adamixture-1.9.0-cp312-cp312-win_amd64.whl
Size 13.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
9b4a0fa5e0b04d8ac61cb443e10391dc8389a10fa8e13e11d30546fa0d367b4d
BLAKE2b-256 checksum
How to use checksums
07e25e9b3d26a9749a771b06d7fcb569c4d50046b268b30fa096d5e61c8e9d1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / adamixture-1.9.0-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL adamixture-1.9.0-cp312-cp312-manylinux_2_28_x86_64.whl
Size 14.3 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
bce144bd76855b46946510df3014e4a7ff11b7ed8cfa25df72f63bcf2a6bef72
BLAKE2b-256 checksum
How to use checksums
229e10159dadba170bc41f5b5ab0aab008056ab38ee372d1c02d40cf4850cccc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / adamixture-1.9.0-cp312-cp312-macosx_14_0_x86_64.whl

Download URL adamixture-1.9.0-cp312-cp312-macosx_14_0_x86_64.whl
Size 13.9 MB
Tags CPython 3.12 macOS 14.0+ x86-64
SHA-256 checksum
How to use checksums
40b5b34099c4ac1711ff936f065fa52e9458e6c030ef20cfa3c660064b411cca
BLAKE2b-256 checksum
How to use checksums
17564393d6b6d178477f613d9a37a462bb455fc4df50940c67aa7f9c4d26ccde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / adamixture-1.9.0-cp312-cp312-macosx_14_0_arm64.whl

Download URL adamixture-1.9.0-cp312-cp312-macosx_14_0_arm64.whl
Size 12.7 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
d3d222e61026a6225639151ffd0040e9130f733b4d40b69a0cba1f9fdfad370c
BLAKE2b-256 checksum
How to use checksums
22fd909012b442acc0d687a04157176836dc97cebd59b9ba6129addb2ffbe58d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / adamixture-1.9.0-cp311-cp311-win_amd64.whl

Download URL adamixture-1.9.0-cp311-cp311-win_amd64.whl
Size 13.6 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
674af5cff0d1f9df400f6b1a520065f8cbbc27149390d56e4134d9b6f5596738
BLAKE2b-256 checksum
How to use checksums
dd160c65beab58924118e648bdbe46b4a7dfd8925a4ac70f6afc8eee1d871dfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / adamixture-1.9.0-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL adamixture-1.9.0-cp311-cp311-manylinux_2_28_x86_64.whl
Size 14.3 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
09963b5ef024dbab84425bad7d01029d7ccc0507a0bb783c6c432d2d7ddf4d5e
BLAKE2b-256 checksum
How to use checksums
4898e4536107615cc4ea457e44e41f00d322c5cafe64bb76e9cf066f6d422503
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / adamixture-1.9.0-cp311-cp311-macosx_14_0_x86_64.whl

Download URL adamixture-1.9.0-cp311-cp311-macosx_14_0_x86_64.whl
Size 13.8 MB
Tags CPython 3.11 macOS 14.0+ x86-64
SHA-256 checksum
How to use checksums
a2d5f2a6b3e434e5d6222b8d4555e6a9bdea1a1e6ac2397bbe44589c57b4b720
BLAKE2b-256 checksum
How to use checksums
8c5e0a2133b27c934e412da847fcc1880a5a2ceddad05800f76a9b5302bcc68a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / adamixture-1.9.0-cp311-cp311-macosx_14_0_arm64.whl

Download URL adamixture-1.9.0-cp311-cp311-macosx_14_0_arm64.whl
Size 12.7 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
5b0cfe308b652e53030c1ac8582a146f195766dc16d24298f9232c620b6b1d0a
BLAKE2b-256 checksum
How to use checksums
86a7233f63a3f9f8cfc665cbbbb21a7e6970198d88993551d83f7510cdbe0364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / adamixture-1.9.0-cp310-cp310-win_amd64.whl

Download URL adamixture-1.9.0-cp310-cp310-win_amd64.whl
Size 13.6 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
6c5cdffe66f461af50eb12672c123a6d0c2f8f9dbe40406e0a14158d4ead9ee9
BLAKE2b-256 checksum
How to use checksums
740609a64acd316f23d85a8725cfc0893098fcef33956fc1c1f4d7f263550f7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / adamixture-1.9.0-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL adamixture-1.9.0-cp310-cp310-manylinux_2_28_x86_64.whl
Size 14.4 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
61142c252666cc78df34fd086dd175146d261e6f0331e6fd87c46bfccc667fce
BLAKE2b-256 checksum
How to use checksums
c7db52ade7def8c15d891beb8f25a5ce538baac5207c53d9f93620507deb7c05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / adamixture-1.9.0-cp310-cp310-macosx_14_0_x86_64.whl

Download URL adamixture-1.9.0-cp310-cp310-macosx_14_0_x86_64.whl
Size 13.8 MB
Tags CPython 3.10 macOS 14.0+ x86-64
SHA-256 checksum
How to use checksums
299c32af21ce388d4c548de0e6f078bc8e149776c9a297bd168b2d92e3477ed9
BLAKE2b-256 checksum
How to use checksums
9c48cd6894aa4b832f4d49a2e33757a819701bfbf88fc1aad6fce183ae80d543
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / adamixture-1.9.0-cp310-cp310-macosx_14_0_arm64.whl

Download URL adamixture-1.9.0-cp310-cp310-macosx_14_0_arm64.whl
Size 12.7 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
149a587e8ff98249baac04787be79111a8a37747be605ca41f904045f47274ad
BLAKE2b-256 checksum
How to use checksums
a186f32f6363c21b03561fffcdd8230b62350a271f10050b3edd65089a0433cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for adamixture 1.9.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

1.9.0 This release

13 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