Skill Tracer
Skills › Knowledge Work Plugins › single-cell-rna-qc › scverse_qc_guidelines.md

scverse_qc_guidelines.md

186 lines · bio-research/skills/single-cell-rna-qc/references/scverse_qc_guidelines.md at 2574e29

Open on GitHub
1# scverse Quality Control Guidelines
2
3This document provides detailed information about quality control best practices for single-cell RNA-seq data, following the scverse ecosystem recommendations.
4

scverse Quality Control Guidelines

This document provides detailed information about quality control best practices for single-cell RNA-seq data, following the scverse ecosystem recommendations.

Raw lines 1 to 4
5## Quality Control Metrics
6

Quality Control Metrics

Raw lines 5 to 6
7### Count Depth (Total Counts)
8- **What it measures**: Total number of UMI/reads per cell
9- **Why it matters**: Low count cells may be empty droplets, debris, or poorly captured cells
10- **Typical range**: 500-50,000 counts per cell (varies by protocol)
11- **Red flags**: Bimodal distributions may indicate mixing of high and low-quality cells

Count Depth (Total Counts)

  • What it measures: Total number of UMI/reads per cell
  • Why it matters: Low count cells may be empty droplets, debris, or poorly captured cells
  • Typical range: 500-50,000 counts per cell (varies by protocol)
  • Red flags: Bimodal distributions may indicate mixing of high and low-quality cells
Raw lines 7 to 12
13### Gene Detection (Genes per Cell)
14- **What it measures**: Number of genes with at least 1 count
15- **Why it matters**: Strongly correlates with count depth; low values indicate poor capture
16- **Typical range**: 200-5,000 genes per cell
17- **Red flags**: Very low values (<200) suggest technical failures

Gene Detection (Genes per Cell)

  • What it measures: Number of genes with at least 1 count
  • Why it matters: Strongly correlates with count depth; low values indicate poor capture
  • Typical range: 200-5,000 genes per cell
  • Red flags: Very low values (<200) suggest technical failures
Raw lines 13 to 18
19### Mitochondrial Content
20- **What it measures**: Percentage of counts from mitochondrial genes
21- **Why it matters**: High MT% indicates cell stress, apoptosis, or lysed cells
22- **Typical range**: <5% for most tissues, up to 10-15% for metabolically active cells
23- **Species-specific patterns**:
24 - Mouse: Genes start with 'mt-' (e.g., mt-Nd1, mt-Co1)
25 - Human: Genes start with 'MT-' (e.g., MT-ND1, MT-CO1)
26- **Context matters**: Some cell types (cardiomyocytes, neurons) naturally have higher MT content

Mitochondrial Content

  • What it measures: Percentage of counts from mitochondrial genes
  • Why it matters: High MT% indicates cell stress, apoptosis, or lysed cells
  • Typical range: <5% for most tissues, up to 10-15% for metabolically active cells
  • Species-specific patterns:
  • Mouse: Genes start with 'mt-' (e.g., mt-Nd1, mt-Co1)
  • Human: Genes start with 'MT-' (e.g., MT-ND1, MT-CO1)
  • Context matters: Some cell types (cardiomyocytes, neurons) naturally have higher MT content
Raw lines 19 to 27
28### Ribosomal Content
29- **What it measures**: Percentage of counts from ribosomal protein genes
30- **Why it matters**: Can indicate cell state or contamination
31- **Patterns**: Genes start with 'Rpl'/'RPL' (large subunit) or 'Rps'/'RPS' (small subunit)
32- **Note**: High ribosomal content isn't always bad - metabolically active cells have more ribosomes

Ribosomal Content

  • What it measures: Percentage of counts from ribosomal protein genes
  • Why it matters: Can indicate cell state or contamination
  • Patterns: Genes start with 'Rpl'/'RPL' (large subunit) or 'Rps'/'RPS' (small subunit)
  • Note: High ribosomal content isn't always bad - metabolically active cells have more ribosomes
Raw lines 28 to 33
34### Hemoglobin Content
35- **What it measures**: Percentage of counts from hemoglobin genes
36- **Why it matters**: Indicates blood contamination in non-blood tissues
37- **Patterns**: Genes matching '^Hb[^(p)]' or '^HB[^(P)]' (excludes Hbp1/HBP1)
38- **When to use**: Particularly important for tissue samples (brain, liver, etc.)

Hemoglobin Content

  • What it measures: Percentage of counts from hemoglobin genes
  • Why it matters: Indicates blood contamination in non-blood tissues
  • Patterns: Genes matching '^Hb[^(p)]' or '^HB[^(P)]' (excludes Hbp1/HBP1)
  • When to use: Particularly important for tissue samples (brain, liver, etc.)
Raw lines 34 to 39
40## MAD-Based Filtering Rationale

MAD-Based Filtering Rationale

Raw lines 40 to 41
42### Why MAD Instead of Fixed Thresholds?
44Fixed thresholds (e.g., "remove cells with <500 genes") fail because:
45- Different protocols yield different ranges
46- Different tissues have different characteristics
47- Different species have different gene counts
48- Fixed thresholds are arbitrary and not data-driven
50MAD (Median Absolute Deviation) is robust to outliers and adapts to your dataset:
51```
52MAD = median(|X - median(X)|)
53Outlier bounds = median ± n_MADs × MAD
54```

Why MAD Instead of Fixed Thresholds?

Fixed thresholds (e.g., "remove cells with <500 genes") fail because:

  • Different protocols yield different ranges
  • Different tissues have different characteristics
  • Different species have different gene counts
  • Fixed thresholds are arbitrary and not data-driven

MAD (Median Absolute Deviation) is robust to outliers and adapts to your dataset:

MAD = median(|X - median(X)|)
Outlier bounds = median ± n_MADs × MAD
Raw lines 42 to 55
56### Recommended MAD Thresholds
58Following scverse best practices (deliberately permissive):
60**5 MADs for count depth (log-transformed)**
61- Very permissive to retain rare cell populations
62- Catches extreme outliers (empty droplets, debris)
63- Log transformation handles the typical right-skewed distribution
65**5 MADs for gene counts (log-transformed)**
66- Parallels count depth filtering
67- Most informative when combined with count filtering
68- Log transformation normalizes the distribution
70**3 MADs for mitochondrial percentage**
71- More stringent because high MT% strongly indicates dying cells
72- Uses raw percentages (not log-transformed)
73- Combined with hard threshold for extra stringency
75**Hard threshold: 8% mitochondrial content**
76- Additional filter beyond MAD-based detection
77- Conservative cutoff that works across most tissues
78- Adjust higher (10-15%) for metabolically active cell types

Recommended MAD Thresholds

Following scverse best practices (deliberately permissive):

5 MADs for count depth (log-transformed)

  • Very permissive to retain rare cell populations
  • Catches extreme outliers (empty droplets, debris)
  • Log transformation handles the typical right-skewed distribution

5 MADs for gene counts (log-transformed)

  • Parallels count depth filtering
  • Most informative when combined with count filtering
  • Log transformation normalizes the distribution

3 MADs for mitochondrial percentage

  • More stringent because high MT% strongly indicates dying cells
  • Uses raw percentages (not log-transformed)
  • Combined with hard threshold for extra stringency

Hard threshold: 8% mitochondrial content

  • Additional filter beyond MAD-based detection
  • Conservative cutoff that works across most tissues
  • Adjust higher (10-15%) for metabolically active cell types
Raw lines 56 to 79
80### Why Be Permissive?
82The default thresholds intentionally err on the side of keeping cells because:
831. **Rare populations**: Stringent filtering may remove rare but viable cell types
842. **Biological variation**: Some healthy cells naturally have extreme values
853. **Reversibility**: Easier to filter more later than to recover lost cells
864. **Downstream robustness**: Modern normalization methods handle moderate quality variation

Why Be Permissive?

The default thresholds intentionally err on the side of keeping cells because:

  1. Rare populations: Stringent filtering may remove rare but viable cell types
  2. Biological variation: Some healthy cells naturally have extreme values
  3. Reversibility: Easier to filter more later than to recover lost cells
  4. Downstream robustness: Modern normalization methods handle moderate quality variation
Raw lines 80 to 87
88## Interpreting QC Visualizations

Interpreting QC Visualizations

Raw lines 88 to 89
90### Histograms
91- **Bimodal distributions**: May indicate mixing of cell types or quality issues
92- **Long tails**: Common for count depth; MAD filtering handles this
93- **Sharp cutoffs**: May indicate prior filtering or technical artifacts

Histograms

  • Bimodal distributions: May indicate mixing of cell types or quality issues
  • Long tails: Common for count depth; MAD filtering handles this
  • Sharp cutoffs: May indicate prior filtering or technical artifacts
Raw lines 90 to 94
95### Violin Plots
96- Shows distribution shape and density
97- Median (line) and mean (diamond) should be similar for symmetric distributions
98- Wide distributions suggest high heterogeneity

Violin Plots

  • Shows distribution shape and density
  • Median (line) and mean (diamond) should be similar for symmetric distributions
  • Wide distributions suggest high heterogeneity
Raw lines 95 to 99
100### Scatter Plots
102**Counts vs Genes (colored by MT%)**
103- Should show strong positive correlation (R² > 0.8 typical)
104- Points deviating from trend may be outliers
105- High MT% cells often cluster at low counts/genes
107**Counts vs MT%**
108- Negative correlation expected (dying cells have fewer counts)
109- Vertical stratification may indicate batch effects
110- Cells with high counts + high MT% are suspicious
112**Genes vs MT%**
113- Similar to counts vs MT%, but often weaker correlation
114- Useful for identifying cells with gene detection issues

Scatter Plots

Counts vs Genes (colored by MT%)

  • Should show strong positive correlation (R² > 0.8 typical)
  • Points deviating from trend may be outliers
  • High MT% cells often cluster at low counts/genes

Counts vs MT%

  • Negative correlation expected (dying cells have fewer counts)
  • Vertical stratification may indicate batch effects
  • Cells with high counts + high MT% are suspicious

Genes vs MT%

  • Similar to counts vs MT%, but often weaker correlation
  • Useful for identifying cells with gene detection issues
Raw lines 100 to 115
116## Gene Filtering
118After filtering cells, remove genes detected in fewer than 20 cells:
119- **Why 20?**: Balances noise reduction with information retention
120- **Benefits**: Reduces dataset size, speeds up computation, removes noisy genes
121- **Trade-offs**: May lose very rare markers; adjust to 10 if studying rare populations

Gene Filtering

After filtering cells, remove genes detected in fewer than 20 cells:

  • Why 20?: Balances noise reduction with information retention
  • Benefits: Reduces dataset size, speeds up computation, removes noisy genes
  • Trade-offs: May lose very rare markers; adjust to 10 if studying rare populations
Raw lines 116 to 122
123## Species-Specific Considerations

Species-Specific Considerations

Raw lines 123 to 124
125### Mouse (Mus musculus)
126- Mitochondrial genes: mt-* (lowercase)
127- Ribosomal genes: Rpl*, Rps* (capitalized first letter)
128- Hemoglobin genes: Hb* (but not Hbp1)

Mouse (Mus musculus)

  • Mitochondrial genes: mt-* (lowercase)
  • Ribosomal genes: Rpl*, Rps* (capitalized first letter)
  • Hemoglobin genes: Hb* (but not Hbp1)
Raw lines 125 to 129
130### Human (Homo sapiens)
131- Mitochondrial genes: MT-* (uppercase)
132- Ribosomal genes: RPL*, RPS* (all uppercase)
133- Hemoglobin genes: HB* (but not HBP1)

Human (Homo sapiens)

  • Mitochondrial genes: MT-* (uppercase)
  • Ribosomal genes: RPL*, RPS* (all uppercase)
  • Hemoglobin genes: HB* (but not HBP1)
Raw lines 130 to 134
135### Other Species
136Adjust gene name patterns in the script to match your organism's gene nomenclature. Consult Ensembl or your reference annotation for correct prefixes.

Other Species

Adjust gene name patterns in the script to match your organism's gene nomenclature. Consult Ensembl or your reference annotation for correct prefixes.

Raw lines 135 to 137
138## When to Adjust Parameters
140Consider adjusting filtering thresholds when:
142**More stringent (lower MADs)**
143- High ambient RNA contamination suspected
144- Many low-quality cells observed in visualizations
145- Downstream analysis shows quality-driven clustering
147**More permissive (higher MADs)**
148- Studying rare cell populations
149- Dataset has high technical quality
150- Cell types naturally have extreme values (e.g., neurons with high MT%)
152**Tissue-specific adjustments**
153- Brain/neurons: May need higher MT% threshold (10-15%)
154- Blood: Can be more stringent with MT% (5-8%)
155- Tumor samples: Often need more permissive thresholds due to biological variation

When to Adjust Parameters

Consider adjusting filtering thresholds when:

More stringent (lower MADs)

  • High ambient RNA contamination suspected
  • Many low-quality cells observed in visualizations
  • Downstream analysis shows quality-driven clustering

More permissive (higher MADs)

  • Studying rare cell populations
  • Dataset has high technical quality
  • Cell types naturally have extreme values (e.g., neurons with high MT%)

Tissue-specific adjustments

  • Brain/neurons: May need higher MT% threshold (10-15%)
  • Blood: Can be more stringent with MT% (5-8%)
  • Tumor samples: Often need more permissive thresholds due to biological variation
Raw lines 138 to 156
157## Advanced QC Considerations

Advanced QC Considerations

Raw lines 157 to 158
159### Not Included in This Workflow
161**Ambient RNA correction**
162- Tool: SoupX, CellBender, DecontX
163- When: High background RNA in droplet-based data
164- Effect: Removes contamination from lysed cells
166**Doublet detection**
167- Tool: scDblFinder, scrublet, DoubletFinder
168- When: Always recommended for droplet-based data
169- Effect: Identifies and removes multiplets (2+ cells in one droplet)
171**Cell cycle scoring**
172- Tool: scanpy's score_genes_cell_cycle
173- When: Cell cycle effects confound biological signal
174- Effect: Allows regressing out or accounting for cell cycle phase
176**Batch correction**
177- Tool: Harmony, scVI, ComBat
178- When: Integrating data from multiple batches/experiments
179- Effect: Removes technical batch effects while preserving biology

Not Included in This Workflow

Ambient RNA correction

  • Tool: SoupX, CellBender, DecontX
  • When: High background RNA in droplet-based data
  • Effect: Removes contamination from lysed cells

Doublet detection

  • Tool: scDblFinder, scrublet, DoubletFinder
  • When: Always recommended for droplet-based data
  • Effect: Identifies and removes multiplets (2+ cells in one droplet)

Cell cycle scoring

  • Tool: scanpy's score_genes_cell_cycle
  • When: Cell cycle effects confound biological signal
  • Effect: Allows regressing out or accounting for cell cycle phase

Batch correction

  • Tool: Harmony, scVI, ComBat
  • When: Integrating data from multiple batches/experiments
  • Effect: Removes technical batch effects while preserving biology
Raw lines 159 to 180
181## References
183- scverse Best Practices: https://www.sc-best-practices.org/preprocessing_visualization/quality_control.html
184- Luecken & Theis (2019): Current best practices in single-cell RNA-seq analysis
185- Osorio & Cai (2021): Systematic determination of the mitochondrial proportion in human and mouse genomes
186- Germain et al. (2020): Doublet identification in single-cell sequencing data using scDblFinder

References

  • scverse Best Practices: https://www.sc-best-practices.org/preprocessing_visualization/quality_control.html
  • Luecken & Theis (2019): Current best practices in single-cell RNA-seq analysis
  • Osorio & Cai (2021): Systematic determination of the mitochondrial proportion in human and mouse genomes
  • Germain et al. (2020): Doublet identification in single-cell sequencing data using scDblFinder
Raw lines 181 to 186