×

cellgeni/hmetacells @ 1.0.0

Hierarchical metacell aggregation for single-cell genomics data.

Latest version: 1.0.0
Total downloads: 5
Authors: @claptar
Maintainers: @claptar

cellgeni/hmetacells

Summary

Runs the hierarchical metacell aggregation workflow to cluster single-cell profiles into a smaller set of representative metacells from single-cell genomics data.

Get started

Include this module in your Nextflow pipeline:

include { HMETACELLS } from 'cellgeni/hmetacells'

Inputs

  • tuple val(meta), path(adata)
    • meta: sample metadata map (expects an id key; used for tagging and default output prefixing)
    • adata: input AnnData object in .h5ad format

Outputs

  • csv: tuple val(meta), path("*.csv") (hierarchical metacell assignment table; typically includes hierarchial_metacells.csv)
  • versions: path("versions.yml") (tool/package versions captured at runtime)

Parameters

This module supports passing arguments to hierarchial_metacells.py via task.ext.args.

When running the module directly with nextflow module run, set these at the command line using Nextflow “process options”:

  • -process.ext.args='<HMETACELLS_ARGS>' (i.e. -process.ext.args=<HMETACELLS_ARGS>)
  • -process.ext.prefix='<SAMPLE_PREFIX>' (i.e. -process.ext.prefix=<SAMPLE_PREFIX>, optional; defaults to ${meta.id})

Defaults are:

--type gex --n_min 5 --n_max 20 --method ward --n_top_genes 2000 --n_components 50 --n_neighbors 15

The output/sample prefix can be controlled via task.ext.prefix (defaults to ${meta.id}).

Hierarchical aggregation arguments

These are the supported arguments you can include in ext.args:

  • --type (required): input data modality. Choices: gex or atac.
  • --n_min (required): minimum number of cells in a metacell.
  • --n_max (required): maximum number of cells in a metacell.
  • --method (required): clustering method. Choices: paris, louvain, or the default workflow value.
  • --n_top_genes (optional, default 2000): number of highly-variable genes to select for GEX preprocessing.
  • --n_components (optional, default 50): number of components used for PCA (GEX) or LSI (ATAC).
  • --n_neighbors (optional, default 15): number of nearest neighbors used during clustering.
  • --celltype_label (optional): obs column used to split cells by cell type before clustering.
  • --precomputed (optional): key in adata.obsm containing a precomputed embedding.
  • --delimiter (optional): append sample suffix to barcodes using this delimiter.

Notes:

  • --adata, --sample, and --output are handled by the module wrapper and do not need to be provided in ext.args.

Full nextflow module run example

/software/cellgen/cellgeni/nextflow/26.04.0/nextflow module run cellgeni/hmetacells \
  --meta.id pbmc_10k \
  --adata /path/to/pbmc10k.h5ad \
  -process.ext.prefix=pbmc_10k \
  -process.ext.args='--type gex --n_min 5 --n_max 20 --method louvain --n_top_genes 2000 --n_components 50 --n_neighbors 15 --celltype_label celltype'

Dependencies

This module runs inside the container quay.io/cellgeni/metacells-python:latest.

Citation

Add the relevant citation for the hierarchical metacell method here.

License

MIT

Input 1 channel
#1 tuple
meta map

Groovy Map containing sample information e.g. [ id:'test' ]

adata file

AnnData object in h5ad format

*.{h5ad}
Output 2 channels
#1 meta tuple
meta map

Groovy Map containing sample information e.g. [ id:'test' ]

*.csv file

CSV with hierarchical metacell assignments

*.csv
#2 versions
versions file

YAML file containing software versions used

versions.yml
Tool Description Homepage
scanpy Single-cell analysis toolkit used for preprocessing and neighborhood graph construction. https://scanpy.readthedocs.io
muon Multi-omics analysis toolkit used for ATAC preprocessing and LSI. https://muon.readthedocs.io/
Version 1.0.0
Release Date 29 Apr 2026 20:11:17 (UTC)
Download URL https://registry.nextflow.io/api/v1/modules/cellgeni%2Fhmetacells/1.0.0/download
OCI Store URL https://public.cr.seqera.io/v2/nextflow/plugin/modules/cellgeni/hmetacells/blobs/sha256:c69c882da0db986ed470d850b0e34fcde03d188525d0a9c0b3732be5a6ca54ab
Size 5.1 KB
Checksum sha256:c69c882da0db986ed470d850b0e34fcde03d188525d0a9c0b3732be5a6ca54ab
Downloads 5
Version Date Status Downloads Size
1.0.0 29 Apr 2026 20:11:17 (UTC) 5 5.1 KB