TabulatepValues: Tabulate, adjust, and sort pathway p-values

Description Usage Arguments Details Value Examples

View source: R/utils_adjust_and_sort_pValues.R

Description

Adjust the pathway p-values, then return a data frame of the relevant pathway information, sorted by adjusted significance.

Usage

1
2
3
4
5
6
7
8
TabulatepValues(
  pVals_vec,
  genesets_ls,
  adjust = TRUE,
  proc_vec = c("BH", "Bonferroni", "Holm", "Hochberg", "SidakSS", "SidakSD", "BY",
    "ABH", "TSBH"),
  ...
)

Arguments

pVals_vec

A named vector of permutation p-values returned by the PermTestSurv, PermTestReg, or PermTestCateg functions when the analysis performed was AES-PCA. Otherwise, when the analysis was performed with Supervised PCA, a named vector of p-values from the GumbelMixpValues function.

genesets_ls

A list of known gene pathways, trimmed to match the given assay data by the IntersectOmicsPwyCollct function. This pathway list must contain:

  • pathways : A named list of character vectors where each vector contains the names of the genes in that specific pathway.

  • TERMS : A character vector the same length as pathways containing the full pathway descriptions.

  • n_tested : An integer vector the same length as pathways containing the number of genes present in the pathway after trimming. Pathways list trimming is done in the IntersectOmicsPwyCollct function.

adjust

Should you adjust the p-values for multiple comparisons? Defaults to TRUE.

proc_vec

Character vector of procedures. The returned data frame will be sorted in ascending order by the first procedure in this vector, with ties broken by the unadjusted p-value. If only one procedure is selected, then it is necessarily the first procedure. Defaults to "BH" (Benjamini and Hochberg, 1995).

...

Additional arguments to pass to the ControlFDR function.

Details

This is a wrapper function for the ControlFDR function. The number of p-values passed to the pVals_vec argument must equal the number of pathways and set size values in the genesets_ls argument. If you trimmed a pathway from p- value calculation, then pad this missing value with an NA.

Value

A data frame with columns

The data frame will be sorted in ascending order by the method specified first in the adjustment argument. If adjustpValues = FALSE, then the data frame will be sorted by the raw p-values. If you have the suggested tidyverse package suite loaded, then this data frame will print as a tibble. Otherwise, it will stay a simple data frame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  # DO NOT CALL THIS FUNCTION DIRECTLY.
  # Call this function through AESPCA_pVals() or SuperPCA_pVals() instead.

## Not run: 
  ###  Load the Example Data  ###
  data("colonSurv_df")
  data("colon_pathwayCollection")

  ###  Create an OmicsSurv Object  ###
  colon_Omics <- CreateOmics(
    assayData_df = colonSurv_df[, -(2:3)],
    pathwayCollection_ls = colon_pathwayCollection,
    response = colonSurv_df[, 1:3],
    respType = "surv"
  )

  ###  Extract Pathway PCs and Loadings  ###
  colonPCs_ls <- ExtractAESPCs(
    object = colon_Omics,
    parallel = TRUE,
    numCores = 2
  )

  ###  Pathway p-Values  ###
  pVals <- PermTestSurv(
    OmicsSurv = colon_Omics,
    pathwayPCs_ls = colonPCs_ls$PCs,
    parallel = TRUE,
    numCores = 2
  )

  ###  Create Table of p-Values  ###
  trimmed_PC <- getTrimPathwayCollection(colon_Omics)
  TabulatepValues(
    pVals_vec = pVals,
    genesets_ls = trimmed_PC
  )

## End(Not run)

pathwayPCA documentation built on Dec. 15, 2020, 6:14 p.m.