liezeltamon/single-cell-preprocess

A Snakemake pipeline for processing 10X single-cell data

Overview

Latest release: None, Last update: 2026-05-16

Share link: https://snakemake.github.io/snakemake-workflow-catalog?wf=liezeltamon/single-cell-preprocess

Quality control: linting: failed formatting: failed

Deployment

Step 1: Install Snakemake and Snakedeploy

Snakemake and Snakedeploy are best installed via the Conda package manager. It is recommended to install conda via Miniforge. Run

conda create -c conda-forge -c bioconda -c nodefaults --name snakemake snakemake snakedeploy

to install both Snakemake and Snakedeploy in an isolated environment. For all following commands ensure that this environment is activated via

conda activate snakemake

For other installation methods, refer to the Snakemake and Snakedeploy documentation.

Step 2: Deploy workflow

With Snakemake and Snakedeploy installed, the workflow can be deployed as follows. First, create an appropriate project working directory on your system and enter it:

mkdir -p path/to/project-workdir
cd path/to/project-workdir

In all following steps, we will assume that you are inside of that directory. Then run

snakedeploy deploy-workflow https://github.com/liezeltamon/single-cell-preprocess . --tag None

Snakedeploy will create two folders, workflow and config. The former contains the deployment of the chosen workflow as a Snakemake module, the latter contains configuration files which will be modified in the next step in order to configure the workflow to your needs.

Step 3: Configure workflow

To configure the workflow, adapt config/config.yml to your needs following the instructions below.

Step 4: Run workflow

The deployment method is controlled using the --software-deployment-method (short --sdm) argument.

To run the workflow using apptainer/singularity, use

snakemake --cores all --sdm apptainer

To run the workflow using a combination of conda and apptainer/singularity for software deployment, use

snakemake --cores all --sdm conda apptainer

To run the workflow with automatic deployment of all required software via conda/mamba, use

snakemake --cores all --sdm conda

Snakemake will automatically detect the main Snakefile in the workflow subfolder and execute the workflow module that has been defined by the deployment in step 2.

For further options such as cluster and cloud execution, see the docs.

Step 5: Generate report

After finalizing your data analysis, you can automatically generate an interactive visual HTML report for inspection of results together with parameters and code inside of the browser using

snakemake --report report.zip

Configuration

The following section is imported from the workflow’s config/README.md.

Workflow overview

This workflow is a best-practice workflow for preprocessing multiplexed 10X single-cell RNA-seq data produced by the Cell Ranger multi pipeline. The workflow is built using Snakemake and consists of the following steps:

  1. Remove empty droplets from the raw feature-barcode matrix (DropletUtils::emptyDrops)

  2. Demultiplex samples using HTO/hashtag oligonucleotide information (cellhashR, consensus across 6 methods)

  3. Detect and flag doublets (scDblFinder)

  4. Filter cells by conventional QC metrics using MAD-based outlier detection (scuttle::isOutlier)

  5. Compute per-sample QC summary statistics and plots (qc_sc_sample)

  6. Aggregate QC metrics across all samples and render cross-sample heatmaps (qc_sc_aggregate)

Running the workflow

Input data

The workflow auto-detects samples as subdirectories of data/cellranger/. Each sample must have a Cell Ranger multi output H5 matrix and an HTO-to-sample mapping file.

Input

Path pattern

Format

Raw feature-barcode matrix

data/cellranger/{sample}/outs/multi/count/raw_feature_bc_matrix.h5

10X HDF5; must contain Gene Expression and Multiplexing Capture experiments

HTO-to-sample mapping

results/process_droplets/hto_to_sample_mapping/{sample}/hto_to_sample_mapping.tsv

Tab-separated; columns: hto_id, sample_name

Parameters

This table lists all parameters that can be set in config/config.yml.

Section

Parameter

Type

Description

Default

empty_emptydrops

seed_val

int

Random seed for reproducibility

827

n_cores

int

Number of cores for emptyDrops

1

emptydrops_alpha

float

FDR threshold for retaining barcodes as non-empty

0.0001

dehash_cellhashr

chemistry_10x

str

10X Genomics chemistry version (e.g. 10xV3)

10xV3

methods

list

Demultiplexing algorithms to run; subset of [htodemux, multiseq, dropletutils, gmm_demux, bff_raw, bff_cluster]

all 6 methods

doublet_scdblfinder

seed_val

int

Random seed for reproducibility

827

n_cores

int

Number of cores for scDblFinder

1

filter_conventional

sample_id_var

str

Column in barcode metadata used to group cells per sample for outlier detection

hashing_var

is_outlier_nmads

int

Number of MADs beyond which a cell is flagged as an outlier

3

is_outlier_fields_id

str

Set of QC metric fields to use for outlier detection; default applies the built-in field set

default

qc_sc_sample

grouping_var

str

Metadata column used to group cells when computing per-sample QC summaries

hashing_var

qc_sc_aggregate

grouping_var

str

Metadata column used to group cells when aggregating QC metrics across samples

group_id

heatmap_colors

list

Three colours defining the low / mid / high gradient of the QC heatmap

[blue, white, red]

heatmap_fontsize

int

Font size used in the QC heatmap

10

Linting and formatting

Linting results
1ModuleNotFoundError in file "/tmp/tmph0jzovlm/workflow/Snakefile", line 12:
2No module named 'utils'
3  File "/tmp/tmph0jzovlm/workflow/Snakefile", line 12, in <module>
Formatting results
 1[DEBUG] 
 2[DEBUG] In file "/tmp/tmph0jzovlm/workflow/rules/qc_sc_sample.smk":  Formatted content is different from original
 3[DEBUG] 
 4[DEBUG] In file "/tmp/tmph0jzovlm/workflow/rules/empty_emptydrops.smk":  Formatted content is different from original
 5[DEBUG] 
 6[DEBUG] In file "/tmp/tmph0jzovlm/workflow/rules/doublet_scdblfinder.smk":  Formatted content is different from original
 7[DEBUG] 
 8[DEBUG] In file "/tmp/tmph0jzovlm/workflow/Snakefile":  Formatted content is different from original
 9[DEBUG] 
10[DEBUG] In file "/tmp/tmph0jzovlm/workflow/rules/dehash_cellhashr.smk":  Formatted content is different from original
11[DEBUG] 
12[DEBUG] In file "/tmp/tmph0jzovlm/workflow/rules/qc_sc_aggregate.smk":  Formatted content is different from original
13[DEBUG] 
14[DEBUG] In file "/tmp/tmph0jzovlm/workflow/rules/filter_conventional.smk":  Formatted content is different from original
15[INFO] 7 file(s) would be changed 😬
16
17snakefmt version: 0.11.5