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

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.4.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.4-py3-none-any.whl (27.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quantnado-0.4.4.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.4.tar.gz
Algorithm Hash digest
SHA256 ef969bd7dff9b2f24f857c60e07db828d72f613c0a951063042af9c126191847
MD5 9387b77860c755c43c36a61073ba9871
BLAKE2b-256 53ddb05885635e4509acd4a9479d67ceb73270e76c486aeab8010b8e8c44339f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: quantnado-0.4.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 28ffb19114dffcf8db669a1562d83fe7796e84e4787c4439882afe17a05929a1
MD5 d0ce26a4b622afadcabfb3bc83c01f3a
BLAKE2b-256 8ba94ed53ebfbfd4142b93c67e2392b46ab8433a5af502791a05659e5d6f3342

See more details on using hashes here.

Provenance

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