Hypergeometric test for cluster enrichment, e.g. to test whether a barcode is enriched in any cluster.
plotClusterEnrichment.Rd
Takes a single cell object, a grouping variable, a factor within the group to test, and an ident class (i.e. clusters). Per level of ident performs hypergeometric testing for enrichment of group factor
Usage
plotClusterEnrichment(
sc.obj = NULL,
group = "barcode",
factor = NULL,
clusters = "seurat_clusters",
threshold = 0.01,
order = TRUE,
plot = TRUE
)
Arguments
- sc.obj
Single cell Seurat or SingleCellExperiment object containing clusters and group metadata.
- group
a column of metadata (string). Default = `barcode`.
- factor
a level of group to test for enrichment per cluster, e.g. a specific barcode (string).
- clusters
a column of metadata defining the cluster identities of each cell (string). Default = `seurat_clusters`
- threshold
P-value threshold for hypergeometric test (decimal). Default = `0.01`.
- order
Order clusters in plot by -log10 P-value (boolean). Default = `TRUE`.
- plot
Plot hypergeometric test results or return plot data (boolean). Default = `TRUE`.