Skip to contents

This 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.

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, 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.

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

Value

return a list of gene names for the genes that highly correlated with the responses

Examples

if (FALSE) { # \dontrun{
# Find genes correlated with pseudotime
cor_genes <- QuickCorTest(seurat_obj, Y = "pseudotime")
} # }