clonify (native)
High-performance clonotype assignment with a native Rust backend and average-linkage clustering.
Installation
clonify is published on PyPI with prebuilt wheels for common platforms:
- macOS (Apple Silicon arm64 and Intel x86_64)
- Linux (manylinux x86_64)
Requires Python 3.8+.
pip
python -m pip install -U pip setuptools wheel
python -m pip install clonify
If you want to avoid building from source, you can force a prebuilt wheel only:
python -m pip install --only-binary=:all: clonify
uv
# install into the current environment
uv pip install clonify
# or create/use a uv-managed virtualenv
uv venv .venv
source .venv/bin/activate
uv pip install clonify
Compatibility
| OS | Architecture | Python versions (CPython) | Distribution |
|---|---|---|---|
| macOS | arm64 (Apple Silicon) | 3.8 – 3.12 | Prebuilt wheel |
| macOS | x86_64 (Intel) | 3.8 – 3.12 | Prebuilt wheel |
| Linux (manylinux) | x86_64 | 3.8 – 3.12 | Prebuilt wheel |
| Other/older combos | varies | 3.8+ | Source build via Rust |
Notes:
- Wheels target mainstream CPython versions; newer versions may be added as releases are cut.
- If a wheel isn’t available for your exact combo, the installer will attempt a source build. See Troubleshooting.
Verify your installation
-
CLI:
clonify --help -
Python:
import clonify from clonify import clonify as run_clonify
Quick start
CLI
AIRR-compliant TSV is expected to be input format, using either the unpaired sequence schema or the modified paired sequence schema used by abstar. Clonify can also accept CSV/TSV/Parquet/NDJSON/JSON files; format is inferred from the extension. The output format is inferred from the extension of the supplied --output path; if omitted, CSV is printed to stdout.
# Minimal: read TSV and write CSV
clonify \
--input data/airr.tsv \
--output results/lineages.csv
# With optional JSON mapping of sequence_id -> lineage
clonify \
--input data/airr.tsv \
--output results/lineages.parquet \
--assignments-json results/assignments.json \
--distance-cutoff 0.35 \
--shared-mutation-bonus 0.35 \
--length-penalty-multiplier 2.0
Python API
Using a Polars DataFrame (recommended for native backend):
import polars as pl
from clonify import clonify
# df must include v_gene, j_gene, cdr3, and v_mutations columns (paired inputs are supported)
df = pl.read_csv("data/airr.tsv", separator="\t")
assignments, df_out = clonify(
df,
distance_cutoff=0.35,
shared_mutation_bonus=0.35,
length_penalty_multiplier=2.0,
)
# Write results
df_out.write_parquet("results/lineages.parquet")
You can also pass a file path directly; the format is inferred by extension. If you provide output_path, results are written automatically:
from clonify import clonify
assignments, df_out = clonify(
"data/airr.tsv",
output_path="results/lineages.csv", # csv/tsv/parquet/json/ndjson
)
Troubleshooting installation
clonify ships wheels for the platforms listed above. If no compatible wheel is available for your OS/architecture/Python version, the installer will attempt to build from source using Rust (via maturin/pyo3).
What failure looks like when no wheel is available and Rust is not installed
During pip install clonify (or uv pip install clonify), you may see messages such as:
- "Building wheel for clonify (pyproject.toml) did not run successfully"
- "error: cargo not found" or "error: can't find Rust compiler"
- "note: maturin failed; ensure Rust toolchain is installed"
This indicates a source build was triggered but a Rust toolchain is missing.
How to fix
- Install Rust (recommended):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh- Restart your shell, then verify:
rustc --versionandcargo --version.
- Upgrade build tooling:
python -m pip install -U pip setuptools wheel. - macOS build tools (if building from source):
xcode-select --install. - Ensure your Python architecture matches your OS:
- Apple Silicon: Prefer an arm64 Python. Check with
python -c "import platform; print(platform.machine())"(expectarm64). If running under Rosetta (x86_64), use an arm64 Python or install the x86_64 wheel in a matching environment.
- Apple Silicon: Prefer an arm64 Python. Check with
- Prefer wheels when available:
python -m pip install --only-binary=:all: clonify. - If behind a proxy/offline: download the appropriate wheel from PyPI on a connected machine and
pip install path/to/clonify-<version>-<tags>.whl.
If issues persist, reinstall Rust via rustup and retry with verbose logs:
python -m pip install -v clonify
Usage
from clonify import clonify
assign_dict, df_out = clonify(df, distance_cutoff=0.35)
Development
- Create a virtual environment (recommended)
- Build editable native extension:
pip install maturin && maturin develop - Run tests:
pytest
Metadata
Release files for clonify-antibody 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| clonify_antibody-0.1.0.tar.gz | 6.9 MB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clonify_antibody-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| clonify_antibody-0.1.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
| clonify_antibody-0.1.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl | CPython 3.10 | abi3 | macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 | Details |
Total release size: 8.0 MB
Release files / clonify_antibody-0.1.0.tar.gz
| Download URL | clonify_antibody-0.1.0.tar.gz |
|---|---|
| Size | 6.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
caf5bf3a15565d9ab53e9030656bcacc56016947c3b0e6d5cf8424fa9da21098
|
|
BLAKE2b-256 checksum How to use checksums |
a6445efa72c6add3b7c0561251912086741d7ad57b502b6181b1a1b2203d2a76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 11, 2025.
Transparency logRelease files / clonify_antibody-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | clonify_antibody-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 299.8 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
00a88edd3ea09531ec214813c21f2f58313f65b5e90a661a55a51a5e09b158f1
|
|
BLAKE2b-256 checksum How to use checksums |
380a4f13caaa15cd396660025b0a74ee50a52366694eb6d9d6080ca57ed53436
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 11, 2025.
Transparency logRelease files / clonify_antibody-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | clonify_antibody-0.1.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 256.0 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5c948c881b54e6fa34824fc0d1fcc0b9a46bb71377eb874ee2ede8f648f08ad1
|
|
BLAKE2b-256 checksum How to use checksums |
74c0b70d05d5131795eb87a86593b983bc2f33096c0e8b7d6c216abadf2a670c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 11, 2025.
Transparency logRelease files / clonify_antibody-0.1.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | clonify_antibody-0.1.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 499.3 kB |
| Tags | CPython 3.10 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3b5991e3385fe528b3a6f19f28a4496d43808050f64dde1bdd17a4ef845eea0c
|
|
BLAKE2b-256 checksum How to use checksums |
6d36a6d4c101625584038390cf76d90264f13def3709d91f5ebd798514c4888f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 11, 2025.
Transparency log