Installation

Python development environment

From PyPI:

pip install admixture
admixture setup

The wheel includes a Julia project under the Python package at admixture/julia-env. admixture setup runs Pkg.instantiate() for that packaged project.

This repository uses conda and Poetry together. The conda environment is named admixture. It includes juliaup; use it to install/select a Julia runtime inside makim setup.install.

conda env create -f conda/dev-linux.yaml
conda activate admixture
poetry config virtualenvs.create false
makim setup.install

Use the environment file for your operating system:

  • Linux: conda/dev-linux.yaml
  • macOS: conda/dev-macos.yaml
  • Windows: conda/dev-win.yaml

makim setup.install runs poetry install --with dev and then instantiates the packaged Julia project.

If the environment already exists:

conda activate admixture
conda env update -f conda/dev-linux.yaml --prune
makim setup.install

Quarto documentation engine

The documentation in docs/ is a Quarto website. The conda environments include the Quarto CLI.

Render locally with:

conda activate admixture
quarto render docs

Preview locally with:

quarto preview docs

Julia runtime

Julia is an external runtime, not a Python dependency. The development conda environments include juliaup, a cross-platform Julia installer and version manager from conda-forge:

juliaup add release
juliaup default release
julia --version

The conda environment files in this repository include juliaup instead of the old julia conda package because juliaup is available on Linux, macOS, and Windows. If you are not using the provided conda environment files, install it with conda install -c conda-forge juliaup first.

For non-conda installs, the official Julia installer from https://julialang.org/downloads/ is also supported as long as julia is on PATH.

You can also pass an explicit executable path:

from admixture import OpenAdmixtureRunner

runner = OpenAdmixtureRunner(julia="/path/to/julia")

Google Cloud CLI

The Linux and macOS conda environment files include google-cloud-sdk, which provides the gcloud command used for local malariagen-data authentication:

makim gcloud.auth

The Windows conda environment file does not include google-cloud-sdk. On Windows, install Google Cloud CLI with Google’s official installer, open a new terminal, and then authenticate:

(New-Object Net.WebClient).DownloadFile(
  "https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe",
  "$env:Temp\GoogleCloudSDKInstaller.exe"
)
& "$env:Temp\GoogleCloudSDKInstaller.exe"
gcloud auth application-default login

On Windows:

runner = OpenAdmixtureRunner(
    julia=r"C:\Users\you\AppData\Local\Programs\Julia-1.11.0\bin\julia.exe"
)

OpenADMIXTURE.jl

The Python package ships a Julia project with Project.toml and Manifest.toml. Instantiate it with:

admixture setup

From Poetry, use:

poetry run admixture setup

You can also call the same setup helper from Python:

import admixture

project_dir = admixture.setup()

Then use the runner. It always points to the packaged Julia project:

runner = OpenAdmixtureRunner()