Skip to main content

Dataset generation and peak calling for multi-modal Next-Generation Sequencing data

Project description

QuantNado

QuantNado provides efficient Zarr-backed storage and analysis of genomic signal from BAM and bigWig files, with support for signal reduction, feature counting, dimensionality reduction, and quantile-based peak calling.

CI PyPI Docs License: MIT Python


Installation

pip install quantnado

Requires Python 3.12 or 3.13.


Quick Start

Create a dataset from BAM files

from quantnado import QuantNado

qn = QuantNado.from_bam_files(
    bam_files=["sample1.bam", "sample2.bam", "sample3.bam"],
    store_path="dataset.zarr",
    metadata="samples.csv",  # optional
)

Load and analyse an existing dataset

from quantnado import QuantNado

qn = QuantNado.open("dataset.zarr")

# Aggregate signal over genomic ranges
promoter_signal = qn.reduce("promoters.bed", reduction="mean")
print(promoter_signal["mean"].shape)  # (n_promoters, n_samples)

# PCA on reduced signal
pca_obj, transformed = qn.pca(promoter_signal["mean"], n_components=10)
print(transformed.shape)  # (n_samples, 10)

# Generate a count matrix for DESeq2
counts, features = qn.count_features("genes.gtf", feature_type="gene")
counts.to_csv("counts.csv")

# Extract signal over a specific region
region = qn.extract_region("chr1:1000-5000")
print(region.shape)  # (n_samples, 4000)

Command-line Interface

QuantNado installs a quantnado command with two subcommands.

create-dataset — build a multi-omics store from BAM/bedGraph/VCF files

At least one of --bam, --bedgraph, or --vcf is required. File lists are comma-separated.

quantnado create-dataset \
  --output dataset \
  --bam sample1.bam,sample2.bam,sample3.bam \
  --bedgraph meth_rep1.bedGraph,meth_rep2.bedGraph \
  --vcf sample1.vcf.gz,sample2.vcf.gz \
  --metadata samples.csv \
  --max-workers 8

call-peaks — call quantile-based peaks from bigWig files

quantnado call-peaks \
  --bigwig-dir path/to/bigwigs/ \
  --output-dir peaks/ \
  --chromsizes hg38.chrom.sizes \
  --quantile 0.98

Run quantnado --help or quantnado <subcommand> --help for full option listings.


API Reference

Full documentation is available at milne-group.github.io/QuantNado.

QuantNado

Method / Property Description
QuantNado.from_bam_files(bam_files, store_path, ...) Create a new dataset from BAM files
QuantNado.open(store_path, read_only=True) Open an existing dataset
.reduce(ranges, reduction="mean") Aggregate signal over genomic ranges (BED)
.count_features(gtf_file, feature_type="gene") Generate a DESeq2-compatible count matrix
.pca(data, n_components=10) Run PCA on a signal matrix
.extract_region(region) Extract raw signal for a genomic region
.to_xarray(chromosomes) Load dataset as lazy xarray DataArrays
.samples List of sample names
.metadata Sample metadata (DataFrame)
.chromosomes Available chromosome names
.chromsizes Chromosome sizes (dict)
.store_path Path to the underlying Zarr store

Requirements

Dependency Purpose
zarr, icechunk Zarr v3 storage backend
xarray, dask Lazy array operations
pandas, numpy Data structures
pysam, bamnado BAM file I/O
pyBigWig bigWig I/O
pyranges Genomic range operations
scikit-learn (via dask-ml) PCA
typer, loguru CLI and logging
ipykernel, jupyterlab, matplotlib Example notebook (pip install "quantnado[example]")

License

MIT — see LICENSE.

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

quantnado-0.4.1.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quantnado-0.4.1-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file quantnado-0.4.1.tar.gz.

File metadata

  • Download URL: quantnado-0.4.1.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for quantnado-0.4.1.tar.gz
Algorithm Hash digest
SHA256 073234ce2e8eb3d52ae6409492bff2c4a0ffe77cc73ee8de6234f3794e3c3f3f
MD5 53891af5fc8eca04004feeff1d9ef1a6
BLAKE2b-256 acd5b20cf7c890be2c969dbd3b6057f970a61a89c189c9ef24f72e9cb6c75114

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantnado-0.4.1.tar.gz:

Publisher: pypi.yml on Milne-Group/QuantNado

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantnado-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: quantnado-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for quantnado-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd630e8ead5fb4ef07334873ca9f827321de2c3d5922df21e4ada855d0b2c662
MD5 4167a90e09885c6ab2705f65d04180a8
BLAKE2b-256 6ca3903c07d73685fc3a717676edf2ad044d401b9120f14e602cc10af6987b74

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantnado-0.4.1-py3-none-any.whl:

Publisher: pypi.yml on Milne-Group/QuantNado

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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