prot.p.adjust: Adjust P-values for Multiple Comparisons

View source: R/prot_p_adjust.R

prot.p.adjustR Documentation

Adjust P-values for Multiple Comparisons

Description

Given data frame or a list of matrices with a column containing p-values, adds one or more columns containing p-values adjusted using one or more methods.

Usage

prot.p.adjust(coefmatlist, method = "fdr", pcol = "pval", qname = "qval",
  Tcol = NULL, threshold_excess1 = 1e-90)

Arguments

coefmatlist

Either a data frame containing a column with p-values or a list of such matrices. A column with T-values is also necessary when method = "fdrtool".

method

Correction method. Can be abbreviated. Defaults to "fdr". To get all available methods, type c("fdrtool", p.adjust.methods). For more information on the "fdrtool" method, check out the package fdrtool by Bernd Klaus and Korbinian Strimmer. For more information on the other methods, see the p.adjust function.

pcol

A character string or numeric index indicating the column containing the p-values. Defaults to "pval".

qname

A character string indicating the name that will be given to the column containing the q-values. Defaults to "qval".

Tcol

Only needed when method = "fdrtool". A character string or numeric index indicating the column containing the T-values. Defaults to NULL.

threshold_excess1

A numeric value between 0 and 1 indicating the threshold at which correcting for an excess in p-values close to 1 should be performed. This is sometimes needed when a null distribution needs to be fitted. Note that the method still accounts for the total number of p-values when performing this correction. Only if there is, according to a binomial test, a significant enrichment of p-values above an automatically determined cut-off at the threshold_excess1 significance level, a correction for enrichment in p-values close to 1 will be performed. If you never want to correct for an excess in p-values close to 1, set threshold_excess1 to 0. If you always want to correct for an excess in p-values close to 1, set threshold_excess1 to 1. Defaults to 1e-90.

Value

Depending on the input, either a data frame or a list of data frames with an extra numeric column containing corrected p-values.

Examples

#Create a contrast matrix L for investigating whether all 10 pairwise contrasts between conditions conc6A, conc6B, conc6D and conc6E differ from zero:
L <- makeContrast(contrasts=c("conc6B-conc6A","conc6C-conc6A","conc6D-conc6A","conc6E-conc6A","conc6C-conc6B","conc6D-conc6B","conc6E-conc6B","conc6D-conc6C","conc6E-conc6C","conc6E-conc6D"),
levels=c("conc6A","conc6B","conc6C","conc6D","conc6E"))
#Load the protLM object protmodel:
protmodel <- data(modelRRCPTAC, package="MSqRob")
#Test the contrast L:
protvalues <- test.protLMcontrast(protmodel,L)
#Adjust the p-values by Benjamini-Hochberg FDR:
protvalues <- prot.p.adjust(protvalues)

statOmics/MSqRob documentation built on Dec. 8, 2022, 6 a.m.