powerFDR-methods: Power (TPR) versus achieved false discovery rate (FDR) plot

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

Description

Calculate and plot power (TPR) versus achieved false discovery rate (FDR) using adjusted p-values (padj) and known true positives (labels).

Usage

1
2
3
4
5
6
7
8
powerFDR(object, padj, ...)

## S4 method for signature 'SimResults,missing'
powerFDR(object, threshold=c(0.01, 0.05, 0.1),  transformation="1-x", plot=TRUE, ...)
## S4 method for signature 'missing,ANY'
powerFDR(padj, labels, threshold=c(0.01, 0.05, 0.1),  transformation="1-x", plot=TRUE, ...)
## S4 method for signature 'SimResultsList,missing'
powerFDR(object, threshold=c(0.01, 0.05, 0.1),  transformation="1-x", plot=TRUE, ...)

Arguments

object

An object of SimResults.

padj

A vector or matrix containing the adjusted p-value.

labels

A numeric vector indicating class labels (positives with 1, negatives with 0). For more details, see ?ROCR::prediction.

threshold

Numeric value of the adjusted p-value threshold (cutoff), or vector of multiple thresholds, used to determine the significance of tests.

transformation

The transformation of pval and padj. The default setting "1-x" means 1-pval(padj). Note that another useful transformation is "-log10(x)".

plot

Logical, should power-fdr values be plotted.

...

Optional arguments for plotting (see below for more details).

  • col, cex and other general graphical parameters from par can be directly used into the figure.

  • point.type are special parameters of power-fdr values (see details below).

  • lwd.threshold, lty.threshold and col.threshold are special parameters referred to the lines drawn for threshold (see details below).

  • add, logical, whether the new plot added to current one or not.

  • legend, a list or NULL, is used to add legends to plots (see details below).

Details

The function powerFDR calculates the true positive rate and false discovery rate given a particular threshold, control FDR. Several thresholds can be assessed simultaneously (e.g., threshold=c(0.01,0.02,0.03,0.04,0.05)).

Most of the graphical parameters such as col, cex, pch and etc from par, can be directly passed to plot for power-fdr values. point.type, letter indicating how power-fdr values should be plotted: "b" for both points and lines; "p" for points only; and "l" for lines only. col.line and lwd.line, col and lwd of line connecting power-fdr points, if point.type is either "b" or "l". lwd.threshold, lty.threshold and col.threshold are lwd, lty and col referred to the lines drawn for 'threshold'.

The FDR is considered to be controlled if the false discovery rate falls below the threshold it is assessed at, and power-fdr points are filled-in. power-fdr points are unfilled, or empty, if the FDR is not controlled and is equal to or greater than the cutoff it is assessed at. Note that the fill-unfill option is only compatible with pch values of 21 to 25. Visually, this means that for a given threshold, a point (of the same color) will be filled if it falls left of the threshold line, and will be unfilled if it sits to the right of the threshold line.

To increase the flexibility of plots, you can use argument add. If add=TRUE, plots are added to current one combining different rocX curves together into one figure.

legend is a list including all the arguments from function legend (see help(legend)). If it is NULL, do not add legends to plots.

If input is an SimResultsList object, the average performance would be plotted (see example 3).

Value

Invisibly, an S4 object of class powerFDR-class containing the threshold value(s) assessed, and the associated false discovery rate(s), FDR, and true positive rates, TPR.

Author(s)

Charity Law, Xiaobei Zhou and Mark D. Robinson

See Also

SimResults, rocX

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# example1
data(Pickrell)
re <- SimResults(pval=Pickrell$pval, labels=Pickrell$labels)
p <- powerFDR(re, plot=TRUE)
p <- powerFDR(re, plot=TRUE, legend=NULL)
plot(p, cex=2, pch=c(23,25), col=1:3, main="powerFDR plot", 
     lwd.line=2, cex.axis=1.5, col.threshold=4, lwd.threshold=2)

# example2
data(calibration)
padj <- calibration$padj
labels <- calibration$labels
powerFDR(padj=padj, labels=labels, xlim=c(0,.3))

# example3
data(PickrellList)
rel <- SimResultsList()
for(i in 1:5)
    rel[[i]] <- SimResults(pval=PickrellList[[i]]$pval, labels=PickrellList[[i]]$labels)
powerFDR(rel)

markrobinsonuzh/benchmarkR documentation built on May 21, 2019, 12:24 p.m.