levelPValues: Level P-values

Description Usage Arguments Details Value Author(s) References Examples

View source: R/PolyfitFunctions.R

Description

Function to level out a P-value spectrum generated by the Polyfit extension of DESeq by fitting a quadratic function to the right hand portion of the spectrum, produce 'corrected' p-values and q-values using an adapted version of the Storey-Tibsharini procedure

Usage

1
levelPValues(oldPvals, plot = FALSE)

Arguments

oldPvals

an array of p-values produced by the Polyfit replacement of the DESeq function pfNbinomTest() or the Plyfit replacement of the edgeR function pfExactTest()

plot

TRUE to plot original and corrected pvalue spectra; FALSE not to plot

Details

levelPValues should only be used with P-values generated by the Polyfit function pfNbinomTest, and not with P-values generated by nbinomTest.

Value

List containing

pi0estimate

an estimate of the proportion of genes not differentially expressed

lambdaOptimal

the point in the p-value spectrum past which a quadratic is fitted

pValueCorr

p-values calculated from the levelled spectrum

qValueCorr

q-values calculated from the levelled spectrum

qValueCorrBH

q-values calculated from pValueCorr using Benjamini-Hochberg

Author(s)

Conrad Burden

References

Burden, C.J., Qureshi, S. and Wilson, S.R. (2014). Error estimates for the analysis of differential expression from RNA-seq count data, PeerJ PrePrints 2:e400v1.

Examples

1
2
3
4
5
6
7
8
cds <- makeExampleCountDataSet()
cds <- estimateSizeFactors( cds )
cds <- estimateDispersions( cds )
nbTPolyfit <- pfNbinomTest( cds, "A", "B" )
lP <- levelPValues(nbTPolyfit$pval, plot=TRUE)
pvalTab <- cbind(origPval=nbTPolyfit$pval, correctedPval=lP$pValueCorr)
cat("\n Original and corrected P-values from DESeq \n")
head(pvalTab)

Polyfit documentation built on Nov. 8, 2020, 5:26 p.m.