Skip to contents

The function markerEnrich calculates enrichment of cluster-specific variable markers within bone cell type- or bone tissue-specific marker database.

Usage

markerEnrich(
  varMarkers,
  markerDB = NULL,
  systemLevel = "cellType",
  byDatabase = TRUE,
  topN = Inf,
  sortBy = "log2FC"
)

Arguments

varMarkers

A data.frame containing variable markers for each cluster as reported by FindAllMarkers function from Seurat package.

markerDB

Optional data.frame containing cell type-specific markers. The data.frame should contain following columns: tissue (specifies tissue), cellType (specifies cell type), gene (contains markers), database (specifies source from which markers were obtained)

systemLevel

Optional string specifying on which systematic level to perform enrichment, options: "cellType" or "tissue". Default: "cellType".

byDatabase

Optional logical variable specifying if enrichment should be performed separately for each database (i.e. source from which markers were obtained): option TRUE (default). Or if the database column in markerDB should be ignored and enrichment is done on all available markers for a given cellType or tissue: option FALSE.

topN

Optional integer specifying how many top variable markers per cluster should be used for the enrichment analysis. Default: all variable markers are used.

sortBy

Optional string used only if topN option is used. Specifies if log2(fold change): option "log2FC" (default) or adjusted p-value: option "padj" is used to select the topN variable markers.

Value

A data.frame with marker enrichment results. Conatins following columns: cluster (cluster number) / cellType or tissue (based on input selection) / database (if baDatabase=TRUE) / p (p-value for enrichment) / oddsRatio (odds ratio for enrichment) / n_olaps (number of overlaps between variable markers and a given marker set) / overlaps (specific list of markers found in both variable markers and a given marker set) / padj ( Benjamini Hochberg adjusted p-value) / neg_log10_padj (-log10(padj))

Examples

varMarkerFile = system.file("extdata", "cluster_variable_features.csv",
                            package = "BoneCellType")
varMarkers = read.csv(varMarkerFile)
enrichRes = markerEnrich(varMarkers)