Description Usage Arguments Value Author(s) Examples
View source: R/comparisons_with_markers.R
This function computes each cell's mean expression of each cluster's
markers. Used for markerViolinPlot
.
1 | meanMarkerExpressionPerCell(seurat, markers, marker_col = "gene")
|
seurat |
Seurat object, whose expression values will be used |
markers |
Markers data frame, for the same or another Seurat object. The
expression of markers in each cluster in this data frame will be calculated
for each cluster in |
Data frame where the first two columns are "Cell" and "Cluster" (from
seurat
),
and all remaining columns give the mean expression of markers identified
for each cluster in markers
Selin Jessa
1 2 3 4 5 6 7 8 9 10 11 | library(dplyr)
# Using the same sample's marker:
meanMarkerExpressionPerCell(pbmc, markers_pbmc, "gene")
# Change the name of the clusters in the markers df, as if it were
# from a different sample where the clusters are A, B, C, D:
markers2 <- mutate(markers_pbmc, cluster = recode(
cluster, `0` = "A", `1` = "B", `2` = "C", `3` = "D"))
meanMarkerExpressionPerCell(pbmc, markers2, "gene")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.