TigerZheng commited on
Commit
d76e54c
·
verified ·
1 Parent(s): f94aa02

Update PFCapp.qmd

Browse files
Files changed (1) hide show
  1. PFCapp.qmd +12 -11
PFCapp.qmd CHANGED
@@ -448,7 +448,7 @@ sp_Barcode <- c("ITi-M1","ITi-M2","ITc-M3", "PTi",
448
  'LHA-I')
449
  waiter::use_waiter()
450
  selectInput('subtype_3d', 'Select SubType', sort(unique(sp.PFC$SubType)))
451
- selectInput('target_3d', 'Select Target', sp_Barcode)
452
  ```
453
 
454
 
@@ -462,14 +462,10 @@ rglwidgetOutput('spatial_subtype', width = "100%")
462
  ```{r}
463
  #| context: server
464
 
465
- observeEvent(input$target_3d,{
466
  waiter::Waiter$new(id = "spatial_subtype", color="black")$show()
467
  output$spatial_subtype <- renderRglwidget({
468
- if (input$target_3d %in% c("ITi-M1","ITi-M2","ITc-M3", "PTi")){
469
- df_plot <- sp.PFC@meta.data[which(sp.PFC$Proj_module==input$target_3d),]
470
- }else{
471
- df_plot <- sp.PFC@meta.data[which(sp.PFC@meta.data[,input$target_3d] > 0),]
472
- }
473
 
474
  open3d()
475
  bg3d(color = "black")
@@ -485,15 +481,20 @@ observeEvent(input$target_3d,{
485
  spheres3d(x = df_plot$ML_new,
486
  y = df_plot$DV_new,
487
  z = df_plot$AP_new,
488
- col = col_subtype_target[input$target_3d], radius=0.01, alpha=1)
489
  rglwidget()
490
  })
491
  })
492
 
493
- observeEvent(input$subtype_3d,{
 
494
  waiter::Waiter$new(id = "spatial_subtype", color="black")$show()
495
  output$spatial_subtype <- renderRglwidget({
496
- df_plot <- sp.PFC@meta.data[which(sp.PFC$SubType == input$subtype_3d),]
 
 
 
 
497
 
498
  open3d()
499
  bg3d(color = "black")
@@ -509,7 +510,7 @@ observeEvent(input$subtype_3d,{
509
  spheres3d(x = df_plot$ML_new,
510
  y = df_plot$DV_new,
511
  z = df_plot$AP_new,
512
- col = col_subtype_target[input$subtype_3d], radius=0.01, alpha=1)
513
  rglwidget()
514
  })
515
  })
 
448
  'LHA-I')
449
  waiter::use_waiter()
450
  selectInput('subtype_3d', 'Select SubType', sort(unique(sp.PFC$SubType)))
451
+ selectInput('target_3d', 'Select Target', sp_Barcode, selected = "PTi")
452
  ```
453
 
454
 
 
462
  ```{r}
463
  #| context: server
464
 
465
+ observeEvent(input$subtype_3d,{
466
  waiter::Waiter$new(id = "spatial_subtype", color="black")$show()
467
  output$spatial_subtype <- renderRglwidget({
468
+ df_plot <- sp.PFC@meta.data[which(sp.PFC$SubType == input$subtype_3d),]
 
 
 
 
469
 
470
  open3d()
471
  bg3d(color = "black")
 
481
  spheres3d(x = df_plot$ML_new,
482
  y = df_plot$DV_new,
483
  z = df_plot$AP_new,
484
+ col = col_subtype_target[input$subtype_3d], radius=0.01, alpha=1)
485
  rglwidget()
486
  })
487
  })
488
 
489
+
490
+ observeEvent(input$target_3d,{
491
  waiter::Waiter$new(id = "spatial_subtype", color="black")$show()
492
  output$spatial_subtype <- renderRglwidget({
493
+ if (input$target_3d %in% c("ITi-M1","ITi-M2","ITc-M3", "PTi")){
494
+ df_plot <- sp.PFC@meta.data[which(sp.PFC$Proj_module==input$target_3d),]
495
+ }else{
496
+ df_plot <- sp.PFC@meta.data[which(sp.PFC@meta.data[,input$target_3d] > 0),]
497
+ }
498
 
499
  open3d()
500
  bg3d(color = "black")
 
510
  spheres3d(x = df_plot$ML_new,
511
  y = df_plot$DV_new,
512
  z = df_plot$AP_new,
513
+ col = col_subtype_target[input$target_3d], radius=0.01, alpha=1)
514
  rglwidget()
515
  })
516
  })