Last data update: 2014.03.03

R: Single Time Point Analysis for Detecting Differentially...
stpR Documentation

Single Time Point Analysis for Detecting Differentially Expressed Genes

Description

Performs the Single Time Point Analysis for detecting differentially expressed genes following Acosta (2015).

Usage

stp(Z, design, alpha = 0.05, B = 100, lambda = 0.5, 
    th = NULL, PER = FALSE, BCa = FALSE, gamma = 0.95, 
    R = 1000, ...)

Arguments

Z

a matrix or data.frame representing genes' expression levels. The rows of Z correspond to the genes in the experiment, and the columns correspond to the replicates. Treatment replicates are to the left, control replicates to the right.

design

a vector of length equal to the number of columns in Z with 1's for the treatment replicates and 2's for the control replicates (1, …, 1, 2, …, 2).

alpha

between 0 and 1. Desired level for controlling the false discovery rate (FDR).

B

Number of bootstrap or permutation replications for estimating the FDR.

lambda

Parameter for the estimation of pi0 and of the FDR (see Storey, 2002).

th

Threshold values for estimating the FDR. If NULL, the values from abs(ac2(Z,design)) are used.

PER

If FALSE (default), bootstrap replications are used to estimate the FDR. If TRUE, permutation replications are used instead.

BCa

If TRUE, a BCa confidence upper bound for the FDR is computed (see Efron and Tibshirani, 1994).

gamma

Confidence level for the FDR's BCa confidence upper bound.

R

Number of bootstrap replications for the computation of the FDR's BCa confidence upper bound.

...

additional arguments for parallel computation in boot function (see Details).

Details

For details on the computations performed in this function, see Acosta (2015).

Additional parameters in the '...' argument are used for parallel computation in bootstrap calculations. These are supplied to calls to the boot function in package boot. With this in mind, the use of additional arguments must be restricted to arguments parallel and ncpus from function boot.

Value

stp returns an object of class 'STP', which is a list with components:

dgenes

factor with the classification of each gene in Z. Classes: "up-reg.", "down-reg.", "no-diff.".

tstar

Threshold value used to identify differentially expressed genes.

astar

Achieved FDR level.

Q

Estimations of the FDR using each value in th as threshold.

th

Threshold values used for estimating the FDR.

qvalues

Estimated Q-Values for the genes in the analysis. If argument th!=NULL, these are not computed.

pi0

Estimation of pi0, the true proportion of non differentially expressed genes in the experiment.

B

Number of bootstrap or permutation replications used for estimating the FDR.

lambda

Parameter used for the estimation of pi0 and the FDR.

ac

Artificial components of Z.

gNames

Gene names (by default the row names in Z).

iRatio

Inertia ratio Var(ψ[2]) / λ[1], where λ[1] is the first eigenvalue of Z's Principal Components Analysis.

bca

BCa upper confidence bounds for the FDR using each value in th as the threshold.

gamma

Confidence level used in the computation of the BCa upper bounds.

alpha

Desired FDR level.

call

The matched call.

Warning

If argument BCa=TRUE, computations may take a considerable amount of time.

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.

Efron B. and Tibshirani R. J. (1994) An Introduction to the Bootstrap. Chapman & Hall/CRC, 1993.

See Also

tc for Time Course Analysis; plot.STP, print.STP.

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

resSTP <- stp(Z, des)
resSTP
plot(resSTP)


## Not run: 
## Phytophthora Infestans Single Time Point Analysis (takes time...)
dataPI <- phytophthora[[4]]
desPI <- c(rep(1,8), rep(2,8))
resPI <- stp(dataPI, desPI)
resPI
plot(resPI, tp="60 hai")

## End(Not run)

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/stp.Rd_%03d_medium.png", width=480, height=480)
> ### Name: stp
> ### Title: Single Time Point Analysis for Detecting Differentially
> ###   Expressed Genes
> ### Aliases: stp
> 
> ### ** 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
> 
> resSTP <- stp(Z, des)
> resSTP

Single time point analysis for detecting differentially
expressed genes in microarray data.

Achieved FDR: 1.9%.

Inertia ratio: %.
tstar: 4.292, pi0: 1, B: 100.
 
Differentially expressed genes:
down-reg.  no-diff.   up-reg. 
       10       485         5 

Results: 
     psi1   psi2 Q-value Diff. expr.
1   7.734  7.264   0.000     up-reg.
2   6.677  8.902   0.000     up-reg.
3   3.837  7.391   0.000     up-reg.
4  10.010  8.629   0.000     up-reg.
5   4.755  6.395   0.002     up-reg.
6   5.608 -7.093   0.000   down-reg.
7   7.473 -6.532   0.002   down-reg.
8   4.090 -6.391   0.002   down-reg.
9   5.331 -5.855   0.003   down-reg.
10  4.794 -5.724   0.004   down-reg.
11  5.215 -5.738   0.004   down-reg.
12  3.722 -5.272   0.005   down-reg.
13  3.026 -5.330   0.005   down-reg.
14  5.974 -4.909   0.008   down-reg.
15  5.962 -4.292   0.019   down-reg.
16 -2.107 -2.159   0.219    no-diff.
17 -2.597 -2.070   0.238    no-diff.
18  2.652 -2.008   0.248    no-diff.
19 -2.795  1.848   0.328    no-diff.
20 -3.461  1.783   0.356    no-diff.
21 -2.825 -1.651   0.432    no-diff.
22 -2.729  1.651   0.432    no-diff.
23 13.567 -1.630   0.432    no-diff.
24  3.393  1.638   0.432    no-diff.
25 -2.685 -1.588   0.473    no-diff.
...

*More results are available in the objects:
$ac, $qvalues and $dgenes.
> plot(resSTP)
> 
> 
> ## Not run: 
> ##D ## Phytophthora Infestans Single Time Point Analysis (takes time...)
> ##D dataPI <- phytophthora[[4]]
> ##D desPI <- c(rep(1,8), rep(2,8))
> ##D resPI <- stp(dataPI, desPI)
> ##D resPI
> ##D plot(resPI, tp="60 hai")
> ## End(Not run)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>