| name | scrna-seurat-general |
| description | Baseline Seurat v5 scRNA-seq pipeline โ raw 10x matrices through QC, clustering, marker-based cell-type annotation, and per-cell-type differential expression. Reach for this to preprocess 10x gene-expression data, cluster and annotate cells, or run a two-condition DEG comparison from the lab's default settings. For batch integration across many samples use scrna-scvi-integration; for label transfer from a reference use scrna-label-transfer instead.
|
| license | lab-internal |
| requirements | ["r-4.3","seurat-5","bioc-3.18"] |
| metadata | {"display-name":"scRNA-seq General Workflow (Seurat)","source_workflow":"scRNAseq_general_workflow"} |
scRNA-seq General Workflow (Seurat) โ QC โ cluster โ annotate โ DEG
The lab's baseline Seurat v5 pipeline for two-condition single-cell RNA-seq. It reads
raw 10x matrices, applies dataset-specific QC thresholds, clusters, annotates cell
types from markers, and runs cell-type-specific differential expression. Input is one
or more 10x raw_feature_bc_matrix directories; output is an annotated Seurat object
plus per-cell-type DEG tables. Use it as the default starting point when you have
standard 10x gene-expression matrices and want the lab's committed QC/clustering/
annotation conventions rather than a bespoke pipeline.
When to use it
Use this when you have standard 10x gene-expression matrices and want a general-purpose
preprocessing-through-DEG path with the lab's default thresholds. For integrating many
batches into one corrected latent space use scrna-scvi-integration; for transferring
annotations from an existing reference onto a query use scrna-label-transfer; for CNV
inference use scrna-infercnv. This skill assumes a small number of samples compared
directly, not a large atlas.
Inputs
- Object / format: one or more 10x
raw_feature_bc_matrix/ directories (barcodes,
features, matrix). Raw integer counts โ not filtered, not normalized.
- Required upstream: none; this is the entry point.
_common/functions.R must be
sourceable for shared helpers.
- Example data:
scRNAseq_general_workflow/data/ctrl_raw_feature_bc_matrix/ and
.../stim_raw_feature_bc_matrix/ (committed control + stimulation matrices).
How to run
suppressPackageStartupMessages({
library(Seurat)
library(purrr)
})
data_dirs <- c("data/ctrl_raw_feature_bc_matrix", "data/stim_raw_feature_bc_matrix")
data_list <- lapply(data_dirs, function(d) {
tmp <- Read10X(d, unique.features = TRUE, strip.suffix = FALSE)
CreateSeuratObject(tmp, assay = "RNA", min.cells = 3, min.features = 200,
project = basename(d))
})
combined <- purrr::reduce(data_list, function(x, y) merge(x, y, merge.data = TRUE))
combined <- PercentageFeatureSet(combined, "^MT-", col.name = "percent.mito")
combined <- PercentageFeatureSet(combined, "^RP[SL]", col.name = "percent.ribo")
combined_qc <- subset(
combined,
subset = percent.mito < 5 & percent.ribo < 50 & nFeature_RNA > 200
)
combined_qc <- NormalizeData(combined_qc)
combined_qc <- FindVariableFeatures(combined_qc, nfeatures = 2000)
combined_qc <- ScaleData(combined_qc)
combined_qc <- RunPCA(combined_qc, npcs = 30)
combined_qc <- FindNeighbors(combined_qc, dims = 1:30)
combined_qc <- FindClusters(combined_qc, resolution = 0.5)
combined_qc <- RunUMAP(combined_qc, dims = 1:30)
combined_qc <- JoinLayers(combined_qc)
markers <- FindAllMarkers(combined_qc, only.pos = TRUE, min.pct = 0.25)
Output
| Key / object | What it holds |
|---|
combined_qc$seurat_clusters | cluster id per cell |
combined_qc$cell_type | assigned cell-type label per cell |
markers | per-cluster positive markers |
<deg output files> | TODO โ per-cell-type DEG tables (name them after a run) |
Running on OSC
module load R/4.3.0
Gotchas
| Gotcha | What happens / fix |
|---|
| filled after first real run | |
Troubleshooting
| Symptom | Fix |
|---|
| filled after first real run | |
Next: annotate downstream with scrna-module (module enrichment) or hand the
DEG tables to enrichment-pathway.