Skip to contents

This generator function is designed to take the original return from a Seurat marker analysis and add corresponding gene annotations.

Usage

SeuratMarkers(object, ...)

SeuratMarkersPerCluster(object, ...)

# S4 method for data.frame
SeuratMarkers(object, ranges, alphaThreshold = 0.05)

# S4 method for data.frame
SeuratMarkersPerCluster(object, ranges, alphaThreshold = 0.05)

Arguments

object

Unmodified Seurat marker return data.frame.

...

Additional arguments.

ranges

GenomicRanges. Gene annotations. Names must correspond to the rownames. The function will automatically subset the ranges and arrange them alphabetically.

alphaThreshold

numeric(1) or NULL. Adjusted P value ("alpha") cutoff. If left NULL, will use the cutoff defined in the object.

Value

SeuratMarkers.

Details

For Seurat::FindAllMarkers() return, rownames are correctly returned in the gene column.

Note

Updated 2022-06-09.

Examples

data(Seurat, package = "AcidTest")

## Seurat ====
object <- Seurat
ranges <- rowRanges(object)
#> Warning: `invoke()` is deprecated as of rlang 0.4.0.
#> Please use `exec()` or `inject()` instead.
#> This warning is displayed once every 8 hours.

## `FindMarkers()` return.
invisible(capture.output({
    markers <- Seurat::FindMarkers(
        object = object,
        ident.1 = "1",
        ident.2 = NULL
    )
}))
x <- SeuratMarkers(object = markers, ranges = ranges)
#>  `FindMarkers()` return detected.
summary(x)
#> alphaThreshold: 0.05
#> organism: Homo sapiens
#> genomeBuild: GRCh37
#> date: 2023-10-04

## `FindAllMarkers()` return.
invisible(capture.output(suppressWarnings({
    markers <- Seurat::FindAllMarkers(object)
})))
#> Calculating cluster 0
#> Calculating cluster 1
#> Calculating cluster 2
x <- SeuratMarkersPerCluster(object = markers, ranges = ranges)
#>  `FindAllMarkers()` return detected.
summary(x)
#> 3 clusters
#> organism: Homo sapiens
#> genomeBuild: GRCh37