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

Uploaded Python 3

File details

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

File metadata

  • Download URL: quantnado-0.4.5.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.5.tar.gz
Algorithm Hash digest
SHA256 eff71f6dace9fb4aa1638e32f0b7f08ca3ed1af134a945114dc1f6c8e2f18fca
MD5 56864222ba40088189fb3b27dbd1f8b4
BLAKE2b-256 e584cf85f77a1447364f8f9da996bd51741a67b7d72ff3465008de5328e4da5a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: quantnado-0.4.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a2452d542b0c22258e2ffc1303b99f4b262ed81b275b1292f963142c52c02ef2
MD5 376f9be49c096284db4f0d947bc0122f
BLAKE2b-256 69d77397f08cdc559efb157ae44da6f3c4f160e174e469076d90aae7ce96613d

See more details on using hashes here.

Provenance

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