View source: R/vis_grid_clus.R
vis_grid_clus | R Documentation |
This function visualizes the clusters for a set of samples at the spot-level
using (by default) the histology information on the background. To visualize
gene-level (or any continuous variable) use vis_grid_gene()
.
vis_grid_clus(
spe,
clustervar,
pdf_file,
sort_clust = TRUE,
colors = NULL,
return_plots = FALSE,
spatial = TRUE,
height = 24,
width = 36,
image_id = "lowres",
alpha = NA,
sample_order = unique(spe$sample_id),
point_size = 2,
auto_crop = TRUE,
na_color = "#CCCCCC40",
is_stitched = FALSE,
...
)
spe |
A
SpatialExperiment-class
object. See |
clustervar |
A |
pdf_file |
A |
sort_clust |
A |
colors |
A vector of colors to use for visualizing the clusters
from |
return_plots |
A |
spatial |
A |
height |
A |
width |
A |
image_id |
A |
alpha |
A |
sample_order |
A |
point_size |
A |
auto_crop |
A |
na_color |
A |
is_stitched |
A |
... |
Passed to paste0() for making the title of the
plot following the |
This function prepares the data and then loops through
vis_clus()
for computing the list of ggplot2
objects.
A list of ggplot2 objects.
Other Spatial cluster visualization functions:
frame_limits()
,
vis_clus()
,
vis_clus_p()
if (enough_ram()) {
## Obtain the necessary data
if (!exists("spe")) spe <- fetch_data("spe")
## Subset to two samples of interest and obtain the plot list
p_list <-
vis_grid_clus(
spe[, spe$sample_id %in% c("151673", "151674")],
"layer_guess_reordered",
spatial = FALSE,
return_plots = TRUE,
sort_clust = FALSE,
colors = libd_layer_colors
)
## Visualize the spatial adjacent replicates for position = 0 micro meters
## for subject 3
cowplot::plot_grid(plotlist = p_list, ncol = 2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.