Last data update: 2014.03.03

R: Plot Method for Time Course Analysis
plot.TCR Documentation

Plot Method for Time Course Analysis

Description

a method for the plot generic. It is designed for displaying plots of the estimated FDR and the genes' classification when performing a Time Course Analysis for detecting differentially expressed genes in gene expression data.

Usage

## S3 method for class 'TC'
plot(x, iRatios=TRUE, FDR = TRUE, AC = TRUE, 
    WARNINGS = FALSE, ...)

Arguments

x

if TRUE, a plot of inertia ratios for all the time points is displayed.

iRatios

an object of class 'TC' as returned by function tc.

FDR

if TRUE, a plot of the estimated FDRs are displayed for each time point.

AC

if TRUE, a plot of the differentially expressed genes in the artificial components is displayed for each time point.

WARNINGS

if TRUE and if a BCa confidence upper bound was computed for obtaining x, the threshold values for which an extreme order statistic was used in the BCa computations are shown (these warnings are produced in calls to boot.ci).

...

further arguments passed to or from other methods.

Author(s)

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

See Also

tc, print.TC, summary.TC.

Examples

## Time course analysis for 500 genes with 10 treatment 
## replicates and 10 control replicates
tPts <- c("h0", "12h", "24h")
n <- 500; p <- 20; p1 <- 10
Z <- vector("list", 3)
des <- vector("list", 3)
for(tp in 1:3){ des[[tp]] <- c(rep(1, p1), rep(2, (p-p1))) }
mu <- as.matrix(rexp(n, rate=1))
### h0 time point (no diff. expr.)
Z[[1]] <- t(apply(mu, 1, function(mui) rnorm(p, mean=mui, sd=1)))
### h12 time point (diff. expr. begins)
Z[[2]] <- t(apply(mu, 1, function(mui) rnorm(p, mean=mui, sd=1)))
#### Up regulated genes
Z[[2]][1:5,1:p1] <- Z[[2]][1:5,1:p1] + 
    matrix(runif(5*p1, 1, 3), nrow=5)
#### Down regulated genes
Z[[2]][6:15,(p1+1):p] <- Z[[2]][6:15,(p1+1):p] + 
    matrix(runif(10*(p-p1), 1, 2), nrow=10)
### h24 time point (maximum differential expression)
Z[[3]] <- t(apply(mu, 1, function(mui) rnorm(p, mean=mui, sd=1)))
#### 5 up regulated genes
Z[[3]][1:5,1:p1] <- Z[[3]][1:5,1:p1] + 5
#### 10 down regulated genes
Z[[3]][6:15,(p1+1):p] <- Z[[3]][6:15,(p1+1):p] + 4

resTC <- tc(Z, des)
resTC
summary(resTC)
plot(resTC)

## Not run: 
## Phytophthora Infestans Time Course Analysis (takes time...)
dataPI <- phytophthora
desPI <- vector("list", 4)
for(tp in 1:4){ desPI[[tp]] <- c(rep(1, 8), rep(2, 8)) }
resPI <- tc(dataPI, desPI)
resPI
summary(resPI)
plot(resPI)

## 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/plot.TC.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot.TC
> ### Title: Plot Method for Time Course Analysis
> ### Aliases: plot.TC
> 
> ### ** Examples
> 
> ## Time course analysis for 500 genes with 10 treatment 
> ## replicates and 10 control replicates
> tPts <- c("h0", "12h", "24h")
> n <- 500; p <- 20; p1 <- 10
> Z <- vector("list", 3)
> des <- vector("list", 3)
> for(tp in 1:3){ des[[tp]] <- c(rep(1, p1), rep(2, (p-p1))) }
> mu <- as.matrix(rexp(n, rate=1))
> ### h0 time point (no diff. expr.)
> Z[[1]] <- t(apply(mu, 1, function(mui) rnorm(p, mean=mui, sd=1)))
> ### h12 time point (diff. expr. begins)
> Z[[2]] <- t(apply(mu, 1, function(mui) rnorm(p, mean=mui, sd=1)))
> #### Up regulated genes
> Z[[2]][1:5,1:p1] <- Z[[2]][1:5,1:p1] + 
+     matrix(runif(5*p1, 1, 3), nrow=5)
> #### Down regulated genes
> Z[[2]][6:15,(p1+1):p] <- Z[[2]][6:15,(p1+1):p] + 
+     matrix(runif(10*(p-p1), 1, 2), nrow=10)
> ### h24 time point (maximum differential expression)
> Z[[3]] <- t(apply(mu, 1, function(mui) rnorm(p, mean=mui, sd=1)))
> #### 5 up regulated genes
> Z[[3]][1:5,1:p1] <- Z[[3]][1:5,1:p1] + 5
> #### 10 down regulated genes
> Z[[3]][6:15,(p1+1):p] <- Z[[3]][6:15,(p1+1):p] + 4
> 
> resTC <- tc(Z, des)
> resTC

Time course analysis for detecting differentially expressed
genes in microarray data.
 
Inertia ratios (%): 
   t1   t2    t3
 4.47 7.34 16.72

Active timepoint: t3 


TIME POINT: t1.

Achieved FDR: 92.9%.

Inertia ratio: %.
tstar: 1.439, pi0: 1, B: 100.
 
Differentially expressed genes:
down-reg.  no-diff.   up-reg. 
       13       478         9 

Results: 
     psi1   psi2 Q-value Diff. expr.
1  -2.270  1.844   0.929     up-reg.
2  -3.061  1.764   0.929     up-reg.
3  -3.484  1.465   0.929     up-reg.
4  -1.882  1.863   0.929     up-reg.
5   6.153  1.488   0.929     up-reg.
6  -2.888  1.473   0.929     up-reg.
7  -0.530  1.487   0.929     up-reg.
8  -1.523  1.498   0.929     up-reg.
9  -3.274  1.537   0.929     up-reg.
10  0.549 -1.630   0.929   down-reg.
...

*More results are available in the objects:
$ac, $qvalues and $dgenes.


TIME POINT: t2.

Achieved FDR: 3.7%.

Inertia ratio: %.
tstar: 2.852, pi0: 1, B: 100.
 
Differentially expressed genes:
down-reg.  no-diff.   up-reg. 
        3       493         4 

Results: 
     psi1   psi2 Q-value Diff. expr.
1   1.727  3.391   0.000     up-reg.
2   4.384  3.591   0.000     up-reg.
3   5.575  3.313   0.002     up-reg.
4   5.438  3.034   0.025     up-reg.
5   0.126 -3.347   0.002   down-reg.
6   1.426 -3.305   0.002   down-reg.
7   0.618 -2.852   0.037   down-reg.
8   3.882 -2.609   0.069    no-diff.
9   0.757  2.455   0.103    no-diff.
10 -1.231 -2.390   0.115    no-diff.
11  0.913 -2.282   0.141    no-diff.
12  0.931 -2.275   0.141    no-diff.
13 -1.343 -1.963   0.383    no-diff.
14 -3.606  1.893   0.447    no-diff.
15  2.574  1.853   0.459    no-diff.
16 -0.370  1.835   0.459    no-diff.
17  1.687 -1.772   0.472    no-diff.
...

*More results are available in the objects:
$ac, $qvalues and $dgenes.


TIME POINT: t3.

Achieved FDR: 0.8%.

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

Results: 
     psi1   psi2 Q-value Diff. expr.
1   6.504  6.915   0.000     up-reg.
2  10.193  6.926   0.000     up-reg.
3   9.159  8.305   0.000     up-reg.
4  10.030  7.583   0.000     up-reg.
5   5.411  6.589   0.001     up-reg.
6   3.796 -5.820   0.001   down-reg.
7   4.830 -6.468   0.001   down-reg.
8   3.498 -6.247   0.001   down-reg.
9   3.975 -6.145   0.001   down-reg.
10  5.669 -5.944   0.001   down-reg.
11  6.641 -5.716   0.002   down-reg.
12  6.307 -5.390   0.006   down-reg.
13  4.453 -5.338   0.006   down-reg.
14  7.269 -5.239   0.006   down-reg.
15  9.875 -5.041   0.008   down-reg.
16  8.863  2.904   0.091    no-diff.
17 -3.269  2.605   0.123    no-diff.
18  2.240 -2.102   0.232    no-diff.
19 -2.073  2.140   0.232    no-diff.
20 -4.037  2.139   0.232    no-diff.
21  1.414 -1.963   0.270    no-diff.
22 -0.684 -1.957   0.270    no-diff.
23 -0.547  1.939   0.270    no-diff.
24  0.294  1.983   0.270    no-diff.
25 -2.363 -1.699   0.368    no-diff.
...

*More results are available in the objects:
$ac, $qvalues and $dgenes.
> summary(resTC)

Time course analysis for detecting differentially
expressed genes in microarray data.
 
Inertia ratios (%): 
   t1   t2    t3
 4.47 7.34 16.72


Active vs complementary time points analysis:

Active timepoint: t3 

Achieved FDR: 0.8 %.

Differentially expressed genes:
down-reg.  no-diff.   up-reg. 
       10       485         5 


Groups conformation through time analysis:

Differentially expressed genes:
 t2 vs t3           
            down-reg. no-diff. up-reg. Sum
  down-reg.         3        0       0   3
  no-diff.          7      485       1 493
  up-reg.           0        0       4   4
  Sum              10      485       5 500
> plot(resTC)
> 
> ## Not run: 
> ##D ## Phytophthora Infestans Time Course Analysis (takes time...)
> ##D dataPI <- phytophthora
> ##D desPI <- vector("list", 4)
> ##D for(tp in 1:4){ desPI[[tp]] <- c(rep(1, 8), rep(2, 8)) }
> ##D resPI <- tc(dataPI, desPI)
> ##D resPI
> ##D summary(resPI)
> ##D plot(resPI)
> ## End(Not run)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>