get_qvalues_one_inflated: Calculate q-values (Storey 2003) from a p-value distribution...

Description Usage Arguments Examples

View source: R/utils.R

Description

Calculate q-values (Storey 2003) from a p-value distribution with considerable amount of 1's

Usage

1

Arguments

pvals

a numeric vector of p-values.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(1234)
pval = c(runif(100, 0, 0.1), runif(100,0, 1), rep(1, 100))
qval = get_qvalues_one_inflated(pval)
plot(sort(pval), sort(qval), xlim=c(0,1), ylim=c(0,1), type="l",
     xlab="p-values", ylab="q-values")
qval_range = seq(0.001, 0.25, by=0.001)
plot(qval_range,
     sapply(qval_range, function(x) sum(qval <= x, na.rm=TRUE)),
     type="l",
     xlab="q-value", ylab="number of significant genes")

Sun-lab/CARseq documentation built on Oct. 7, 2021, 1:52 p.m.