Observed since 20 Oct, 19:01 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
ADAMIXTURE: Adaptive First-Order Optimization for Biobank-Scale Ancestry Inference
ADAMIXTURE is a fast CPU/GPU implementation of ADMIXTURE for biobank-scale genetic clustering. .P and .Q outputs remain compatible with ADMIXTURE.
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).
We recommend creating a fresh Python 3.10+ virtual environment. For a faster installation experience, we highly recommend using uv.
[!IMPORTANT]
If you plan to use GPU acceleration, ensure that the CUDA toolkit is correctly loaded (e.g.,module load cuda) before starting the installation. This ensures that the dependencies and internal components are correctly configured for your hardware.
As an example, using uv (recommended):
$ uv venv --python 3.10
$ source .venv/bin/activate
$ uv pip install adamixture
The package can be installed using pip:
Uses the pre-compiled C/Cython wheel and does not install PyTorch:
$ pip install adamixture
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.
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:
.bed, .bed.gz, .bed.zst, with .bim/.fam sidecars that may also be plain, .gz or .zst..pgen or .pgen.zst, with .pvar/.psam sidecars that may be plain, .gz or .zst..vcf, .vcf.gz and .vcf.zst..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):
.P file, similar to ADMIXTURE..Q file, similar to ADMIXTURE..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
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
To leverage GPU acceleration (highly recommended for large datasets), use the --device flag:
$ adamixture -k 8 --data_path data.bed --save_dir out/ --name test --device gpu
$ adamixture -k 8 --data_path data.bed --save_dir out/ --name test --device mps
[!TIP] GPU Acceleration: Using GPUs greatly speeds up processing and is highly recommended for large datasets. You can specify the hardware to use with the
--deviceparameter:
- For NVIDIA GPUs, use
--device gpu(requires CUDA).- For macOS users with Apple Silicon (M1/M2/M3/M4/M5), use
--device mpsto enable Metal Performance Shaders (MPS) acceleration.- Note that biobank-scale datasets are best handled on dedicated CUDA-capable GPUs due to high RAM requirements.
For a step-by-step guide on how to run a complete analysis workflow, see the 1000 Genomes Tutorial.
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
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
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
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
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
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. |
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.
Common issues and platform notes:
libomp via Homebrew (brew install libomp) before compiling.pip install adamixture). If compiling from source (pip install -e .), install Build Tools for Visual Studio with Desktop development with C++.CUDA_HOME or install nvcc via Conda (conda install -c nvidia nvcc).This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.
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}
}
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.8.7 | 16 Oct 2026 | 11 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 19:01 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:684660fe7661d68cab5bc2b304274aeea168d71be854a14b9200e036f7c5936d