5. Single-Cell RNA-Seq (scRNA-Seq) End-to-End Processing
De-multiplexing 10x droplet microfluidic libraries, cell-barcode filtering, Scrublet doublet identification, SCTransform normalization, Harmony batch integration, and CellTypist automated annotation.
| Metric / Requirement | Specification | Target Configuration |
|---|---|---|
| Core Engine / Framework | Cell Ranger 8.0 / STARsolo + Scanpy / Seurat v5 | Nextflow / Snakemake Compatible |
| Benchmark Runtime | ~4 – 6 hours (10,000 cells) | 32 CPU cores / 64 GB RAM |
| Standard Container | litd/docker-cellranger:v8.0.0 | Docker • Singularity • Conda |
| Input → Deliverable | 10x Chromium FASTQs → Filtered UMI Matrix, UMAP Embeddings, Cell-Type Clusters | |
Step 1: Droplet De-multiplexing & UMI Quantification with Cell Ranger
De-multiplexes cell barcodes and UMIs, aligns reads against the reference transcriptome with STAR, and calls cell-containing droplets.
cellranger count --id=PBMC_10k_scRNA \
--transcriptome=/ref/refdata-gex-GRCh38-2020-A \
--fastqs=/data/pbmc_fastqs \
--sample=pbmc_10k \
--localcores=32 --localmem=64--localmem 64 allocates memory for large matrix memory maps; output provides both raw and filtered feature-barcode matrices.Step 2: Quality Filtering, Mitochondrial QC & Doublet Scrubbing with Scanpy
Removes empty droplets, apoptotic cells with high mitochondrial fractions (>15%), and computational doublets resulting from co-encapsulated cells.
import scanpy as sc
import scrublet as scr
adata = sc.read_10x_mtx('PBMC_10k_scRNA/outs/filtered_feature_bc_matrix/')
sc.pp.filter_cells(adata, min_genes=200)
sc.pp.filter_genes(adata, min_cells=3)
# Calculate mitochondrial percentage
adata.var['mt'] = adata.var_names.str.startswith('MT-')
sc.pp.calculate_qc_metrics(adata, qc_vars=['mt'], percent_top=None, log1p=False, inplace=True)
adata = adata[adata.obs.pct_counts_mt < 15, :]
# Doublet Scoring with Scrublet
scrub = scr.Scrublet(adata.X)
doublet_scores, predicted_doublets = scrub.scrub_doublets()
adata.obs['is_doublet'] = predicted_doublets
adata = adata[~adata.obs['is_doublet'], :]pct_counts_mt < 15 eliminates lysed cells; Scrublet identifies multi-cell homotypic and heterotypic doublets.Step 3: Normalization, Variable Features & PCA Dimensionality Reduction
Normalizes cell sequencing depth to 10,000 counts, log-transforms values, selects 2,000 highly variable genes, and extracts principal components.
sc.pp.normalize_total(adata, target_sum=1e4)
sc.pp.log1p(adata)
sc.pp.highly_variable_genes(adata, min_mean=0.0125, max_mean=3, min_disp=0.5)
sc.pp.pca(adata, svd_solver='arpack')highly_variable_genes focuses subsequent neighborhood graphs on informative transcriptomic variance.Step 4: Cross-Sample Batch Correction with Harmony & UMAP Embedding
Projects cells from disparate donors or technical library batches into a shared low-dimensional manifold without destroying genuine biological heterogeneity.
import scanpy.external as sce
# Harmony batch correction across donor runs
sce.pp.harmony_integrate(adata, key='donor_batch')
sc.pp.neighbors(adata, use_rep='X_pca_harmony', n_neighbors=15, n_pcs=30)
sc.tl.umap(adata)
sc.tl.leiden(adata, resolution=0.8)X_pca_harmony ensures clustering is guided by batch-corrected biological signal.Step 5: Automated Cell-Type Annotation with CellTypist
Matches cell clusters against pre-trained neural network immune/tissue models to assign definitive cellular phenotypes.
import celltypist
from celltypist import models
# Predict immune cell types using Immune_All_Low model
model = models.Model.load(model='Immune_All_Low.pkl')
predictions = celltypist.annotate(adata, model=model, majority_voting=True)
adata = predictions.to_adata()
sc.pl.umap(adata, color=['majority_voting', 'leiden'], save='_cell_types.png')majority_voting=True reconciles single-cell uncertainty by voting across cluster communities.🚀 Automated Nextflow (nf-core) Production Execution
Execute this complete workflow across any SLURM, AWS Batch, or Google Cloud HPC cluster using the verified community container pipeline:
nextflow run nf-core/scrnaseq -r 2.5.1 \
--input samplesheet.csv \
--aligner cellranger \
--genome GRCh38 \
--outdir ./results_scrnaseq/ \
-profile docker