R/plotGeneExpressionDimred.R
plotGeneExpressionDimred.Rd
This function plots gene expression on a dimensional reduction plot using methods like t-SNE, UMAP, or PCA. Each single cell is color-coded based on the expression of a specific gene or feature.
plotGeneExpressionDimred(
se_object,
method = c("TSNE", "UMAP", "PCA"),
pc_subset = 1:5,
feature,
assay_name = "logcounts"
)
An object of class SingleCellExperiment
containing log-transformed expression matrix and other metadata.
It can be either a reference or query dataset.
The reduction method to use for visualization. It should be one of the supported methods: "TSNE", "UMAP", or "PCA".
An optional vector specifying the principal components (PCs) to include in the plot if method = "PCA". Default is 1:5.
A character string representing the name of the gene or feature to be visualized.
Name of the assay on which to perform computations. Default is "logcounts".
A ggplot object representing the dimensional reduction plot with gene expression.
# Load data
data("query_data")
# Plot gene expression on PCA plot
plotGeneExpressionDimred(se_object = query_data,
method = "PCA",
pc_subset = 1:5,
feature = "VPREB3")