meanMarkerExpressionPerCell: meanMarkerExpression

Description Usage Arguments Value Author(s) Examples

View source: R/comparisons_with_markers.R

Description

This function computes each cell's mean expression of each cluster's markers. Used for markerViolinPlot.

Usage

1
meanMarkerExpressionPerCell(seurat, markers, marker_col = "gene")

Arguments

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 seurat.

Value

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

Author(s)

Selin Jessa

Examples

 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")

fungenomics/cytobox documentation built on Feb. 13, 2020, 10:51 a.m.