HSVOverlay | R Documentation |
Graphs the selected features as a HSVplot on a 2D grid of spots overlaid on top of an HE images. Only numerical features are accepted, e.g. genes or dimensionality reduction output vectors. If you want to draw dimentionality reduction vectors you need to specify the whole names of the vectors, e.g. 'features = c("factor_1", "factor_2")' for the two first NMF factors.
HSVOverlay( object, features, sampleids = 1, rescale = TRUE, spots = NULL, ncols.features = NULL, ncols.samples = NULL, type = NULL, min.cutoff = NA, max.cutoff = NA, slot = "data", pt.size = 2, pt.alpha = 1, add.alpha = FALSE, palette = NULL, cols = NULL, split.hsv = FALSE, dark.theme = FALSE, sample.label = TRUE, show.sb = TRUE, verbose = FALSE, ... )
object |
Seurat object |
features |
|
sampleids |
Names of samples to plot |
rescale |
Rescale each feature column separately from 0 to 1 range. If set to FALSE, all feature columns will be scaled together from 0 to 1 and preserve the relative differencies |
spots |
Character vector with spot IDs to plot [default: all spots] |
ncols.features |
Number of columns passed to |
ncols.samples |
Number of columns in the layout grid for the samples. For example,
if you are plotting 4 samples, 'ncols.samples = 2' will arrange the plots obtained
from |
type |
Image type to plot on. Here you can specify any of the images available in your Seurat object. To get this list you can
run the |
min.cutoff |
Vector of minimum and maximum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10'). This can be useful if you have outlier values that skew the colorscale in the plot. For example, if you specify 'q1', you will trim of values below the 1st percentile. [default: no cuttoffs] |
max.cutoff |
Vector of minimum and maximum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10'). This can be useful if you have outlier values that skew the colorscale in the plot. For example, if you specify 'q1', you will trim of values below the 1st percentile. [default: no cuttoffs] |
slot |
Which slot to pull expression data from? [dafault: 'data'] |
pt.size |
Point size of each ST spot [default: 1] |
pt.alpha |
Opacity of each ST spot [default: 1] |
add.alpha |
Scale spot opacity by selected feature. Higher values get more opaque while lower values make spots transparent. |
palette |
Color palette used for spatial heatmap (see |
cols |
A vector of colors to use for colorscale, e.g. |
split.hsv |
Should the HSV colored features be split into separate plots? [default: FALSE] |
dark.theme |
Switches color of scalebar to 'white' |
sample.label |
Should the sample label be included in the image? [default: TRUE] |
show.sb |
Should a scalebar be drawn? [default: TRUE] |
verbose |
Print messages |
... |
Parameters passed to DimOverlay |
NOTE that this function draws sample 1 as default, but can take multiple samples as well using the 'sampleids argument'.
It is typically difficult to explore details in the HE image when diplaying multiple samples side by side, so we recommend to draw the plots for one sample at the time. If you have higher resolution images, it could also take significant time to draw the plots.
The 'ncols.features' argument will determine how each subplot called using
DimOverlay
is arranged and will by default put all dims in 1 row, i.e.
'ncols.features = length(features)'. The 'ncols.samples' argument will determine how these subplots
are arranged and will by default use 1 column, meaning that each subplot is put in its own row.
The output layout matrix would then have the dimensions 'length(samples)xlength(features)'
The 'ncols.features' argument will determine how each subplot is arranged and will by default put all features in 1 row, i.e. 'ncols.features = length(features)'. The 'ncols.samples' argument will determine how these subplots are arranged and will by default use 1 column, meaning that each subplot is put in its own row. The output layout matrix would then have the dimensions 'length(samples)xlength(features)'
If you are plotting a categorical feature, e.g.cluster labels, you have the option to split each label into facets using split.labels=TRUE
.
This is very useful if you have many different labels which can make it difficult to distinguish the different colors.
## Not run: # Load images se <- se %>% SCTransfrom() %>% LoadImages() %>% RunNMF() # Overlay first two NMF factors on the first two tissue sections HSVPlot(se, features = c("factor_1", "factor_2"), sampleids = 1:2) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.