vis_clus_p | R Documentation |
This function visualizes the clusters for one given sample at the spot-level
using (by default) the histology information on the background. This is the
function that does all the plotting behind vis_clus()
. To visualize
gene-level (or any continuous variable) use vis_gene_p()
.
vis_clus_p(
spe,
d,
clustervar,
sampleid = unique(spe$sample_id)[1],
colors,
spatial,
title,
image_id = "lowres",
alpha = NA,
point_size = 2,
auto_crop = TRUE,
na_color = "#CCCCCC40"
)
spe |
A
SpatialExperiment-class
object. See |
d |
A |
clustervar |
A |
sampleid |
A |
colors |
A vector of colors to use for visualizing the clusters
from |
spatial |
A |
title |
The title for the plot. |
image_id |
A |
alpha |
A |
point_size |
A |
auto_crop |
A |
na_color |
A |
A ggplot2 object.
Other Spatial cluster visualization functions:
frame_limits()
,
vis_clus()
,
vis_grid_clus()
if (enough_ram()) {
## Obtain the necessary data
if (!exists("spe")) spe <- fetch_data("spe")
spe_sub <- spe[, spe$sample_id == "151673"]
## Use the manual color palette by Lukas M Weber
## Don't plot the histology information
p <- vis_clus_p(
spe = spe_sub,
d = as.data.frame(cbind(colData(spe_sub), SpatialExperiment::spatialCoords(spe_sub)), optional = TRUE),
clustervar = "layer_guess_reordered",
sampleid = "151673",
colors = libd_layer_colors,
title = "151673 LIBD Layers",
spatial = FALSE
)
print(p)
## Clean up
rm(spe_sub)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.