Skip to main content

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

Project description

QuantNado

Docs CI Release License PyPI Version PyPI Downloads

QuantNado logo

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.


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

GNU GPL v3.0 — 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.2.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.2-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quantnado-0.4.2.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.2.tar.gz
Algorithm Hash digest
SHA256 a0569121693a8181111f2563dfa11590a8868a95db42973c296760bc195bd198
MD5 45e4dd574cdbdfe3e52d0c380632db07
BLAKE2b-256 47bb6627ce917f13798e7bc4783e2a2cdb0e5a53f2f3ea83bc486d5876866059

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantnado-0.4.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: quantnado-0.4.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7cbfa34059f68c5c43145b80198b661eb9a24710e48aec24c92d311ba50c21ed
MD5 4e6f86c637f300ac768d72c9b9fa4042
BLAKE2b-256 8ce84c21b81c92ddb5943562bcf9be4c9c40e41568815900a2431b2a12fcea97

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantnado-0.4.2-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