find.discriminant.genes: Find discriminant genes

View source: R/main.R

find.discriminant.genesR Documentation

Find discriminant genes

Description

Based on 'FindMarkers'. It performs differential expression analysis between a projected query and a control (either the reference map or a control sample), for a given cell type. Useful to detect whether specific cell states over/under-express genes between conditions or with respect to the reference.

Usage

find.discriminant.genes(
  ref,
  query,
  query.control = NULL,
  ref.assay = "RNA",
  query.assay = "RNA",
  state = "largest",
  labels.col = "functional.cluster",
  test = "wilcox",
  min.cells = 10,
  genes.use = c("variable", "all"),
  ...
)

Arguments

ref

Seurat object with reference atlas

query

Seurat object with query data

query.control

Optionally, you can compare your query with a control sample, instead of the reference

ref.assay

The referece assay to be used for DE analysis

query.assay

The query assay to be used for DEG analyis, if comparing to the reference

state

Perform discriminant analysis on this cell state. Can be either:

  • "largest" - Performs analysis on the cell state most represented in the query set(s)

  • "all" - Performs analysis on the complete dataset, using all cells

  • A specific cell state, one of the states in metadata field labels.col

labels.col

The metadata field used to annotate the clusters (default: functional.cluster)

test

Type of test for DE analysis. See help for 'FindMarkers' for implemented tests.

min.cells

Minimum number of cells in the cell type to proceed with analysis.

genes.use

What subset of genes to consider for DE analysis:

  • "variable" - Only consider variable genes of the reference

  • "all" - Use intersection of all genes in query and control

  • A custom list of genes

...

Adding parameters for 'FindMarkers'

Value

A dataframe with a ranked list of genes as rows, and statistics as columns (e.g. log fold-change, p-values). See help for 'FindMarkers' for more details.

Examples

# Discriminant genes between query and reference in cell type "Tex"
markers <- find.discriminant.genes(ref, query=query.set, state="Tex")

# Discriminant genes between query and control sample in most represented cell type
markers <- find.discriminant.genes(ref, query=query.set, query.control=control.set)

# Pass results to EnhancedVolcano for visual results
library(EnhancedVolcano)
EnhancedVolcano(markers, lab = rownames(markers), x = 'avg_logFC', y = 'p_val')


carmonalab/ProjecTILs documentation built on April 13, 2025, 10:04 p.m.