| name | single-cell-rna-seq |
| description | End-to-end single-cell RNA-seq analysis including data loading, QC, integration, clustering, cell type annotation, and differential expression. |
| metadata | {"skill-author":"Albert Ying"} |
Single-cell RNA-seq Analysis
When to use
- Processing 10X Genomics scRNA-seq data
- Multi-sample integration and batch correction
- Cell type identification using marker databases
- Condition-specific differential expression within cell types
Standard workflow
- Data loading: Read 10X MTX format (barcodes, features, matrix)
- QC filtering: Remove low-quality cells (low gene count, high mito%)
- Normalization: Library size normalization + log transformation
- Integration: Batch correction across samples if needed
- Clustering: PCA → neighbors → Leiden clustering
- Cell type annotation: Use known marker genes or reference databases
- Differential expression: Compare conditions within each cell type
Cell type annotation strategy
import pandas as pd
markers_db = pd.read_excel('Cell_marker_Seq.xlsx')
sc.tl.rank_genes_groups(adata, 'leiden', method='wilcoxon')
Differential expression between conditions
for cluster in adata.obs['leiden'].unique():
mask = adata.obs['leiden'] == cluster
sub = adata[mask].copy()
sc.tl.rank_genes_groups(sub, 'condition', method='wilcoxon',
groups=['post'], reference='pre')
result = sc.get.rank_genes_groups_df(sub, group='post')
Key decisions
- Use raw counts for DE analysis (not scaled data)
- Apply Benjamini-Hochberg correction for multiple testing
- Report both significant and non-significant results per cluster