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:

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.1.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.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (859.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

adamixture-1.0.1-cp312-cp312-macosx_14_0_x86_64.whl (748.9 kB view details)

Uploaded CPython 3.12macOS 14.0+ x86-64

adamixture-1.0.1-cp312-cp312-macosx_14_0_arm64.whl (974.3 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

adamixture-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (856.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

adamixture-1.0.1-cp311-cp311-macosx_14_0_x86_64.whl (741.6 kB view details)

Uploaded CPython 3.11macOS 14.0+ x86-64

adamixture-1.0.1-cp311-cp311-macosx_14_0_arm64.whl (968.5 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

adamixture-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (870.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

adamixture-1.0.1-cp310-cp310-macosx_14_0_x86_64.whl (745.0 kB view details)

Uploaded CPython 3.10macOS 14.0+ x86-64

adamixture-1.0.1-cp310-cp310-macosx_14_0_arm64.whl (973.2 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

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

File metadata

  • Download URL: adamixture-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 593b64c96514e1635812709a7677e5a7dd3e1576d278fc3e626d0d7a361d0529
MD5 4812e4b8ae4c6cab28760cc23483b0ca
BLAKE2b-256 4a75a665a9c4de8ad70105b4d2b2ec8cdf718038880cc26ff97d0da0eb11b7cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adamixture-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4bbb4adcc47200091bb0fbe7f10387f6e3283d4f808cb0e6e9f6e93917e9d9fe
MD5 a612ae3357d9919ae4c03355c0a95878
BLAKE2b-256 7183456c05804df4b173d19bb299314b99a505d85fc9ef4161841b324717509c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adamixture-1.0.1-cp312-cp312-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 3653c152f080d879ebb743ae80578b63b17bb55e078beec0e16f01e67e7f73bc
MD5 7c352bf15d96569fce78bc7a592b36c8
BLAKE2b-256 cbee192fc23638cf1c98514493d01cb8ac6205c6fb17df5e22c5e6454362f1a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adamixture-1.0.1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 805f8065f56a9d3251f31f726ac794bc497c9cc0d381b79474bf0412aae06dff
MD5 d47c9e5bff5023d7cfaee97629f69189
BLAKE2b-256 ef9579bfadb7981c03cf09632ec280b489c31e40c61187a5383199ecc6ff60a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adamixture-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b73dc81aa9f3f917e34ddf3b376de3039e703f61fc3eada687b5b5b043672f04
MD5 9daefeb1555c42f2c0951c6346be70f1
BLAKE2b-256 39e8961c31bcecd259e28a8ef4aa8f2fd9e992bd229fe078b07cedd06e0e94f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adamixture-1.0.1-cp311-cp311-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 888fba0abb40983c91b9936723553819fdd573b07888c2f817df3a772e66f69c
MD5 ae717e29da58095b5cf8226e3441cb24
BLAKE2b-256 4a7014ad4be859e894421953b335b61b3e21a1b5d96aaa832e6ab2bf1b6004c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adamixture-1.0.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 21e181df117b35681964f8503ce09ccc734fa6aa1b2535ff0ad705349b5c04f6
MD5 855b0754daa974c70cfdf78b1b593d4c
BLAKE2b-256 8d9aa8c5b912c9d6580c27b395042f10e3336876a6d62431013447a964fd16c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adamixture-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a7799de94a82d2ce7fd3960fbc52335a31acd0bd917d9f881131050a8eb65968
MD5 ef8ed63a610a101b15154e048822bbb0
BLAKE2b-256 0911e832cc4964ae21759ae1661cce90832e74724107aa4e32b2d9a4a54cc170

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adamixture-1.0.1-cp310-cp310-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 905109dbf9c88c1c67666b03eecb5135a2d20c2de492c1b033083040599022c0
MD5 5f986303b6b6e4ac15b0ee79424d9361
BLAKE2b-256 e881c57978429f02e76d67bdc43c37b87938a2dda79eeff391de02ce2cfe1fef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adamixture-1.0.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 05a5a88323a897d7b5ab6be5a2c31ca800e542df013f9a39c8e295b342299cbe
MD5 1a29e6a4406cfe1f35c948cecf059712
BLAKE2b-256 954d7357786c0c606bd8f82881a601cd86027cfef2d63a0cd2f4559e1fa19690

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