genes_to_pathways: Transform a gene-level data matrix into path-level...

View source: R/pathway_enrichment.R

genes_to_pathwaysR Documentation

Transform a gene-level data matrix into path-level information

Description

This is a utility function which wraps several methods to extract pathway-based features from gene feature data

Usage

genes_to_pathways(
  x,
  enrichment_method = "GSVA",
  gene_set_list = NULL,
  batch_label_pw = NULL,
  min_size = 5,
  max_size = 200,
  parallel = 1,
  verbose = FALSE,
  rwrfgsea_verbose = FALSE,
  gene_key_x = "SYMBOL",
  gs_subcats = c("GO:BP", "GO:MF", "CP:KEGG", "CP:REACTOME"),
  gsva_kcdf = "Gaussian",
  ...
)

DiffRank(x, gene_set_list, parallel = 1)

Arguments

x

gene feature matrix, samples on columns and genes on rows.

enrichment_method

options: "DiffRank", "GSVA", "RWRFGSEA"

gene_set_list

list of gene sets with gene names that correspond to rows in x

batch_label_pw

batch labels for batch-wise enrichment, normal enrichment performed if NULL

min_size

a numeric value indicating the minimum size of gene sets included

max_size

a numeric value indicating the maximum size of gene sets included

parallel

a numeric value indicating the number of processors to use when doing the calculations in parallel.

verbose

controls verbosity

rwrfgsea_verbose

controls RWRFGSEA verbosity which can be a lot when running single-threaded

gene_key_x

if is.null(gene_set_list) and x rownames are not gene symbols, this specifies the column name in org.Hs.eg.db to translate pathway gene symbols to. The default value results in gene symbol based gene sets when is.null(gene_set_list).

gs_subcats

if is.null(gene_set_list), this character vector indicates msigdbr) gene set subcategory names that are included in the analysis.

gsva_kcdf

distribution name for gsva empirical probability distribution kernel.

...

extra arguments are passed to RWRFGSEA

Value

a list of data.frames corresponding to the transformed features based on the selected gene sets (only supports GO, KEGG and REACTOME at the moment)

data.frame of pathway activities for each sample

Functions

  • DiffRank(): DiffRank by Wang et al. BMC Medical Genomics 2019

Examples

library(COPS)

## GSVA example
ad_gsva <- genes_to_pathways(
    ad_ge_micro_zscore, 
    "GSVA", 
    parallel = 1, 
    gene_key_x = "ENSEMBL", 
    gs_subcats = "CP:KEGG")
# batch-wise
ad_gsva <- genes_to_pathways(
    ad_ge_micro_zscore, 
    "GSVA", 
    batch_label_pw = ad_studies$GSE, 
    parallel = 1, 
    gene_key_x = "ENSEMBL", 
    gs_subcats = "CP:KEGG")

## DiffRank example
ad_diffrank <- genes_to_pathways(
    ad_ge_micro_zscore, 
    "DiffRank", 
    parallel = 1, 
    gene_key_x = "ENSEMBL", 
    gs_subcats = "CP:KEGG")
# batch-wise
ad_diffrank <- genes_to_pathways(
    ad_ge_micro_zscore, 
    "DiffRank", 
    batch_label_pw = ad_studies$GSE, 
    parallel = 1, 
    gene_key_x = "ENSEMBL", 
    gs_subcats = "CP:KEGG")


vittoriofortino84/COPS documentation built on Jan. 28, 2025, 3:16 p.m.