Learn R Programming

Polyfit (version 1.6.0)

levelPValues: Level P-values

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

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

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

Details

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

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

Run this code
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)

Run the code above in your browser using DataLab