Fast Biobank-Scale Population Genetics Clustering
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 easily installed in at most a few minutes using pip (make sure to add the --upgrade flag if updating the version):
$ pip install adamixture
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/.famsidecars that may also be plain,.gzor.zst. - PLINK PGEN:
.pgenor.pgen.zst, with.pvar/.psamsidecars that may be plain,.gzor.zst. - VCF:
.vcf,.vcf.gzand.vcf.zst. - BCF:
.bcf,.bcf.gzand.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
.Pfile, similar to ADMIXTURE. - A
.Qfile, similar to ADMIXTURE. - A
.pngplot 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_kand--max_k): Use--plotto configure the combined sweep plot (or--plot_singlefor 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
libompvia 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_HOMEor installnvccvia Conda (conda install -c nvidia nvcc).
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.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| adamixture-1.8.4.tar.gz | 21.7 MB | Details |
Built distributions (wheels)
Total release size: 170.8 MB
Release files / adamixture-1.8.4.tar.gz
| Download URL | adamixture-1.8.4.tar.gz |
|---|---|
| Size | 21.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53364c851a51d17c0f420e9c77dedcff30402c13894bccab12f61d1c3d3467b8
|
|
BLAKE2b-256 checksum How to use checksums |
a05555f0d35b08c6c389385abe7c51bf098a386eca1e6ec02965e99a374795da
|
| 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.4-cp312-cp312-win_amd64.whl
| Download URL | adamixture-1.8.4-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 12.2 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8d9a27cfdf8528a3dd9484663a3ef7ebd94a3dc692903e4fb4e3aa0e7bc31858
|
|
BLAKE2b-256 checksum How to use checksums |
6f0a10d1bfbf0e3274b1783af8e082b0adfa532e49119638e0b4661ee0f95dab
|
| 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.4-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | adamixture-1.8.4-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 |
35ec68f9057af6e10a20f793bc04e1d31a9a3914770e267353d17c0b613e8972
|
|
BLAKE2b-256 checksum How to use checksums |
a3887b3113034f9312cf17cb7ff73fc7addb191e61a902a2f2c267c81f85b393
|
| 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.4-cp312-cp312-macosx_14_0_x86_64.whl
| Download URL | adamixture-1.8.4-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 |
9268b9b07e0ffa313bd1dcf5f198862565851df634a57de5b0979caffa08d411
|
|
BLAKE2b-256 checksum How to use checksums |
cfbf53937abb3ddd42c259a538ea6eb0701226ac7bc4a102a88e26c1e2bd4051
|
| 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.4-cp312-cp312-macosx_14_0_arm64.whl
| Download URL | adamixture-1.8.4-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 |
7ec203ef4da85c63445d813846e7667f1c64145e201601b4a2646c8c42254f11
|
|
BLAKE2b-256 checksum How to use checksums |
0267d49827a4ad6977e8f26a7a9bdb028784e27d5fd7b399923a575267fc8dfe
|
| 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.4-cp311-cp311-win_amd64.whl
| Download URL | adamixture-1.8.4-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 12.2 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1aa3f49e6bca55cbb5436d91eb03dfb173c4f51fea2e0f4a5bd10deda86a89d6
|
|
BLAKE2b-256 checksum How to use checksums |
78696d4d719857b7caf31977d056a8e45a4f27118545c0a95e0125a2ce180b63
|
| 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.4-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | adamixture-1.8.4-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 |
ba7980cfac392f89888f23ecc01bf1db2fff98c8a2b727cda8505b385b9fbbd7
|
|
BLAKE2b-256 checksum How to use checksums |
1e99473ad2dbf7a387d78059c96ed0dcf1e1658e034e3cbb1f73edaad24831e7
|
| 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.4-cp311-cp311-macosx_14_0_x86_64.whl
| Download URL | adamixture-1.8.4-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 |
17a185ff521418a9ad34c7abc46ec64b2e529900469c4f9a27ff0a53b080a7bb
|
|
BLAKE2b-256 checksum How to use checksums |
303a7fbf094b296d65923d8ba97fe800205fd9e440f737019b6ad09a64b47a8b
|
| 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.4-cp311-cp311-macosx_14_0_arm64.whl
| Download URL | adamixture-1.8.4-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 |
ed6caf65676368d201786828901c3be4d99a3238348714fc965d5c68846eacb8
|
|
BLAKE2b-256 checksum How to use checksums |
2453d0778789f43ef3b178ad747d3edd321ffce5080b7137963bdf15f9c18bf5
|
| 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.4-cp310-cp310-win_amd64.whl
| Download URL | adamixture-1.8.4-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 12.2 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
53197d3318b2b96b32509dd59d162c4d7347d747e633052ca2b613b6ccc6adfb
|
|
BLAKE2b-256 checksum How to use checksums |
77b57dfcd9e5631d8bb5180132ef14e4cbc160c7c428cb856276a1bee6b7edba
|
| 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.4-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | adamixture-1.8.4-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 |
2b4ef5403a9c2401ce89013da553b52796d9e660fdcb588c86072ba92ca77cc7
|
|
BLAKE2b-256 checksum How to use checksums |
56bf54db2c89d790bb330e84504f45fd136250761d106da24bfe0a4fb6984bb6
|
| 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.4-cp310-cp310-macosx_14_0_x86_64.whl
| Download URL | adamixture-1.8.4-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 |
5755b2ab49f5570ccb106853844df1dfb3b37f23bdefafd029394b184f575e8c
|
|
BLAKE2b-256 checksum How to use checksums |
7d1212d9eccfe0d9cd4a237dac1bd1c5f24e5bdcb7f43dd64f41c534fdc4f9f4
|
| 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.4-cp310-cp310-macosx_14_0_arm64.whl
| Download URL | adamixture-1.8.4-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 |
a9af958c9003c5fc9119ed79779a4d223d11b954960e444a558a5dda4fee199d
|
|
BLAKE2b-256 checksum How to use checksums |
55b8056e2689238753840100623fa769fa9247629c85fcc8db1048c399385e6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|