Agent skill
seuratclusteringofallcells
Performs coarse clustering on ALL cells (including T cells, B cells, and non-T/B cells) before cell type selection. This process identifies broad cell populations to enable subsequent T/B cell selection via `TOrBCellSelection`. Unlike `SeuratClustering` which works on already-selected T/B cells, this provides initial clustering on heterogeneous cell populations.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/seuratclusteringofallcells
SKILL.md
SeuratClusteringOfAllCells Process Configuration
Purpose
Performs coarse clustering on ALL cells (including T cells, B cells, and non-T/B cells) before cell type selection. This process identifies broad cell populations to enable subsequent T/B cell selection via TOrBCellSelection. Unlike SeuratClustering which works on already-selected T/B cells, this provides initial clustering on heterogeneous cell populations.
When to Use
- Mixed cell populations: When your data contains both T/B cells AND non-T/B cells
- Pre-selection clustering: Required upstream of
TOrBCellSelectionprocess - Broad cell type identification: To identify major cell lineages before fine-grained analysis
- TCR/BCR data analysis: When you have scRNA-seq + scTCR/scBCR data with mixed populations
- Do NOT use when: All cells are already T/B cells (use
SeuratClusteringinstead)
Configuration Structure
Process Enablement
[SeuratClusteringOfAllCells]
cache = true
Input Specification
[SeuratClusteringOfAllCells.in]
srtobj = ["SeuratPreparing"]
Environment Variables
Core Parameters
[SeuratClusteringOfAllCells.envs]
ncores = 1
ident = "seurat_clusters"
cache = "/tmp"
FindNeighbors Parameters
[SeuratClusteringOfAllCells.envs.FindNeighbors]
k.param = 20
reduction = "pca"
dims = 30
prune.SNN = 0.067
RunUMAP Parameters
[SeuratClusteringOfAllCells.envs.RunUMAP]
reduction = "pca"
dims = 30
n.neighbors = 30
min.dist = 0.3
seed.use = 42
FindClusters Parameters
[SeuratClusteringOfAllCells.envs.FindClusters]
resolution = 0.5 # Use LOWER (0.2-0.8) for coarse clustering
algorithm = 4 # 4 = Leiden (recommended)
random.seed = 0
graph.name = "pca_snn"
External References
- FindNeighbors: https://satijalab.org/seurat/reference/findneighbors
- RunUMAP: https://satijalab.org/seurat/reference/runumap
- FindClusters: https://satijalab.org/seurat/reference/findclusters
All parameters identical to SeuratClustering.
Configuration Examples
Minimal Configuration
[SeuratClusteringOfAllCells]
[SeuratClusteringOfAllCells.in]
srtobj = ["SeuratPreparing"]
Standard Pre-selection Clustering
[SeuratClusteringOfAllCells]
[SeuratClusteringOfAllCells.envs.FindClusters]
resolution = 0.4
algorithm = 4
Multiple Resolutions
[SeuratClusteringOfAllCells]
[SeuratClusteringOfAllCells.envs.FindNeighbors]
k.param = 25
[SeuratClusteringOfAllCells.envs.FindClusters]
resolution = [0.2, 0.4, 0.6]
algorithm = 4
Integrated Data
[SeuratClusteringOfAllCells]
[SeuratClusteringOfAllCells.envs.FindNeighbors]
reduction = "integrated.cca"
[SeuratClusteringOfAllCells.envs.RunUMAP]
reduction = "integrated.cca"
[SeuratClusteringOfAllCells.envs.FindClusters]
resolution = 0.5
Common Patterns
Pattern 1: Coarse Clustering for Cell Type ID
[SeuratClusteringOfAllCells]
[SeuratClusteringOfAllCells.envs.FindClusters]
resolution = 0.3
algorithm = 4
Pattern 2: Resolution Sweep
[SeuratClusteringOfAllCells]
[SeuratClusteringOfAllCells.envs.FindClusters]
resolution = "0.2:0.8:0.2"
algorithm = 4
Pattern 3: Large Datasets
[SeuratClusteringOfAllCells]
[SeuratClusteringOfAllCells.envs]
ncores = 8
[SeuratClusteringOfAllCells.envs.FindNeighbors]
nn.method = "annoy"
dims = 25
Dependencies
Upstream
- Required:
SeuratPreparing
Downstream
- Required:
TOrBCellSelection - Optional:
ClusterMarkersOfAllCells,TopExpressingGenesOfAllCells
Validation Rules
Resolution Constraints
- Must be positive, single value or list
- Recommendation: Use lower resolutions (0.2-0.8)
Algorithm Selection
- Leiden (algorithm=4) recommended
Troubleshooting
Issue: T/B Cells Not Separated
Solution: Lower resolution to 0.3, increase k.param to 30
Issue: Too Many Clusters
Solution: Use coarse resolution (0.2)
Issue: Poor UMAP Separation
Solution: min.dist = 0.1, n.neighbors = 15
Key Differences from SeuratClustering
| Feature | SeuratClusteringOfAllCells | SeuratClustering |
|---|---|---|
| Timing | BEFORE T/B selection | AFTER T/B selection |
| Data scope | ALL cells (mixed) | Selected T/B cells |
| Resolution | LOWER (0.2-0.8) | HIGHER (0.8-1.5) |
| Purpose | Identify major lineages | Sub-cluster T/B |
Best Practices
- Use lower resolutions (0.2-0.8)
- Follow with TOrBCellSelection
- Leiden algorithm (algorithm=4) recommended
- Set random seeds for reproducibility
- Don't use when all cells are T/B cells
Related Processes
- TOrBCellSelection: Selects T/B cells
- SeuratClustering: Fine-grained clustering
- ClusterMarkersOfAllCells: Marker analysis before selection
Didn't find tool you were looking for?