Colors single cells on a dimensional reduction plot according to a 'feature' (i.e. gene expression, PC scores, number of genes detected, etc.)
FeaturePlot(object, features, dims = c(1, 2), cells = NULL,
cols = c("lightgrey", "blue"), pt.size = NULL, order = FALSE,
min.cutoff = NA, max.cutoff = NA, reduction = NULL,
split.by = NULL, shape.by = NULL, slot = "data", blend = FALSE,
blend.threshold = 0.5, label = FALSE, label.size = 4,
ncol = NULL, combine = TRUE, coord.fixed = FALSE, by.col = 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")
Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions
Vector of cells to plot (default is all cells)
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.
Adjust point size for plotting
Boolean determining whether to plot cells in order of expression. Can be useful if cells expressing given feature are getting buried.
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')
Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca
A factor in object metadata to split the feature plot by, pass 'ident'
to split by cell identity'; similar to the old FeatureHeatmap
If NULL, all points are circles (default). You can specify any cell attribute (that can be pulled with FetchData) allowing for both different colors and different shapes on cells
Which slot to pull expression data from?
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.
Whether to label the clusters
Sets size of labels
Number of columns to combine multiple feature plots to, ignored if split.by
is not NULL
Combine plots into a single gg object; note that if TRUE; themeing will not work when plotting multiple features
Plot cartesian coordinates with fixed aspect ratio
If splitting by a factor, plot the splits per column with the features as rows.
A ggplot object
# NOT RUN {
FeaturePlot(object = pbmc_small, features = 'PC_1')
# }
Run the code above in your browser using DataLab