Visualize expression in a spatial context
ImageFeaturePlot(
object,
features,
fov = NULL,
boundaries = NULL,
cols = if (isTRUE(x = blend)) {
c("lightgrey", "#ff0000", "#00ff00")
} else {
c("lightgrey", "firebrick1")
},
size = 0.5,
min.cutoff = NA,
max.cutoff = NA,
split.by = NULL,
molecules = NULL,
mols.size = 0.1,
mols.cols = NULL,
nmols = 1000,
alpha = 1,
border.color = "white",
border.size = NULL,
dark.background = TRUE,
blend = FALSE,
blend.threshold = 0.5,
crop = FALSE,
cells = NULL,
scale = c("feature", "all", "none"),
overlap = FALSE,
axes = FALSE,
combine = TRUE,
coord.fixed = TRUE
)
Seurat object
Vector of features to plot. Features can come from:
An Assay
feature (e.g. a gene name - "MS4A1")
A column name from meta.data (e.g. mitochondrial percentage - "percent.mito")
A column name from a DimReduc
object corresponding to the
cell embedding values (e.g. the PC 1 scores - "PC_1")
Name of FOV to plot
A vector of segmentation boundaries per image to plot; can be a character vector, a named character vector, or a named list. Names should be the names of FOVs and values should be the names of segmentation boundaries
The two colors to form the gradient over. Provide as string vector with
the first color corresponding to low values, the second to high. Also accepts a Brewer
color scale or vector of colors. Note: this will bin the data into number of colors provided.
When blend is TRUE
, takes anywhere from 1-3 colors:
Treated as color for double-negatives, will use default colors 2 and 3 for per-feature expression
Treated as colors for per-feature expression, will use default color 1 for double-negatives
First color used for double-negatives, colors 2 and 3 used for per-feature expression, all others ignored
Point size for cells when plotting centroids
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')
A factor in object metadata to split the plot by, pass 'ident' to split by cell identity'
A vector of molecules to plot
Point size for molecules
A vector of color for molecules. The "Set1" palette from RColorBrewer is used by default.
Max number of each molecule specified in `molecules` to plot
Alpha value for plotting (default is 1)
Color of cell segmentation border; pass NA
to suppress borders for segmentation-based plots
Thickness of cell segmentation borders; pass NA
to suppress borders for centroid-based plots
Set plot background to black
Scale and blend expression values to visualize coexpression of two features
The color cutoff from weak signal to strong signal; ranges from 0 to 1.
Crop the plots to area with cells only
Vector of cells to plot (default is all cells)
Set color scaling across multiple plots; choose from:
“feature
”: Plots per-feature are scaled across splits
“all
”: Plots per-feature are scaled across all features
“none
”: Plots are not scaled; note: setting
scale
to “none
” will result in color scales that are
not comparable between plots
Ignored if blend = TRUE
Overlay boundaries from a single image to create a single
plot; if TRUE
, then boundaries are stacked in the order they're
given (first is lowest)
Keep axes and panel background
Combine plots into a single patchworked
ggplot object. If FALSE
, return a list of ggplot objects
Plot cartesian coordinates with fixed aspect ratio
If combine = TRUE
, a patchwork
ggplot object; otherwise, a list of ggplot objects