Last data update: 2014.03.03

R: Q-Values Computation
qvalR Documentation

Q-Values Computation

Description

For internal use in function stp. Computes the genes' Q-Values in the Single Time Point Analysis according to Algorithm 3 in the vignette.

Usage

qval(Q, psi2)

Arguments

Q

vector with the estimated FDRs when the threshold values used are abs(ac2(Z, design)).

psi2

vector with the second artificial component as returned by ac2.

Value

returns a vector with the computed Q-Values for each gene in the experiment.

Author(s)

Juan Pablo Acosta (jpacostar@unal.edu.co).

References

Acosta, J. P. (2015) Strategy for Multivariate Identification of Differentially Expressed Genes in Microarray Data. Unpublished MS thesis. Universidad Nacional de Colombia, Bogot'a.

Storey, J. D. (2002) A direct approach to false discovery rates. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 64(3): 479–498.

See Also

stp, fdr, ac2.

Examples

## Single time point analysis for 500 genes with 10 treatment 
## replicates and 10 control replicates
n <- 500; p <- 20; p1 <- 10
des <- c(rep(1, p1), rep(2, (p-p1)))
mu <- as.matrix(rexp(n, rate=1))
Z <- t(apply(mu, 1, function(mui) rnorm(p, mean=mui, sd=1)))
### 5 up regulated genes
Z[1:5,1:p1] <- Z[1:5,1:p1] + 5
### 10 down regulated genes
Z[6:15,(p1+1):p] <- Z[6:15,(p1+1):p] + 4

res <- fdr(Z, des)
qValues <- qval(res$Q, ac2(Z, des))
plot(res$th, res$Q, type="l", col="blue")
lines(res$th, qValues[order(abs(ac2(Z, des)))], col="green")
legend(x="topright", legend=c("FDR", "Q Values"), lty=c(1,1), 
    col=c("blue", "green"))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(acde)
Loading required package: boot
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/acde/qval.Rd_%03d_medium.png", width=480, height=480)
> ### Name: qval
> ### Title: Q-Values Computation
> ### Aliases: qval
> 
> ### ** Examples
> 
> ## Single time point analysis for 500 genes with 10 treatment 
> ## replicates and 10 control replicates
> n <- 500; p <- 20; p1 <- 10
> des <- c(rep(1, p1), rep(2, (p-p1)))
> mu <- as.matrix(rexp(n, rate=1))
> Z <- t(apply(mu, 1, function(mui) rnorm(p, mean=mui, sd=1)))
> ### 5 up regulated genes
> Z[1:5,1:p1] <- Z[1:5,1:p1] + 5
> ### 10 down regulated genes
> Z[6:15,(p1+1):p] <- Z[6:15,(p1+1):p] + 4
> 
> res <- fdr(Z, des)
> qValues <- qval(res$Q, ac2(Z, des))
> plot(res$th, res$Q, type="l", col="blue")
> lines(res$th, qValues[order(abs(ac2(Z, des)))], col="green")
> legend(x="topright", legend=c("FDR", "Q Values"), lty=c(1,1), 
+     col=c("blue", "green"))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>