TigerZheng commited on
Commit
bd20933
·
verified ·
1 Parent(s): a177df3

Update PFCdevApp.qmd

Browse files
Files changed (1) hide show
  1. PFCdevApp.qmd +25 -41
PFCdevApp.qmd CHANGED
@@ -55,13 +55,7 @@ Spatial data
55
  </p>
56
 
57
  <p style="font-size: 20px; text-align: justify;">
58
- We collected the whole brain stereo-seq datasets of P1 and Adult mice from [(Han et al., Neuron, 2025)](https://doi.org/10.1016/j.neuron.2025.02.015
59
-
60
-
61
-
62
-
63
-
64
- , extracted and analyzed the PFC brain region. Users can browse the following content through the spatial page:
65
  </p>
66
 
67
  - Spatial Clustering: Select different cell subtypes to view their spatial distribution
@@ -98,6 +92,10 @@ seu.downsample$orig.ident[seu.downsample$orig.ident == "P0"] <- "P1"
98
  seu.downsample$orig.ident <- factor(seu.downsample$orig.ident,
99
  levels = c("P1","P4","P10","Adult"))
100
  seu.downsample$SubType <- seu.downsample$SubType_v4
 
 
 
 
101
 
102
  # spatial
103
  column <- c("x_rotated","y_rotated","Im.L2.3.IT","Im.L4.5.IT","Im.L5.IT","Im.L6.IT","L2.3.IT","L4.5.IT","L5.IT","L6.IT","L5.PT","L5.NP","L6.CT","Lamp5","Pvalb","Sst","Vip","NPC","Astro","Endo","Microglia","Oligo","OPC")
@@ -159,35 +157,36 @@ plotOutput('cluster_plot')
159
 
160
  #### Column
161
 
162
-
163
  ```{r}
164
- plotOutput('vln_plot')
165
  ```
166
 
 
167
  ### Row
168
 
169
  #### Column
170
 
171
  ```{r}
172
- plotOutput('gene_plot')
173
  ```
174
 
175
 
176
  ```{r}
177
  #| context: server
178
 
179
- output$cluster_plot <- renderPlot({
180
  if (input$dataset=="Neurons"){
181
- seu <- subset(seu.downsample, cells = colnames(seu.downsample)[seu.downsample$MainType %in% c("Excitatory", "Inhibitory")])
 
 
182
  }else{
183
- seu <- seu.downsample
184
  }
185
- seu@meta.data[,input$celltype] <- factor(
186
- seu@meta.data[,input$celltype],
187
- levels = names(col_cluster[[input$celltype]])
188
- )
189
  DimPlot(
190
- seu,
191
  reduction = 'umap',
192
  group.by = input$celltype,
193
  split.by = "orig.ident",
@@ -204,30 +203,10 @@ output$cluster_plot <- renderPlot({
204
  guides(color = guide_legend(ncol = 1, override.aes = list(size = 3)))
205
  })
206
 
207
- output$vln_plot <- renderPlot({
208
- if (input$dataset=="Neurons"){
209
- seu3 <- subset(seu.downsample, cells = colnames(seu.downsample)[seu.downsample$MainType %in% c("Excitatory", "Inhibitory")])
210
- }else{
211
- seu3 <- seu.downsample
212
- }
213
- seu3@meta.data[,input$celltype] <- factor(
214
- seu3@meta.data[,input$celltype],
215
- levels = names(col_cluster[[input$celltype]])
216
- )
217
- VlnPlot(seu.downsample, features = input$gene, group.by = input$celltype,
218
- col = col_cluster[[input$celltype]]) +
219
- NoLegend() +
220
- labs(x="")
221
- })
222
 
223
  output$gene_plot <- renderPlot({
224
- if (input$dataset=="Neurons"){
225
- seu <- subset(seu.downsample, cells = colnames(seu.downsample)[seu.downsample$MainType %in% c("Excitatory", "Inhibitory")])
226
- }else{
227
- seu <- seu.downsample
228
- }
229
  FeaturePlot(
230
- seu,
231
  features = input$gene,
232
  reduction = 'umap',
233
  split.by = "orig.ident",
@@ -242,10 +221,15 @@ output$gene_plot <- renderPlot({
242
  coord_fixed() &
243
  scale_color_gradientn(colours = c("lightblue3", "lightblue", "white", "red", "red4"), limits=c(0,2), breaks=c(0,2), na.value = "red4")
244
  })
245
- ```
246
-
247
 
248
 
 
 
 
 
 
 
 
249
 
250
 
251
 
 
55
  </p>
56
 
57
  <p style="font-size: 20px; text-align: justify;">
58
+ We collected the whole brain stereo-seq datasets of P1 and Adult mice from [(Han et al., Neuron, 2025)](https://doi.org/10.1016/j.neuron.2025.02.015, extracted and analyzed the PFC brain region. Users can browse the following content through the spatial page:
 
 
 
 
 
 
59
  </p>
60
 
61
  - Spatial Clustering: Select different cell subtypes to view their spatial distribution
 
92
  seu.downsample$orig.ident <- factor(seu.downsample$orig.ident,
93
  levels = c("P1","P4","P10","Adult"))
94
  seu.downsample$SubType <- seu.downsample$SubType_v4
95
+ seu.downsample$SubType <- factor(seu.downsample$SubType,
96
+ levels = names(col_cluster[["SubType"]]))
97
+ seu.downsample$MainType <- factor(seu.downsample$MainType,
98
+ levels = names(col_cluster[["MainType"]]))
99
 
100
  # spatial
101
  column <- c("x_rotated","y_rotated","Im.L2.3.IT","Im.L4.5.IT","Im.L5.IT","Im.L6.IT","L2.3.IT","L4.5.IT","L5.IT","L6.IT","L5.PT","L5.NP","L6.CT","Lamp5","Pvalb","Sst","Vip","NPC","Astro","Endo","Microglia","Oligo","OPC")
 
157
 
158
  #### Column
159
 
 
160
  ```{r}
161
+ plotOutput('gene_plot')
162
  ```
163
 
164
+
165
  ### Row
166
 
167
  #### Column
168
 
169
  ```{r}
170
+ plotOutput('vln_plot')
171
  ```
172
 
173
 
174
  ```{r}
175
  #| context: server
176
 
177
+ seu <- reactive({
178
  if (input$dataset=="Neurons"){
179
+ subset(seu.downsample,
180
+ cells = colnames(seu.downsample)[seu.downsample$MainType %in%
181
+ c("Excitatory", "Inhibitory")])
182
  }else{
183
+ seu.downsample
184
  }
185
+ })
186
+
187
+ output$cluster_plot <- renderPlot({
 
188
  DimPlot(
189
+ seu(),
190
  reduction = 'umap',
191
  group.by = input$celltype,
192
  split.by = "orig.ident",
 
203
  guides(color = guide_legend(ncol = 1, override.aes = list(size = 3)))
204
  })
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
 
207
  output$gene_plot <- renderPlot({
 
 
 
 
 
208
  FeaturePlot(
209
+ seu(),
210
  features = input$gene,
211
  reduction = 'umap',
212
  split.by = "orig.ident",
 
221
  coord_fixed() &
222
  scale_color_gradientn(colours = c("lightblue3", "lightblue", "white", "red", "red4"), limits=c(0,2), breaks=c(0,2), na.value = "red4")
223
  })
 
 
224
 
225
 
226
+ output$vln_plot <- renderPlot({
227
+ VlnPlot(seu(), features = input$gene, group.by = input$celltype,
228
+ col = col_cluster[[input$celltype]]) +
229
+ NoLegend() +
230
+ labs(x="")
231
+ })
232
+ ```
233
 
234
 
235