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

QuantNado logo

QuantNado builds per-sample Zarr stores from genomic assays and exposes a unified Python API for region selection, reduction, feature counting, normalisation, PCA, and peak calling.

Installation

pip install quantnado

Requires Python 3.12 or 3.13.

Quick Start

1. Create per-sample stores

quantnado dataset create \
  --sample ATAC_1 \
  --assay ATAC \
  --bamfile /data/ATAC_1.bam \
  --output-dir dataset \
  --chromsizes hg38.chrom.sizes

quantnado dataset create \
  --sample H3K27ac_1 \
  --assay ChIP \
  --bamfile /data/H3K27ac_1.bam \
  --ip H3K27ac \
  --output-dir dataset

quantnado dataset create \
  --sample METH_1 \
  --assay METH \
  --bamfile /data/METH_1.bam \
  --methylation_file /data/METH_1.bedGraph \
  --output-dir dataset

quantnado dataset create \
  --sample SNP_1 \
  --assay SNP \
  --vcf_file /data/SNP_1.vcf.gz \
  --output-dir dataset

This writes one .zarr store per sample into dataset/.

For quick test builds, you can either use the default test chromosomes:

quantnado dataset create \
  --sample ATAC_1 \
  --assay ATAC \
  --bamfile /data/ATAC_1.bam \
  --output-dir dataset \
  --test

or provide an explicit list:

quantnado dataset create \
  --sample ATAC_1 \
  --assay ATAC \
  --bamfile /data/ATAC_1.bam \
  --output-dir dataset \
  --test-chrom chr21 \
  --test-chrom chr9

2. Open the dataset in Python

from quantnado import QuantNado

qn = QuantNado.open("dataset/")

print(qn.sample_names)
print(qn.assays)
print(qn.array_keys)
print(qn.info)

3. Run common analyses

# Select a genomic region
region = qn.sel("chr1", 1_000_000, 1_010_000)

# Reduce signal over intervals
promoters = qn.reduce(
    intervals_path="promoters.bed",
    reduction="mean",
    modality="coverage",
)

# Quantify stored signal over genes
gene_signal, gene_meta = qn.quantify_signal(
    gtf_file="genes.gtf",
    feature_type="gene",
    assay="RNA",
    modality="coverage",
)

# Count features using the current signal backend
counts, features = qn.count_features(
    gtf_file="genes.gtf",
    feature_type="gene",
    engine="signal",
    assay="RNA",
)

# PCA on reduced signal
pca_obj, pca_result = qn.pca(promoters["mean"], n_components=10)

4. Optionally combine stores

quantnado dataset combine \
  --stores dataset/ATAC_1.zarr dataset/H3K27ac_1.zarr dataset/METH_1.zarr dataset/SNP_1.zarr \
  --output dataset/combined.zarr

You can open either dataset/ or dataset/combined.zarr with the same API.

CLI

QuantNado installs a quantnado command with two main workflows.

dataset create

Creates one per-sample Zarr store from direct assay inputs.

quantnado dataset create \
  --sample RNA_1 \
  --assay RNA \
  --bamfile /data/RNA_1.bam \
  --stranded R \
  --output-dir dataset

For single-end BAMs, add --single-end.

Supported assays: ATAC, ChIP, RNA, CUT&TAG, METH, SNP, MCC.

dataset combine

Combines per-sample stores into one multi-sample store.

quantnado dataset combine \
  --stores dataset/ATAC_1.zarr dataset/RNA_1.zarr dataset/METH_1.zarr \
  --output dataset/combined.zarr

call-peaks

Calls peaks directly from a QuantNado dataset.

quantnado call-peaks \
  --zarr dataset/combined.zarr \
  --method quantile \
  --assay atac \
  --output-dir peaks/

Available methods: quantile, seacr, and lanceotron.

Python API

The main entry points are:

Object / function Purpose
QuantNado.open(path) Open a directory of per-sample stores or a combined .zarr
QuantNado.combine(src, output) Combine per-sample stores into one multi-sample store
QuantNadoDataset(path) Lower-level analysis object used by the facade
create_dataset(...) Build a single per-sample store programmatically
metadata_from_seqnado(...) Generate a QuantNado metadata table from a SeqNado project

Common analysis methods on QuantNado / QuantNadoDataset:

Method Purpose
.sel(chrom, start, end, ...) Extract a genomic region as xr.Dataset
.reduce(...) Summarise signal over BED/GTF intervals
.quantify_signal(...) Quantify stored signal over features
.count_features(...) Count features via the selected engine (signal today, bam planned)
.extract(...) Bin signal around promoters, genes, transcripts, or exons
.normalise(...) Apply CPM/RPKM/TPM normalisation
.group_by(...), .subset(...), .info Notebook-friendly sample grouping, filtering, and dataset summaries
.pca(...) Run PCA on reduced or selected signal
.metaplot(...), .tornadoplot(...), .heatmap(...), .correlate(...) Visualisation helpers

Documentation

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

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.9.tar.gz (27.8 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.9-py3-none-any.whl (27.4 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for quantnado-0.4.9.tar.gz
Algorithm Hash digest
SHA256 ff0d6a3230a80d20b548d34aa1aa0f231a07abb5186c697c0d4b63924e3f691d
MD5 414426f083c4027ce93491466afdeff0
BLAKE2b-256 cc585364cecda0cdcfbe9bce506d07e07de043727bcd1389b0418b9730499fd3

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for quantnado-0.4.9-py3-none-any.whl
Algorithm Hash digest
SHA256 517bc916ca5835e2680fabb41bfafa21a2df58eff20d5645efa4d361d82a4822
MD5 7b92b25222992263f2a97cc3f603b3dd
BLAKE2b-256 9ed8c2b7914e68d7bc4d87a57b1597d7173998e1f4a9245a3d19590b0e2799c1

See more details on using hashes here.

Provenance

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