findMarkers {scran}R Documentation

Find marker genes

Description

Find candidate marker genes for clusters of cells, by testing for differential expression between clusters.

Usage

## S4 method for signature 'ANY'
findMarkers(x, clusters, gene.names=rownames(x), block=NULL, design=NULL,
    pval.type=c("any", "all"), direction=c("any", "up", "down"), lfc=0, 
    log.p=FALSE, full.stats=FALSE, subset.row=NULL, BPPARAM=SerialParam())

## S4 method for signature 'SingleCellExperiment'
findMarkers(x, ..., subset.row=NULL, assay.type="logcounts", 
    get.spikes=FALSE) 

Arguments

x

A numeric matrix-like object of normalized log-expression values, where each column corresponds to a cell and each row corresponds to an endogenous gene. Alternatively, a SingleCellExperiment object containing such a matrix.

clusters

A vector of cluster identities for all cells.

gene.names

A character vector of gene names with one value for each row of x.

block

A factor specifying the blocking level for each cell.

design

A numeric matrix containing blocking terms, i.e., uninteresting factors driving expression across cells.

pval.type

A string specifying the type of combined p-value to be computed, i.e., Simes' or IUT.

direction

A string specifying the direction of log-fold changes to be considered for each cluster.

lfc

A positive numeric scalar specifying the log-fold change threshold to be tested against.

log.p

A logical scalar indicating if log-transformed p-values/FDRs should be returned.

full.stats

A logical scalar indicating whether all statistics (i.e., raw and BH-adjusted p-values) should be returned for each pairwise comparison.

subset.row

See ?"scran-gene-selection".

BPPARAM

A BiocParallelParam object indicating whether and how parallelization should be performed across genes.

...

Additional arguments to pass to the ANY method.

assay.type

A string specifying which assay values to use, e.g., "counts" or "logcounts".

get.spikes

See ?"scran-gene-selection".

Details

This function provides a convenience wrapper for marker gene identification, based on running pairwiseTTests and passing the result to combineMarkers. All of the arguments above are supplied directly to one of these two functions.

Note that log.p only affects the combined p-values and FDRs. If full.stats=TRUE, the p-values for each pairwise comparison will be log-transformed regardless of the value of log.p.

Value

A named list of DataFrames, each of which contains a sorted marker gene list for the corresponding cluster. See ?combineMarkers for more details on the output format.

Author(s)

Aaron Lun

See Also

See pairwiseTTests and combineMarkers for the individual functions.

See overlapExprs for the equivalent function using t-tests.

Examples

# Using the mocked-up data 'y2' from this example.
example(computeSpikeFactors) 
y2 <- normalize(y2)
kout <- kmeans(t(logcounts(y2)), centers=2) # Any clustering method is okay.
out <- findMarkers(y2, clusters=kout$cluster)

[Package scran version 1.12.0 Index]