getMarkers: getMarkers

Description Usage Arguments Value Author(s) See Also Examples

View source: R/getMarkers.R

Description

getMarkers processes the output of sortGenes to select a relatively small set of marker genes.

Usage

1
getMarkers(gs, quant = 0.99, mutualInfo = FALSE, classEnt = FALSE)

Arguments

gs

The output of sortGenes().

quant

A number greater than zero and smaller than one. 0.99 by default. See Details.

mutualInfo

Logical. If TRUE, the mutual information between gene expression and cell clustering will be returned for each gene. FALSE by default.

classEnt

Logical. If TRUE, a "Cluster Shannon Index" is returned for each cluster. See Details. FALSE by default.

Value

getMarkers returns a list with the following components:

markers

A character vector containing the names of selected marker features.

maxScaledSpecScore

A numeric vector of length nrow(gs$specScore), including the maximum scaled specificity score for each gene across all cell clusters.

gene_shannon_index

A numeric vector of the same length as maxScaledSpecScore, including the Gene Shannon Index for each gene. See Details.

mutInfo

A numeric vector of the same length as maxScaledSpecScore, including the mutual information between the expression of each gene and the cell clustering.

classEntropy

A numeric vector of the same length as ncol(specScore), including the Class Shannon Index for each cluster based on the selected marker genes.

Author(s)

Mahmoud M Ibrahim <mmibrahim@pm.me>

See Also

getPValues

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#randomly generated data and cell clusters, almost no markers are found
set.seed(1234)
exp = matrix(sample(0:20,1000,replace=TRUE), ncol = 20)
rownames(exp) = sapply(1:50, function(x) paste0("g", x))
cellType = sample(c("cell type 1","cell type 2"),20,replace=TRUE)
sg = sortGenes(exp, cellType)
mm = getMarkers(sg,quant=0.95)
length(mm$markers) #only one marker gene was found


#"reasonably" separated clusters, with a few clear markers
data(sim)
gs = sortGenes(sim$exp, sim$cellType)
mm = getMarkers(gs,quant=0.95)
length(mm$markers)

#real data with three well separated clusters
data(kidneyTabulaMuris)
gs = sortGenes(kidneyTabulaMuris$exp, kidneyTabulaMuris$cellType)
mm = getMarkers(gs, quant = 0.99)
length(mm$markers) #we found 109 candidate markers
#we want to get a more focused list:
mm = getMarkers(gs, quant = 0.999)
length(mm$markers) #11 genes that can alone descriminate between the cell types

mahmoudibrahim/genesorteR documentation built on April 20, 2021, 4:07 p.m.