Skip to contents

Calculate GSEA ranking metric values for fgsea2.

Usage

rank_genes(
  x,
  genes,
  metric = "-log10(P.Value)*sign(logFC)",
  contrast_column = "contrast"
)

Arguments

x

object of class data.frame. Typically results from limma_full.

genes

character; the name of a column in x. A ranking metric value will be calculated for each unique entry. Usually gene symbols, Entrez IDs, or Ensembl genes to work with the output of msigdbr2.

metric

character; specifies how the ranking metric will be calculated from x. Can be the name of a single column.

contrast_column

character; the name of a column in x. Entries in this column will be set as the names of the output list.

Value

A named vector (if no "contrast" column) or list of named vectors of sorted ranking metric values for each contrast in x.

Details

The -log\(_{10}\)-transformed p-value signed by the fold-change is similar to the t-statistic, but more clearly separates extreme values in the tails from those close to 0 that are not as interesting.