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

Uploaded Python 3

File details

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

File metadata

  • Download URL: quantnado-0.4.7.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.7.tar.gz
Algorithm Hash digest
SHA256 fa4feecfc5047c361a4cb5c2758c2ddc9ebf8d08b6f7553154ab884995fc1048
MD5 8e2e0af79bd73e314627fabdfffcd15f
BLAKE2b-256 6246c086ea32dfede013b005dc0e9ba21f2efa6d762593aa502a616b86ffd4d7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: quantnado-0.4.7-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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 117fef39330f5db80be795557268d83a25e0045ea097ab79d438ad3b8dcd5178
MD5 5234cdd0aa3374292160980346efb74d
BLAKE2b-256 b836a6d8efe81efa032b8aefba5a452c56ac6ce6d2864e3797fb3861380db6eb

See more details on using hashes here.

Provenance

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