R/differential_expression.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.
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,
...
)A Seurat object
The name of the assay to retrieve the expression matrix
The name of the layer to use for cor.test
A metadata column name to group cells by before cor.test. If NULL, falls back to cor.test without grouping. Default is NULL.
A metadata column name of responses.
The correlation coefficient cutoff to select the top genes. Default is NULL.
The proportion of genes to be selected as the top genes, if cor.cutoff is not provided. Can be used together with cor.cutoff, and they cannot be NULL at the same time. Default is 0.01, i.e. the most correlated 1% of genes will be selected.
only test genes that are detected in a minimum fraction of min.pct cells in each group. Default is 0.1
the minimum number of cells per group to perform the cor.test. Default is 100. groups with < 100 will be skipped.
Print progress bars and output
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
return a list of gene names for the genes that highly correlated with the responses
if (FALSE) { # \dontrun{
# Find genes correlated with pseudotime
cor_genes <- QuickCorTest(seurat_obj, Y = "pseudotime")
} # }