Step 11: Reactive Astrocyte Trajectory and lncRNA Discovery
Modeling astrocyte reactivity in PD using Slingshot pseudotime
Setup: Environment and Data
In this step, we shift from neuronal trajectory analysis to reactive astrocyte trajectory analysis.
The previous neuron-based analysis showed that the combined PD damage score was strongly cluster-dependent and did not cleanly separate PD from control. Therefore, in this module, we focus on astrocyte populations, especially the cluster annotated as Reactive Astrocyte.
The biological goal is to model a transition from:
Astrocyte
→ reactive astrocyte
→ stressed / inflammatory astrocyte state
This trajectory should be interpreted as an astrocyte reactivity trajectory, not a neuronal degeneration trajectory.
An object of class Seurat
47773 features across 43448 samples within 1 assay
Active assay: RNA (47773 features, 2000 variable features)
3 layers present: counts, data, scale.data
2 dimensional reductions calculated: pca, umap
Step 11.1: Check Current Cell Type Annotation
First, we confirm the cell type identities stored in the Seurat object.
Step 11.1: Check Current Cell Type Annotation
First, we confirm the cell type identities stored in the Seurat object.
# Show only the summary, not every single cell identitytable(Idents(SO))
An object of class Seurat
47773 features across 8952 samples within 1 assay
Active assay: RNA (47773 features, 2000 variable features)
3 layers present: counts, data, scale.data
2 dimensional reductions calculated: pca, umap
umap_astro <-reducedDims(sce_astro)$UMAPplot( umap_astro,col =as.factor(sce_astro$condition),pch =16,asp =1,xlab ="UMAP_1",ylab ="UMAP_2",main ="Slingshot Trajectory on Astrocyte UMAP")lines(SlingshotDataSet(sce_astro), lwd =2, col ="black")legend("topright",legend =levels(as.factor(sce_astro$condition)),col =seq_along(levels(as.factor(sce_astro$condition))),pch =16)
Step 11.11: Extract Astrocyte Pseudotime and Evaluate Lineages
Slingshot may return multiple lineages.
Therefore, we do not automatically choose the lineage with the largest number of cells.
Instead, we evaluate which lineage best represents astrocyte reactivity.
A biologically meaningful astrocyte reactivity lineage should show:
positive correlation with Reactive_astro_score
positive correlation with Stress_score
positive correlation with ECM_score
PD cells shifted toward later pseudotime
Lineage1 Lineage2 Lineage3 Lineage4 Lineage5
GSM6459689_AAACGAAAGTGCCGAA-1 NA NA 25.583213 NA NA
GSM6459689_AACAAAGAGGTTGCCC-1 NA NA 25.355640 NA NA
GSM6459689_AACAAAGTCGAGATGG-1 NA NA 25.340390 NA NA
GSM6459689_AACAAGATCGTAACTG-1 8.433124 8.411299 8.361028 8.513503 8.837918
GSM6459689_AACAGGGAGAACTTCC-1 NA NA 24.819177 NA NA
GSM6459689_AACCTGACACTTCATT-1 NA NA 24.601876 NA NA
# Number of cells assigned to each lineagelineage_cell_counts <-colSums(!is.na(astro_pseudotime_mat))lineage_cell_counts
Step 11.14: Validate Astrocyte Trajectory Direction
A meaningful astrocyte reactivity trajectory should show increasing reactive, stress, and ECM remodeling signatures along pseudotime.
astro_pt_df <- SO_astro@meta.data %>%rownames_to_column("cell_id") %>%filter(!is.na(astro_pseudotime))p1 <-ggplot( astro_pt_df,aes(x = astro_pseudotime, y = Reactive_astro_score1, color = condition)) +geom_point(alpha =0.25, size =0.5) +geom_smooth(method ="loess", se =TRUE) +theme_classic() +labs(title ="Reactive Astrocyte Score Along Pseudotime",x ="Astrocyte pseudotime",y ="Reactive astrocyte score" )p2 <-ggplot( astro_pt_df,aes(x = astro_pseudotime, y = Stress_score1, color = condition)) +geom_point(alpha =0.25, size =0.5) +geom_smooth(method ="loess", se =TRUE) +theme_classic() +labs(title ="Stress Score Along Pseudotime",x ="Astrocyte pseudotime",y ="Stress score" )p3 <-ggplot( astro_pt_df,aes(x = astro_pseudotime, y = ECM_score1, color = condition)) +geom_point(alpha =0.25, size =0.5) +geom_smooth(method ="loess", se =TRUE) +theme_classic() +labs(title ="ECM Remodeling Score Along Pseudotime",x ="Astrocyte pseudotime",y ="ECM score" )p4 <-ggplot( astro_pt_df,aes(x = astro_pseudotime, y = Inflammatory_score1, color = condition)) +geom_point(alpha =0.25, size =0.5) +geom_smooth(method ="loess", se =TRUE) +theme_classic() +labs(title ="Inflammatory Score Along Pseudotime",x ="Astrocyte pseudotime",y ="Inflammatory score" )(p1 | p2) / (p3 | p4)
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'
Step 11.15: Condition Distribution Along Astrocyte Pseudotime
ggplot( astro_pt_df,aes(x = astro_pseudotime, fill = condition)) +geom_density(alpha =0.4) +theme_classic() +labs(title ="Condition Distribution Along Astrocyte Pseudotime",x ="Astrocyte pseudotime",y ="Density" )
Step 11.16: Cluster Distribution Along Astrocyte Pseudotime
This plot helps determine whether pseudotime reflects a transition from baseline astrocyte clusters to reactive astrocyte clusters.
p_cluster_pt <-ggplot( astro_pt_df,aes(x =as.factor(seurat_clusters), y = astro_pseudotime, fill =as.factor(seurat_clusters))) +geom_boxplot(outlier.size =0.3) +theme_classic() +labs(title ="Astrocyte Pseudotime by Subcluster",x ="Astrocyte subcluster",y ="Astrocyte pseudotime" ) +NoLegend()p_cluster_pt
Step 11.17: Save Current Astrocyte Trajectory Progress
# Create results directory if it does not existresults_dir <-"/Users/yoshimurasouhei/Downloads/010_school/4年生/bioinfomaticsリサーチクラークシップ/PD_lncRNA_Trajectory_2026/results"scripts_dir <-"/Users/yoshimurasouhei/Downloads/010_school/4年生/bioinfomaticsリサーチクラークシップ/PD_lncRNA_Trajectory_2026/scripts"dir.create(results_dir, showWarnings =FALSE, recursive =TRUE)dir.create(scripts_dir, showWarnings =FALSE, recursive =TRUE)# 1. Save Seurat object with astrocyte pseudotimesaveRDS( SO_astro,file =file.path(scripts_dir, "SO_11_ReactiveAstrocytePseudotime_Lineage2.RDS"))# 2. Save lineage evaluation tablewrite.csv( lineage_eval,file =file.path(results_dir, "Step11_lineage_evaluation.csv"),row.names =FALSE)# 3. Save astrocyte pseudotime metadatawrite.csv( astro_pt_df,file =file.path(results_dir, "Step11_astrocyte_pseudotime_metadata.csv"),row.names =FALSE)# 4. Save pseudotime matrixwrite.csv(as.data.frame(astro_pseudotime_mat),file =file.path(results_dir, "Step11_slingshot_pseudotime_matrix.csv"),row.names =TRUE)# 5. Save cluster summary if it existsif (exists("astro_cluster_summary")) {write.csv( astro_cluster_summary,file =file.path(results_dir, "Step11_astrocyte_cluster_summary.csv"),row.names =FALSE )}print("Step 11 progress saved successfully.")