Thanks to visit codestin.com
Credit goes to github.com

Skip to content

GenomicMedLab/agct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agct: Another Genome Conversion Tool

image image image Actions status

Lift over positions between genomic reference assemblies, 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, Assembly, Strand

c = Converter(Assembly.HG19, Assembly.HG38)

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, 140453137, Strand.POSITIVE)
# returns [LiftoverResult(chrom='chr7', start=140753336, end=140753337, strand=<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

About

Another Genome Conversion Tool: Python frontend to Rust chainfile crate

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •