cFDR: Conditional false discovery rate

Description Usage Arguments Value See Also Examples

View source: R/condFDR.R

Description

Estimate the conditional false discovery rate for a set of p-values, conditional on a second set of p-values

Usage

1
cFDR(data, p1, p2, p2_threshold = 0.001, mc.cores = 1)

Arguments

data

data frame or (numeric) matrix with p-values as columns

p1

p-values for which the cFDR will be estimated; either the name/index of the columns in data, or a vectors of p-values

p2

the p-values on which the cFDR will be conditioned on; either name or vector of p-values data, or a vectors of p-values

p2_threshold

cutoff for pre-filtering on p2: only variants with p2 <= p2_threshold are included

mc.cores

number of cores to use for parallel calculation; defaults to one (i.e. no parallel calculation), but should absolutely be increased if your system supports it, as this will speed up execution very nicely.

Value

A data frame with column cFDR: if data was specified, the column is simply added at the end; if only p1 and p2 were specified, a data frame with three columns (the original p-values and the cFDR).

See Also

mclapply for details on parallel calculations and mc.cores

Examples

1
2
3
4
data(psynth)
res = cFDR(psynth, "p1", "p2", p2_threshold = 1E-5)
head(res)
head(subset(res, cFDR < 0.01))

alexploner/condFDR documentation built on Dec. 31, 2020, 7:43 p.m.