funcEnrich.GSEA: Gene Set Enrichment Analysis by GSEA

View source: R/pipeline_functions.R

funcEnrich.GSEAR Documentation

Gene Set Enrichment Analysis by GSEA

Description

funcEnrich.GSEA performs gene set enrichment analysis to the input gene list, by using the GSEA Test.

Usage

funcEnrich.GSEA(
  rank_profile = NULL,
  use_gs = NULL,
  gs2gene = NULL,
  min_gs_size = 5,
  max_gs_size = 500,
  Pv_adj = "fdr",
  Pv_thre = 0.1,
  test_strategy = "GSEA",
  nperm = 1000,
  use_seed = 999
)

Arguments

rank_profile

a named vector of numerics, the differential values (DE or DA) calculated from a sample comparison (e.g. "G4 vs. Others"). Names of the vector must be gene names. For the DA, user could use 'processDriverProfile()' to convert the DA profile into gene-name based profile. The differential values can be "logFC" or "t-statistics".

use_gs

a vector of characters, the names of gene sets. If gs2gene is NULL, all_gs2gene will be used. The use_gs must be the subset of names(all_gs2gene). If "all", all the gene sets in gs2gene will be used. If user input his own gs2gene list, use_gs will be set to "all" as default. Default is c("H", "CP:BIOCARTA", "CP:REACTOME", "CP:KEGG").

gs2gene

list, a list contains elements of gene sets. The name of the element is gene set, each element contains a vector of genes in that gene set. If NULL, will use all_gs2gene, which is created by function gs.preload. Default is NULL.

min_gs_size

numeric, the minimum size of gene set to analysis. Default is 5.

max_gs_size

numeric, the maximum size of gene set to analysis. Default is 500.

Pv_adj

character, method to adjust P-value. Default is "fdr". For details, please check p.adjust.methods.

Pv_thre

numeric, threshold for the adjusted P-values. Default is 0.1.

test_strategy

choose from "KS" and "GSEA". Default is "GSEA". If "KS", will perform a Kolmogorov-Smirnov test to get the significance value.

nperm

numeric, number of random permutations. Default is 1000. This function only do gene-label based permutation reshuffling.

use_seed

integer, the random seed. Default is 999.

Value

Return a data.frame, contains gene sets with significant enrichment statistics. Column details are as follows (test_strategy=GSEA),

#Name

Name of the enriched gene set

Total_item

Size in the profile

Num_item

Number of genes in the gene set (filtered by the profile list)

Ori_P

Original P-value from GSEA Test

Adj_P

Adjusted P-value

ES

Enrichment Score

NES

normalized Enrichment Score

Examples

analysis.par <- list()
analysis.par$out.dir.DATA <- system.file('demo1','driver/DATA/',package = "NetBID2")
NetBID.loadRData(analysis.par=analysis.par,step='ms-tab')
ms_tab <- analysis.par$final_ms_tab
## get significant gene set by driver's DA profile
DA_profile <- processDriverProfile(Driver_name=ms_tab$gene_label,
                                    Driver_profile=ms_tab$logFC.G4.Vs.others_DA,
                                    choose_strategy='absmax',
                                    return_type ='gene_statistics')
res1 <- funcEnrich.GSEA(rank_profile=DA_profile,
                         use_gs=c('H'),
                         Pv_thre=0.1,Pv_adj = 'none')
## Not run: 


jyyulab/NetBID documentation built on Dec. 23, 2024, 6:34 a.m.