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 8

Other options

All hyperparameters and flags can be explored with:

$ adamixture --help

Key arguments:

Argument                                          Default Description
--init als Initialization method: SVD+ALS (als) or random EM priming (em).
--tol 0.1 Convergence tolerance for log-likelihood changes.
--max_iter 10000 Maximum optimization iterations.
-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 1 Number of independent initializations (keeps run with best log-likelihood).
--chrom_mode autosomes Chromosome filter: autosomes keeps autosomes 1 to --autosomes; all keeps every chromosome.
--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).

→ 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.8.6

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.8.6
File Size Uploaded
adamixture-1.8.6.tar.gz 21.7 MB Details

Built distributions (wheels)

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

Total release size: 170.9 MB

Release files / adamixture-1.8.6.tar.gz

Download URL adamixture-1.8.6.tar.gz
Size 21.7 MB
Tags Source
SHA-256 checksum
How to use checksums
8a50485d579a1ec9e6999e1ae3c59f9dc2bb8a8717152651e7f1fa36490e82ca
BLAKE2b-256 checksum
How to use checksums
8b0864a103600b5fc321e7181e06fee0d0413e911a4675895cdbd1c5c38703d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL adamixture-1.8.6-cp312-cp312-win_amd64.whl
Size 12.2 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
4993260f2e01c25d09af1bf0343ee79a522afe6c5f7e4cef88eec35fe9ad2ed7
BLAKE2b-256 checksum
How to use checksums
036790021efc3b6e51b6e689a527b6cc1af1fcd209618182b1d93be6296ecd3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL adamixture-1.8.6-cp312-cp312-manylinux_2_28_x86_64.whl
Size 12.7 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
fff03e7c21994401421b2b62d2b6dbf5f3182bb99b8dd381e3c98876ae8d64e9
BLAKE2b-256 checksum
How to use checksums
ee5650e54194e1dfe538eeb7d53a51fc985a0cb6a59534e9492f579151b1feb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL adamixture-1.8.6-cp312-cp312-macosx_14_0_x86_64.whl
Size 12.3 MB
Tags CPython 3.12 macOS 14.0+ x86-64
SHA-256 checksum
How to use checksums
03d803e96a12f306eeb9bee995ad6236369592e45624df26565c10c49d09ab47
BLAKE2b-256 checksum
How to use checksums
e4dd9de2a2dc53ffd0980a76bea2c9721d3441c50bf73237ae080fa3f4cb01fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL adamixture-1.8.6-cp312-cp312-macosx_14_0_arm64.whl
Size 12.5 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
57bae36ee497eb577da96222b3c8a9b789874f2e365785001e19a221f90b9952
BLAKE2b-256 checksum
How to use checksums
b4b3fb69f34a64456b0f79fc9acf6b3eef683a97b657374f18e91c6153549de3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL adamixture-1.8.6-cp311-cp311-win_amd64.whl
Size 12.2 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
28a723c4dd14735db2e15cf88fc10a61eee3f830018db06e767ad0e371ba1f7b
BLAKE2b-256 checksum
How to use checksums
fb00878e7fcb6754997dfca5944ed388ec8459b14468ad2da00d62292d40517b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL adamixture-1.8.6-cp311-cp311-manylinux_2_28_x86_64.whl
Size 12.7 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
117dda47526e632d3c67ae880bd834063d63ca7636e762b49c655464dc85b215
BLAKE2b-256 checksum
How to use checksums
cdf114d5eba14a69b21334ebccf051ce240d446e4a47ac12fbb7c3ff5cc07ad8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL adamixture-1.8.6-cp311-cp311-macosx_14_0_x86_64.whl
Size 12.3 MB
Tags CPython 3.11 macOS 14.0+ x86-64
SHA-256 checksum
How to use checksums
84a13d85c2a35bff69d4e5d3f7a6023ca8e1f0ba5a845836db2c2fe7b5c5517a
BLAKE2b-256 checksum
How to use checksums
1b807b3c4dcec80616b83ee82f149ba41b226bbc377035a7baa8e65aa8288f66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL adamixture-1.8.6-cp311-cp311-macosx_14_0_arm64.whl
Size 12.5 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
b64d44109fe4cf97ad122b9d07443413e6d34442b360819c8b8cfe38ebbc218a
BLAKE2b-256 checksum
How to use checksums
5f3b8a7561d6adcceb6d0b0610fde436a463390888aab9050290a442f5dd0677
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL adamixture-1.8.6-cp310-cp310-win_amd64.whl
Size 12.2 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
0489090fb0723f5659fab260ad26ac0cccf9d5f15d5c269828c467e4bc90ea83
BLAKE2b-256 checksum
How to use checksums
7445d340a0f245e70718417ea31ec5132f144fadfb66c18e4db9954a2980f28c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL adamixture-1.8.6-cp310-cp310-manylinux_2_28_x86_64.whl
Size 12.7 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3a7509e128dced2fcb3b459635b32962339920ec06f1fc3811cb42b4c49aeae5
BLAKE2b-256 checksum
How to use checksums
f64d99fe582977b47f117f6a4351865cd852fec4f4872193ee1dc1f606b4f302
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL adamixture-1.8.6-cp310-cp310-macosx_14_0_x86_64.whl
Size 12.3 MB
Tags CPython 3.10 macOS 14.0+ x86-64
SHA-256 checksum
How to use checksums
a5f6be8b0f62fb3e0dbbc462eb2e65c4bb2b62ac3dcd8cfa08adfe2d402a2be7
BLAKE2b-256 checksum
How to use checksums
b1e9b620b68c0cdd641d7b8058232159be5fcbcbcf7b555f75ce8ad39374a07e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL adamixture-1.8.6-cp310-cp310-macosx_14_0_arm64.whl
Size 12.5 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
b46f82c1ebbf175e71cb8997cd66324046ceb06fd125e6e9fc126cca8a000cc1
BLAKE2b-256 checksum
How to use checksums
8879152b1e0e4a2cc712880e167b1abc454d5857b63991240b705e5b95853cc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

1.8.7

13 release files

This release

1.8.6 This release

13 release files

1.8.5

13 release files

1.8.4

13 release files

1.8.2

13 release files

1.8.1

13 release files

1.8.0

13 release files

1.6.2

10 release files

1.6.1

10 release files

1.6.0

10 release files

1.5.5

10 release files

1.5.4

10 release files

1.5.3

10 release files

1.5.2

10 release files

1.5.1

10 release files

1.5.0

10 release files

1.0.2

10 release files

1.0.1

10 release files

1.0.0

10 release files

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