Skip to content

Commit

Permalink
update ggpavis
Browse files Browse the repository at this point in the history
  • Loading branch information
stemangiola committed May 19, 2024
1 parent 284c4c0 commit 161135d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
7 changes: 6 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ Suggests:
rmarkdown,
pkgdown
Biarch: true
Remotes: lmweber/ggspavis
Remotes:
lmweber/ggspavis,
stemangiola/tidySummarizedExperiment,
stemangiola/tidySpatialExperiment,
stemangiola/tidybulk,
stemangiola/tidygate
URL: https://tidyomics.github.io/tidySpatialWorkshop2024
BugReports: https://github.com/tidyomics/tidySpatialWorkshop2024/issues/new/choose
VignetteBuilder: knitr
Expand Down
19 changes: 10 additions & 9 deletions vignettes/Session_1_sequencing_assays.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -522,15 +522,16 @@ Those two clusters group the white matter from the rest of the layers.

```{r, fig.width=7, fig.height=8}
## Plot in tissue map
ggspavis::plotSpots(spatial_data, annotate = "label") + scale_color_brewer(palette = "Paired")
ggspavis::plotSpots(spatial_data, annotate = "label") +
scale_color_brewer(palette = "Paired")
```

As for comparison, we show the manually annotated regions. We can see that while the single cell style clustering catchers, the overall tissue, architecture, a lot of details are not retrieved. We clusters cannot faithfully recapitulate the tissue morphology. However, they might represent specific cell types within morphological regions.

```{r, fig.width=7, fig.height=8}
## Plot ground truth in tissue map
ggspavis::plotSpots(spatial_data, annotate = "spatialLIBD",
palette = "libd_layer_colors")
ggspavis::plotSpots(spatial_data, annotate = "spatialLIBD") +
scale_color_manual(values = libd_layer_colors |> str_remove("ayer")) +
```

Expand Down Expand Up @@ -691,16 +692,16 @@ pal <- c(
)
plot_bank_smooth <- lapply(spatial_data_list, function(x) {
plotSpots(x, annotate = sprintf("%s_smooth", "clust_M0_lam0.2_k50_res0.7"), pal = pal) +
ggspavis::plotSpots(x, annotate = sprintf("%s_smooth", "clust_M0_lam0.2_k50_res0.7"), pal = pal) +
theme(legend.position = "none") +
labs(title = "BANKSY clusters")
})
plot_grid(plotlist = plot_bank_smooth, ncol = 3, byrow = TRUE)
plotSpots(spatial_data, annotate = "spatialLIBD",
palette = "libd_layer_colors") +
ggspavis::plotSpots(spatial_data, annotate = "spatialLIBD") +
scale_color_manual(values = libd_layer_colors |> str_remove("ayer")) +
theme(legend.position = "none") +
labs(title = "spatialLIBD regions")
```
Expand All @@ -720,7 +721,7 @@ We have applied cluster smoothing using `smoothLabels`. How much do you think th
spe_joint <- do.call(cbind, spatial_data_list)
plotSpots(spe_joint, annotate = sprintf("%s", "clust_M0_lam0.2_k50_res0.7"), size = 0.8, pal = pal) +
ggspavis::plotSpots(spe_joint, annotate = sprintf("%s", "clust_M0_lam0.2_k50_res0.7"), size = 0.8, pal = pal) +
theme(legend.position = "none") +
labs(title = "BANKSY clusters")
Expand Down Expand Up @@ -981,12 +982,12 @@ is_endothelial_oligodendrocytes = mat_df$endothelial_cell >0.1 & mat_df$oligoden
spatial_data$is_endothelial_leptomeningeal = is_endothelial_leptomeningeal
spatial_data$is_endothelial_oligodendrocyte = is_endothelial_oligodendrocytes
plotSpots(spatial_data, annotate = "is_endothelial_leptomeningeal") +
ggspavis::plotSpots(spatial_data, annotate = "is_endothelial_leptomeningeal") +
scale_color_manual(values = c("TRUE"= "red", "FALSE" = "grey"))
theme(legend.position = "none") +
labs(title = "endothelial + leptomeningeal")
plotSpots(spatial_data, annotate = "is_endothelial_oligodendrocyte") +
ggspavis::plotSpots(spatial_data, annotate = "is_endothelial_oligodendrocyte") +
scale_color_manual(values = c("TRUE"= "blue", "FALSE" = "grey"))
theme(legend.position = "none") +
labs(title = "endothelial + oligodendrocyte")
Expand Down
12 changes: 4 additions & 8 deletions vignettes/Session_2_Tidy_spatial_analyses.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,8 @@ We can visualise the gating
spatial_data |>
# Plot our gate
plotSpots(
annotate = ".gate",
palette = "libd_layer_colors"
) +
ggspavis::plotSpots(annotate = ".gate") +
scale_color_manual(values = libd_layer_colors |> str_remove("ayer")) +
labs(title = ".gate regions")
```
Expand Down Expand Up @@ -507,10 +505,8 @@ Let’s visualise the regions that spatialLIBD labelled across three Visium 10X

```{r, fig.width=7, fig.height=8}
spatial_data_filtered |>
plotSpots(
annotate = "spatialLIBD",
palette = "libd_layer_colors"
) +
ggspavis::plotSpots(annotate = "spatialLIBD") +
scale_color_manual(values = libd_layer_colors |> str_remove("ayer")) +
theme(legend.position = "none") +
labs(title = "spatialLIBD regions")
```
Expand Down
5 changes: 3 additions & 2 deletions vignettes/Session_3_imaging_assays.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,9 @@ Plot ground truth in tissue map
tx_spe_sample_1 |>
mutate(in_tissue = TRUE) |>
plotSpots(annotate = "region",
palette = colorRampPalette( brewer.pal(9,"Set1") )(150)
ggspavis::plotSpots(
annotate = "region",
palette = colorRampPalette( brewer.pal(9,"Set1") )(150)
) +
guides(color = "none")
Expand Down

0 comments on commit 161135d

Please sign in to comment.