Perform cor.test between each gene and a response variable given a Seurat object
Source:R/scslide_sample_level.R
QuickCorTest.RdThis function take a Seurat object's gene expression matrix and a meta-data column (a response variable), and run cor.test between each gene and the response variable and keep track of the top-correlated genes and return that gene list to user. It is intended to give users a more response-informative gene list for downstream supervised dimension reduction analyses like partial least squares.
Usage
QuickCorTest(
object = NULL,
assay = NULL,
layer = "data",
group.by = NULL,
Y = NULL,
cor.cutoff = NULL,
top.prop = 0.01,
min.pct = 0.1,
min.cells = 100,
verbose = TRUE,
unlist = TRUE,
...
)Arguments
- object
A Seurat object
- assay
The name of the assay to retrieve the expression matrix
- layer
The name of the layer to use for cor.test
- group.by
A metadata column name to group cells by before cor.test. If NULL, falls back to cor.test without grouping. Default is NULL.
- Y
A metadata column name of responses. No cell in 'assay' can have a missing (
NA) response.- cor.cutoff
The correlation coefficient cutoff to select the top genes. Default is NULL.
- top.prop
The proportion of genes to be selected as the top genes. Default is 0.01, i.e. the most correlated 1% of genes will be selected. When used together with cor.cutoff, genes must pass both filters; set top.prop to NULL to select every gene that passes cor.cutoff. They cannot be NULL at the same time.
- min.pct
only test genes that are detected in a minimum fraction of min.pct cells in each group. Default is 0.1
- min.cells
the minimum number of cells per group to perform the cor.test. Default is 100. groups with < 100 will be skipped.
- verbose
Print progress bars and output
- unlist
whether to return a unlist object (vector) or a named list (each element is a vector of DEGs for a category in group.by)
- ...
Additional arguments