scrnaseq-trajectory-analysis
Skill4 starsChanged 12 days agoMITView on GitHub
Pseudotime inference and RNA velocity analysis of single-cell RNA-seq data using Monocle3 and scVelo.
In this repository56 other files it gives its agents.
- bioinformatics-env-setupSkill
- design-thermostable-mutationsSkill
- download-gdcSkill
- download-geoSkill
- download-sraSkill
- source-summarizerSkill
- genome-alignment-qcSkill
- genome-read-alignmentSkill
- genome-variant-annotationSkill
- genome-variant-callingSkill
- genome-variant-filteringSkill
- metagenome-assemblySkill
- metagenome-binningSkill
- metagenome-functional-profilingSkill
- metagenome-host-removalSkill
- metagenome-taxonomic-profilingSkill
- ncbi-eutilities-assistantSkill
- ngs-quality-controlSkill
- ngs-read-preprocessingSkill
- paper-to-briefSkill
- predict-protein-heat-stabilitySkill
- researchSkill
- rnaseq-alignment-qcSkill
- rnaseq-differential-expressionSkill
- rnaseq-functional-enrichmentSkill
- rnaseq-read-alignmentSkill
- rnaseq-read-countingSkill
- rnaseq-transcript-quantificationSkill
- rpsblast-assistantSkill
- scrnaseq-cellranger-countSkill
- scrnaseq-cell-type-annotationSkill
- scrnaseq-clusteringSkill
- scrnaseq-differential-expressionSkill
- scrnaseq-integrationSkill
- scrnaseq-quality-controlSkill
- search-enaSkill
- search-geoSkill
- search-gsaSkill
- search-ncbi-datasetsSkill
- search-sraSkill
- stat-analyze-distributionSkill
- stat-assess-data-qualitySkill
- stat-bayesian-estimationSkill
- stat-cluster-samplesSkill
- stat-compare-multiple-groupsSkill
- stat-compare-two-groupsSkill
- stat-fit-glmSkill
- stat-fit-linear-modelSkill
- stat-learn-bayesian-networkSkill
- stat-logistic-regressionSkill
- stat-nonlinear-embeddingSkill
- stat-pairwise-correlationSkill
- stat-pcaSkill
- stat-survival-analysisSkill
- structured-intelligence-skill-creatorSkill
- <skill-id>Skill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Run learn_graph() to fit a principal graph through the UMAP embedding.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: scRNA-seq Trajectory Analysis
Use When
- User wants to infer developmental or differentiation trajectories from a single-cell dataset.
- User wants to order cells along a pseudotime axis representing a biological process (e.g., differentiation, activation, cell cycle).
- User wants to compute RNA velocity to infer the future transcriptional state of cells from spliced/unspliced read ratios.
- User wants to identify genes that change significantly along a trajectory.
Inputs
- Required:
- Clustered and annotated AnnData (.h5ad) or Seurat object (.rds) with UMAP coordinates
- Optional:
- Analysis type:
pseudotime,velocity, orboth(default:pseudotime) - Pseudotime tool:
monocle3ordiffusion-pseudotime(default:monocle3) - Root cell cluster or cell type (required for pseudotime; must be biologically the starting state)
- For RNA velocity: spliced/unspliced count matrices as a loom file (
velocytooutput) or STARsolo with--soloFeatures Velocyto - Velocity model:
stochasticordynamical(default:stochastic; usedynamicalfor more accuracy at higher compute cost) - Gene significance threshold for pseudotime-variable genes (default: q-value < 0.05)
- Analysis type:
Workflow
Pseudotime (Monocle3)
- Convert the AnnData or Seurat object to a Monocle3 CellDataSet using
as.cell_data_set()(Seurat) or thescverseMonocle3 bridge. - Run
learn_graph()to fit a principal graph through the UMAP embedding. The graph represents the trajectory topology. - Set root cells by specifying the root cluster or cell type. If multiple root candidates exist, present options to the user. Root selection must be biologically justified (earliest developmental state, undifferentiated progenitors, etc.).
- Order cells along pseudotime with
order_cells(). Inspect the pseudotime UMAP plot for biological plausibility (expected early → late ordering). - Identify genes that change significantly along the principal graph using
graph_test()(Moran's I spatial autocorrelation). Retain genes with q-value < 0.05. - Plot gene expression trends along pseudotime for the top significant genes (
plot_genes_in_pseudotime).
RNA Velocity (scVelo)
- Generate spliced/unspliced/ambiguous count matrices:
- Using velocyto CLI:
velocyto run10xon the Cell Ranger output BAM and genome GTF. - Using STARsolo: add
--soloFeatures Velocytoto the STAR command during alignment.
- Using velocyto CLI:
- Load the loom file alongside the AnnData object; merge spliced, unspliced, and ambiguous layers.
- Preprocess velocity data:
scv.pp.filter_and_normalize()(filter genes with insufficient spliced/unspliced counts),scv.pp.moments()(compute first and second-order moments of gene expression for neighbors). - Estimate RNA velocity:
- Stochastic model:
scv.tl.velocity(mode='stochastic')— fast, suitable for exploratory analysis. - Dynamical model:
scv.tl.recover_dynamics()thenscv.tl.velocity(mode='dynamical')— more accurate, identifies kinetic rate parameters (transcription, splicing, degradation rates).
- Stochastic model:
- Compute velocity graph:
scv.tl.velocity_graph(). Project velocity arrows onto the UMAP:scv.pl.velocity_embedding_stream(). - Identify velocity genes (genes driving the velocity signal):
scv.tl.rank_velocity_genes(). - Compute latent time (a global pseudotime derived from velocity):
scv.tl.latent_time()(dynamical model only).
Output Contract
- Updated AnnData (.h5ad) or Seurat/CellDataSet object with pseudotime values and/or velocity embeddings
- UMAP colored by pseudotime (PDF)
- Velocity stream plot on UMAP (PDF)
- Pseudotime-variable genes table (TSV): gene, Moran's I, q-value, spatial autocorrelation
- Gene expression along pseudotime plots for top 10 genes (PDF)
- Velocity genes table (TSV): gene, velocity score, rank
- Latent time UMAP (PDF, dynamical model only)
Limits
- Pseudotime assumes a continuous biological process; applying it to unrelated or discrete cell populations produces meaningless orderings.
- Root cell selection requires biological prior knowledge; incorrect root selection produces reversed or meaningless pseudotime.
- RNA velocity requires spliced/unspliced count matrices generated at the alignment step; these are not produced by default Cell Ranger output and must be generated separately with velocyto or STARsolo.
- The dynamical scVelo model requires significantly more computation time (hours for large datasets) and convergence is not guaranteed for all genes.
- Trajectory analysis is sensitive to clustering quality; poorly resolved clusters lead to discontinuous or looped trajectories.
- RNA velocity assumptions (constant kinetics) may not hold in rapidly changing systems; interpret velocity arrows as directional tendencies, not deterministic predictions.
- Common failure cases:
- Monocle3
learn_graph()producing a disconnected graph; increaseminimal_branch_lenor ensure the UMAP has smooth transitions between related clusters. - scVelo
recover_dynamics()failing due to insufficient cells expressing a gene in both spliced and unspliced forms; lower themin_shared_countsthreshold. - Velocyto CLI running for many hours on large BAM files; consider using STARsolo
--soloFeatures Velocytoduring alignment instead.
- Monocle3
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

