Skip to main content

ADAMIXTURE: Adaptive First-Order Optimization for Biobank-Scale Ancestry Inference

Project description

PyPI - Python Version PyPI - Version PyPI - License PyPI - Status PyPI - Downloads DOI

ADAMIXTURE: Adaptive First-Order Optimization for Biobank-Scale Ancestry Inference

ADAMIXTURE is an unsupervised global ancestry inference method that scales the ADMIXTURE model to biobank-sized datasets. It combines the Expectation–Maximization (EM) framework with the ADAM first-order optimizer, enabling parameter updates after a single EM step. This approach accelerates convergence while maintaining comparable or improved accuracy, substantially reducing runtime on large genotype datasets. For more information, we recommend reading our pre-print.

The software can be invoked via CLI and has a similar interface to ADMIXTURE (e.g. the output format is completely interchangeable).

nadm_mna

System requirements

Hardware requirements

The successful usage of this package requires a computer with enough RAM to be able to handle the large datasets the network has been designed to work with. Due to this, we recommend using compute clusters whenever available to avoid memory issues.

Software requirements

We recommend creating a fresh Python 3.10 virtual environment using virtualenv (or conda), and then install the package adamixture there. As an example, for virtualenv, one should launch the following commands:

$ virtualenv --python=python3.9 ~/venv/nadmenv
$ source ~/venv/nadmenv/bin/activate
(nadmenv) $ 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):

(nadmenv) $ 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 VCF and BED are supported as of now:

As an example, the following ADMIXTURE call

$ ./admixture snps_data.bed 8 -s 42

would be mimicked in ADAMIXTURE by running

$ adamixture --k 8 --data_path snps_data.bed --save_dir SAVE_PATH --init_file INIT_FILE --name snps_data --seed 42

Two files will be output to the SAVE_PATH directory (the name parameter will be used to create the whole filenames):

  • A .P file, similar to ADMIXTURE.
  • A .Q file, similar to ADMIXTURE.

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

Other options

  • --lr (float, default: 0.005):
    Learning rate used by the Adam optimizer in the EM updates.

  • --min_lr (float, default: 1e-6):
    Minimum learning rate used by the Adam optimizer in the EM updates.

  • --lr_decay (float, default: 0.5):
    Learning rate decay factor.

  • --beta1 (float, default: 0.80):
    Exponential decay rate for the first moment estimates in Adam.

  • --beta2 (float, default: 0.88):
    Exponential decay rate for the second moment estimates in Adam.

  • --reg_adam (float, default: 1e-8):
    Numerical stability constant (epsilon) for the Adam optimizer.

  • --seed (int, default: 42):
    Random number generator seed for reproducibility.

  • --k (int, required):
    Number of ancestral populations (clusters) to infer.

  • --max_iter (int, default: 1500):
    Maximum number of Adam-EM iterations.

  • --check (int, default: 5):
    Frequency (in iterations) at which the log-likelihood is evaluated.

  • --max_als (int, default: 1000):
    Maximum number of iterations for the ALS solver.

  • --tole_als (float, default: 1e-4):
    Convergence tolerance for the ALS optimization.

  • --reg_als (float, default: 1e-5):
    Regularization parameter for ALS.

  • --power (int, default: 5):
    Number of power iterations used in randomized SVD (RSVD).

  • --tole_svd (float, default: 1e-1):
    Convergence tolerance for the SVD approximation.

  • --threads (int, default: 1):
    Number of CPU threads used during execution.

License

NOTICE: This software is available for use free of charge for academic research use only. Academic users may fork this repository and modify and improve to suit their research needs, but also inherit these terms and must include a licensing notice to that effect. Commercial users, for profit companies or consultants, and non-profit institutions not qualifying as "academic research" should contact the authors for a separate license. This applies to this repository directly and any other repository that includes source, executables, or git commands that pull/clone this repository as part of its function. Such repositories, whether ours or others, must include this notice.

Cite

When using this software, please cite the following pre-print:

@article{saurina2026adamixture,
  title={ADAMIXTURE: Adaptive First-Order Optimization for Biobank-Scale Genetic Clustering},
  author={Saurina-i-Ricos, Joan and Mas Monserrat, Daniel and Ioannidis, Alexander G.},
  journal={bioRxiv},
  year={2026},
  doi={10.64898/2026.02.13.700171},
  url={https://doi.org/10.64898/2026.02.13.700171}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adamixture-1.0.2.tar.gz (3.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

adamixture-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (859.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

adamixture-1.0.2-cp312-cp312-macosx_14_0_x86_64.whl (749.1 kB view details)

Uploaded CPython 3.12macOS 14.0+ x86-64

adamixture-1.0.2-cp312-cp312-macosx_14_0_arm64.whl (974.5 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

adamixture-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (857.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

adamixture-1.0.2-cp311-cp311-macosx_14_0_x86_64.whl (741.7 kB view details)

Uploaded CPython 3.11macOS 14.0+ x86-64

adamixture-1.0.2-cp311-cp311-macosx_14_0_arm64.whl (968.6 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

adamixture-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (870.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

adamixture-1.0.2-cp310-cp310-macosx_14_0_x86_64.whl (745.2 kB view details)

Uploaded CPython 3.10macOS 14.0+ x86-64

adamixture-1.0.2-cp310-cp310-macosx_14_0_arm64.whl (973.4 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

Details for the file adamixture-1.0.2.tar.gz.

File metadata

  • Download URL: adamixture-1.0.2.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for adamixture-1.0.2.tar.gz
Algorithm Hash digest
SHA256 83f6b493cc9cfe2915572d954fdc24b7076e5634056b208ee3797c91478509c0
MD5 d72252aed58079f5858b00411f54f765
BLAKE2b-256 ec0ab497cb3141f6f0ab8f6c7d172b95ae4c863208f8c6b68e0e7baf58d4f695

See more details on using hashes here.

File details

Details for the file adamixture-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for adamixture-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a5001241bb3df404ab79b4e08e974a8a2c73a1d85ae6f7a7d45b78b52493f77c
MD5 0df5da98c7ed47c5da6d62161138ffea
BLAKE2b-256 f0946809a5ddb4bf1f6c661d6465f9b13ce3e4a3b802d17fd4afbc3ef16cdce0

See more details on using hashes here.

File details

Details for the file adamixture-1.0.2-cp312-cp312-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for adamixture-1.0.2-cp312-cp312-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 e4b8f4fbcadf56455ec461c722db49302d2c2855270a10c614641a53c17e9770
MD5 8db8e639130ae7f2a2b3ef4fc17cceae
BLAKE2b-256 e298b5cd72821a12b3ecf7a499e50a2482fef2ebfae5c449b9e0763e0bbde54b

See more details on using hashes here.

File details

Details for the file adamixture-1.0.2-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for adamixture-1.0.2-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e3366b8a26aff9c9c5d11fd279286f0dbd0b6cd409c532b8abb70f1fc999934a
MD5 3fe749f9b4491a31bb7176bb9ecd25f8
BLAKE2b-256 bce3b5e6327e1fc4922acb20b93e0366e727f1e3e53495380932b66fa720fe9d

See more details on using hashes here.

File details

Details for the file adamixture-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for adamixture-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9f51aa6b447fc35e357a3b42a33954b018747255b2bc2bc512f56810c8c4cb82
MD5 e463825f940a67fcc3b9baa1244c5088
BLAKE2b-256 d584b74d5aef166bafccf63610444c3d771a47f1bbca91c3f3e5ba734403bb57

See more details on using hashes here.

File details

Details for the file adamixture-1.0.2-cp311-cp311-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for adamixture-1.0.2-cp311-cp311-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 48f2a18ec2e2f83dd17f9fc29c7f05881e7fd5bd811bf9fa7e231cd56e653f3c
MD5 9aeb8293ceab8203e1c3b0444c57a8de
BLAKE2b-256 7c06b5ed5428d61038c0888b44959fdd9238a6d3cf95d34807bec1d458c935c9

See more details on using hashes here.

File details

Details for the file adamixture-1.0.2-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for adamixture-1.0.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b914c4765435d210697b22c98fbdc72fb4aecac0e41321e60b339f29c7f66c7a
MD5 43f3e3242dc89d451f343147d69f670b
BLAKE2b-256 da1c4b2eb266f79d026f3f6668ad327d8970bac022b995b1edf5a67367cf60cb

See more details on using hashes here.

File details

Details for the file adamixture-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for adamixture-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0311190e7f2b0099026b9a36cc9153cd3db69e7b8a45353ff4e7c1441a8edd54
MD5 06d0857dcfea12d1a6e7a1af2534dff1
BLAKE2b-256 f557a689804a9782a903d0759ec1c3dcc476b416a0925415622864ebe380c91e

See more details on using hashes here.

File details

Details for the file adamixture-1.0.2-cp310-cp310-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for adamixture-1.0.2-cp310-cp310-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 6e42b822ce4ccfd0b282bf4f08ad0e8d045116a05e9db61dc74cd093ea8f776d
MD5 b208734057540372fda2835559af42a0
BLAKE2b-256 e8cb4e91fe51da5f02e2481df0bf19b34cbb367a94992ae0926113475331e368

See more details on using hashes here.

File details

Details for the file adamixture-1.0.2-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for adamixture-1.0.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c70bfad3034d010a3f571214fd91a24e11aa766eade37e1ecc20eb31463166a1
MD5 cc8d9e7ab66448f369bf96690fb204b5
BLAKE2b-256 bee3369fe33ec80cc9f4067a764891252ead4a90938a98aa9de9751897668970

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page