Skip to main content

Collates information from BAM and POD5 files and generates FAST5 files for use in legacy tools such as tailfindr.

Project description

fast5_rekindler

PyPI PyPi Downloads CI/CD PyPI - Python Version PyPI - License


Documentation: https://adnaniazi.github.io/fast5_rekindler

Source Code: https://github.com/adnaniazi/fast5_rekindler

PyPI: https://pypi.org/project/fast5_rekindler/


Collates information from BAM and POD5 files and generates FAST5 files for use in legacy tools such as tailfindr.

Installation

1. Create Python 3.10 or 3.11 environment.

conda create -n f5r python=3.11

2. Activate the environment.

conda activate f5r

3. Install FAST5 Rekindler.

pip install fast5_rekindler

Usage

FAST5 rekindler needs:

1. A BAM file with moves table in it.

You can generate it using Dorado:

dorado basecaller /path/to/basecalling/model \
  /pod5/dir/path \
  --recursive  \
  --emit-sam  \
  --emit-moves  \
  --device "cpu"  \ # or "cuda:all"
  --reference /path/to/alginment/reference > /path/to/calls.sam

2. Convert Doarado's output SAM file to a BAM file.

samtools view -bS /path/to/calls.sam > /path/to/calls.bam

3. Sort the BAM file.

samtools sort /path/to/calls.bam -o /path/to/sorted.calls.bam

4. Use FAST5 Rekindler to convert POD5 files to FAST5 files.

fast5_rekindler /path/to/sorted.calls.bam  \
  /path/to/pod5_dir \
  /path/to/output_dir \
  --num_processes 100

To invoke help for FAST5 Rekindler, just type:

fast5_rekindler --help

Development

  • Clone this repository
  • Requirements:
  • Create a virtual environment and install the dependencies
poetry install
  • Activate the virtual environment
poetry shell

Testing

pytest

Documentation

The documentation is automatically generated from the content of the docs directory and from the docstrings of the public signatures of the source code. The documentation is updated and published as a Github project page automatically as part each release.

Releasing

Trigger the Draft release workflow (press Run workflow). This will update the changelog & version and create a GitHub release which is in Draft state.

Find the draft release from the GitHub releases and publish it. When a release is published, it'll trigger release workflow which creates PyPI release and deploys updated documentation.

Pre-commit

Pre-commit hooks run all the auto-formatters (e.g. black, isort), linters (e.g. mypy, flake8), and other quality checks to make sure the changeset is in good shape before a commit/push happens.

You can install the hooks with (runs for each commit):

pre-commit install

Or if you want them to run only for each push:

pre-commit install -t pre-push

Or if you want e.g. want to run all checks manually for all files:

pre-commit run --all-files

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

fast5_rekindler-0.0.6.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

fast5_rekindler-0.0.6-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file fast5_rekindler-0.0.6.tar.gz.

File metadata

  • Download URL: fast5_rekindler-0.0.6.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.2.0-1018-azure

File hashes

Hashes for fast5_rekindler-0.0.6.tar.gz
Algorithm Hash digest
SHA256 6bf1483287eeb8bc3663cb6bf22e0a52a3799976a2ca5c5928c0249b3ab0f9bb
MD5 7ce18a6fdd83008426a002ce6145a8d2
BLAKE2b-256 acc8d942bde17e852626973ca31318a5b89b9935eca282c352a79ecf42c15fd8

See more details on using hashes here.

File details

Details for the file fast5_rekindler-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: fast5_rekindler-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.2.0-1018-azure

File hashes

Hashes for fast5_rekindler-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e31d4ef8d48bce3b417bcda81dafa692f28683c55d142ffd78d6c894b217acf9
MD5 b15c2819e18bd8faa16bea3c61d6c8d3
BLAKE2b-256 0cc610ce0aa51413876b55b2889500d205326f42bf5f2ec83a0663b1891dc386

See more details on using hashes here.

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