Skip to main content

Another Genome Conversion Tool: Python frontend to Rust chainfile crate

Project description

agct: Another Genome Conversion Tool

image image image Actions status

Drop-in replacement for the pyliftover tool, using the St. Jude's chainfile crate.

Enables significantly faster chainfile loading from cold start (see analysis/).

Installation

Install from PyPI:

python3 -m pip install agct

Usage

Initialize a class instance:

from agct import Converter, Genome
c = Converter(Genome.HG38, Genome.HG19)

If a chainfile is unavailable locally, it's downloaded from UCSC and saved using the wags-tails package -- see the wags-tails configuration instructions for information on how to designate a non-default storage location.

Call convert_coordinate():

c.convert_coordinate("chr7", 140453136, "+")
# [['chr7', 140152936, <Strand.POSITIVE: '+'>]]

Development

The Rust toolchain must be installed.

Create a virtual environment and install developer dependencies:

python3 -m virtualenv venv
source venv/bin/activate
python3 -m pip install -e '.[dev,tests]'

This installs Python code as editable, but after any changes to Rust code, run maturin develop to rebuild the Rust binary:

maturin develop

Be sure to install pre-commit hooks:

pre-commit install

Check Python style with ruff:

python3 -m ruff format . && python3 -m ruff check --fix .

Use cargo fmt to check Rust style (must be run from within the rust/ subdirectory):

cd rust/
cargo fmt

Run tests with pytest:

pytest

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

agct-0.1.0.dev2.tar.gz (10.6 kB view hashes)

Uploaded Source

Built Distributions

agct-0.1.0.dev2-cp38-abi3-win_amd64.whl (163.8 kB view hashes)

Uploaded CPython 3.8+ Windows x86-64

agct-0.1.0.dev2-cp38-abi3-win32.whl (161.3 kB view hashes)

Uploaded CPython 3.8+ Windows x86

agct-0.1.0.dev2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

agct-0.1.0.dev2-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.2 MB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ s390x

agct-0.1.0.dev2-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.1 MB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ppc64le

agct-0.1.0.dev2-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARMv7l

agct-0.1.0.dev2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

agct-0.1.0.dev2-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.5+ i686

agct-0.1.0.dev2-cp38-abi3-macosx_11_0_arm64.whl (274.5 kB view hashes)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

agct-0.1.0.dev2-cp38-abi3-macosx_10_12_x86_64.whl (277.8 kB view hashes)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

Supported by

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