Add.DE.combined.score: Add.DE.combined.score

View source: R/Seurat.Utils.R

Add.DE.combined.scoreR Documentation

Add.DE.combined.score

Description

Add a combined score to differential expression (DE) results. The score is calculated as log-fold change (LFC) times negative logarithm of scaled p-value (LFC * -log10( p_cutoff / pval_scaling )).

Usage

Add.DE.combined.score(
  df = df.markers,
  p_val_min = 1e-25,
  pval_scaling = 0.001,
  colP = "p_val",
  colLFC = CodeAndRoll2::grepv(pattern = c("avg_logFC|avg_log2FC"), x = colnames(df),
    perl = TRUE)
)

Arguments

df

A data frame that holds the result of a differential gene expression analysis, typically obtained via the 'FindAllMarkers' function. Default: df.markers.

p_val_min

The minimum p-value considered. All values below this threshold are set to this value. Default: 1e-25.

pval_scaling

The value to scale p-values by in the calculation of the combined score. Default: 0.001.

colP

The name of the column in the input data frame that holds p-values. Default: 'p_val'.

colLFC

The name of the column in the input data frame that holds log-fold change values. By default, it selects the first column not named "avg_logFC" or "avg_log2FC".

Examples

## Not run: 
if (interactive()) {
  df.markers <- Add.DE.combined.score(df.markers)
}

## End(Not run)

vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.