postProb: Estimates the posterior probabilities that genes are...

Description Usage Arguments Value Author(s) References Examples

View source: R/postProb.R

Description

This function inputs gene-level statistics and returns a vector of estimated posterior probabilities of differential expression for each gene.

Usage

1
2
postProb(obs.stat, null, B = NULL, pos = FALSE, p0 = 1,
K = length(obs.stat),dim.basis = 10,...)

Arguments

obs.stat

Vector of observed gene-level statistics.

null

Vector of null gene-level statistics or a character (such as "rnorm") indicating the random generating mechanism for the null statistics.

B

Number of simulations under the null.

pos

If set to TRUE, applies log transformation to the gene-level statistics.

p0

Value (between 0 and 1) for the prior probability that a gene is not differentially expressed.

K

Number of intervals used in probability estimation. A good value in practice seems to be the length of obs.stat.

dim.basis

Basis dimension (k) in gam.

...

If null is a character, then pass the parameters of the relevant random generating mechanism.

Value

Vector of the estimated gene-level probabilities of differential expression.

Author(s)

John D. Storey, Jeffrey T. Leek, Simina M. Boca

References

Storey, J., J. Akey, and L. Kruglyak (2005): Multiple locus linkage analysis of genomewide expression in yeast, PLoS Biology, 3.

Boca S.M., H. Corrada Bravo, B. Caffo, J.T. Leek, and G. Parmigiani (2010): A decision-theory approach to interpretable set analysis for high-dimensional data, JHU Biostat Working Paper 211, http://www.bepress.com/jhubiostat/paper211/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
set.seed(10831)
stat <- rnorm(1000,sd=sqrt(1/10),mean=c(rep(1,50),rep(0,950)))
set.seed(23134)
stat0 <- matrix(rnorm(1000*20,sd=sqrt(1/10)),nrow=1000)

post.prob.genes.1 <-
    postProb(stat,
             null = stat0,
             K = 1000)

set.seed(23134)
post.prob.genes.2 <-
    postProb(stat,
             null = "rnorm",
             B = 20,
             K = 1000,
             mean = 0, sd = sqrt(1/10))

##The results are the same, since in both case we are considering 20
##simulations of 1000 null statistics from a N(0, 1/10) distribution,
##using the same seed!
identical(post.prob.genes.1, post.prob.genes.2)

leekgroup/Set documentation built on May 20, 2019, 11:30 p.m.