Skip to main content

xron_logo Xron (ˈkairɑn) is a methylation basecaller that could identify m6A methylation modification from ONT direct RNA sequencing.
Using a deep learning CNN+RNN+CTC structure to establish end-to-end basecalling for the nanopore sequencer.
The name is inherited from Chiron Built with PyTorch and python 3.8+

m6A-aware RNA basecall one-liner:

xron call -i <input_fast5_folder> -o <output_folder> -m models/ENEYFT --boostnano

Table of contents

Install

For either installation method, recommend to create a vritual environment first using conda or venv, take conda for example

conda create --name YOUR_VIRTUAL_ENVIRONMENT python=3.8
conda activate YOUR_VIRTUAL_ENVIRONMENT

Then you can install from our pypi repository or install the newest version from github repository.

Install

pip install xron

Xron requires at least PyTorch 1.11.0 to be installed. If you have not yet installed PyTorch, install it via guide from official repository.

Basecall

Before running basecall using Xron, you need to download the models from our AWS s3 bucket by running xron init

xron init

This will automatically download the models and put them into the models folder. We provided sample code in xron-samples folder to achieve m6A-aware basecall and identify m6A site. To run xron on raw fast5 files:

xron call -i ${INPUT_FAST5} -o ${OUTPUT} -m models/ENEYFT --fast5 --beam 50 --chunk_len 2000

Segmentation using NHMM

Prepare chunk dataset

Xron also include a non-homegeneous HMM (NHMM) for signal re-sqquigle. To use it: Firstly we need to extract the chunk and basecalled sequence using prepare module

xron prepare -i ${FAST5_FOLDER} -o ${CHUNK_FOLDER} --extract_seq --basecaller guppy --reference ${REFERENCE} --mode rna_meth --extract_kmer -k 5 --chunk_len 4000 --write_correction

Replace the FAST5_FOLDER, CHUNK_FOLDER and REFERENCE with your basecalled fast5 file folder, your output folder and the path to the reference genome fasta file.

Realign the signal using NHMM.

Then run the NHMM to realign ("resquiggle") the signal.

xron relabel -i ${CHUNK_FOLDER} -m ${MODEL} --device $DEVICE

This will generate a paths.py file under CHUNK_FOLDER which gives the kmer segmentation of the chunks.

Training

To train a new Xron model using your own dataset, you need to prepare your own training dataset, the dataset should includes a signal file (chunks.npy), labelled sequences (seqs.npy) and sequence length for each read (seq_lens.npy), and then run the xron supervised training module

xron train -i chunks.npy --seq seqs.npy --seq_len seq_lens.npy --model_folder OUTPUT_MODEL_FOLDER

Training Xron model from scratch is hard, I would recommend to fine-tune our model by specify --load flag, for example we can finetune the provided ENEYFT model (model trained using cross-linked ENE dataset and finetuned on Yeast dataset):

xron train -i chunks.npy --seq seqs.npy --seq_len seq_lens.npy --model_folder models/ENEYFT --load

Metadata

Release files for xron 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xron 1.0.7
File Size Uploaded Provenance Actions
xron-1.0.7.tar.gz 134.9 kB Without provenance Details for xron-1.0.7.tar.gz

Release files / xron-1.0.7.tar.gz

Download URL xron-1.0.7.tar.gz
Size 134.9 kB
Tags Source
SHA-256 checksum
How to use checksums
75980d86776433214edf49b814200a126a2c60d6ecfab895212467f492dd0ec8
BLAKE2b-256 checksum
How to use checksums
aa50182c84813b05518fc040b3fab2067a3254cf90d49ff087e6d024ef65cef2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.10

Security for xron 1.0.7

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page