empiricalFDR: Compute empirical false discovery rate

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/empiricalFDR.R

Description

At a p-value, find the number of regions in RIP library (denoted as "trueCount") and the number of regions in control library (denoted as "falseCount"). The empirical false discovery rate (eFDR) is estimated as the ratio of the falseCount over the trueCount.

Usage

1
empiricalFDR(pval, pvalRIP, pvalCTL)

Arguments

pval

A scalar p-value.

pvalRIP

A column vector of p-values for the peaks identifed from RIP v.s. control comparison.

pvalCTL

A column vector of p-values for the peaks identifed from control v.s. RIP comparison.

Details

Only when the control is available, is an empirical false discovery rate (eFDR) estimated based on the idea of "sample swap" inspired by MACS (a ChIP-seq algorithm from Zhange el al. (2008). At each p-value, RIPSeeker finds the number of significnat RIP-regions over control (CTL) based on pvalRIP and the number of significant control regions over RIP based on pvalCTL. The eFDR is defined as the ratio of the number of "RIP" (false positive) regions identified from CTL-RIP comparison over the number of RIP regions from the RIP-CTL comparison. The maximum value for eFDR is 1 and minimum value for eFDR is max(p-value, 0). The former takes care of the case where the numerator is bigger than the denominator, and the latter for zero numerator.

Value

A scalar probabibility value that represents the eFDR.

Note

This is an internal funciton used in seekRIP.

Author(s)

Yue Li

References

Yong Zhang, Tao Liu, Clifford A Meyer, J\'er\^ome Eeckhoute, David S Johnson, Bradley E Bernstein, Chad Nusbaum, Richard M Myers, Myles Brown, Wei Li, and X Shirley Liu. Model-based analysis of ChIP-Seq (MACS). Genome Biology, 9(9):R137, 2008.

See Also

logScoreWithControl, seekRIP, computeLogOdd, scoreMergedBins

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
pvalRIP <- runif(100)

pvalCTL <- runif(100)

eFDR <- empiricalFDR(pvalRIP[1], pvalRIP, pvalCTL)

pvalRIP[1]

eFDR

# more significant pval
pvalRIP[1] <- 1e-4

eFDR <- empiricalFDR(pvalRIP[1], pvalRIP, pvalCTL)

pvalRIP[1]

eFDR

RIPSeeker documentation built on Oct. 31, 2019, 7:29 a.m.