pcot2                 package:pcot2                 R Documentation

_P_r_i_n_c_i_p_a_l _C_o_o_r_d_i_n_a_t_e_s _a_n_d _H_o_t_e_l_l_i_n_g'_s _T-_S_q_u_a_r_e

_D_e_s_c_r_i_p_t_i_o_n:

     The 'pcot2' function implements the PCOT2 testing method, which is
     a two-stage permutation-based approach for testing changes in
     activity in pre-specified gene sets.

_U_s_a_g_e:

     pcot2(emat, class = NULL, imat, permu = "ByColumn", iter = 1000, alpha = 0.05, adjP.method = "BY", var.equal = TRUE, ncomp = 2, dist.method = "euclidean")

_A_r_g_u_m_e_n_t_s:

    emat: A gene expression matrix with no missing values; Each row
          represents a gene and each column represents a sample. 

   class: Class labels representing two distinct experimental
          conditions (e.g., normal and disease). 

    imat: The gene category indicator matrix indicates presence or
          absence of genes in pre-defined gene sets (e.g., gene
          pathways). The indicator matrix contains rows representing
          gene identifiers of genes present in the expression data and
          columns representing pre-defined group names. A value of 1
          indicates the presence of a gene and 0 indicates the absence
          for the gene in a particular group.

   permu: Specifies whether genes or samples are permuted.  By default,
          permutations are performed by sample ("ByColumn").

    iter: The number indicates how many permutations will be performed
          in the analysis. 

   alpha: alpha determines the significance threshold for the
          permutation p-values. 

adjP.method: Specifies that p-values be adjusted by one of the
          following methods: "bonferroni", "holm", "hochberg",
          "hommel", "BH" (Benjamini and Hochberg), or "BY"  (Benjamini
          and Yekutieli).

var.equal: Specifies the use of either a pooled estimate of correlation
          for the two classes or an unpooled estimate for calculating
          each T-squared statistic. By default, the pooled estimate is
          used.

   ncomp: The dimensionality to which the data matrix is reduced via
          principal coordinates. The default dimensionality is set as
          'ncomp=2'.

dist.method: Specifies the method for calculating distance in the PCO
          procedure.  The available distance methods are "euclidean",
          "maximum", "manhattan", "canberra", "binary",
          "pearson","correlation" or "spearman". For additional details
          see the 'amap' package and the help documentation for the
          'Dist' function.

_D_e_t_a_i_l_s:

     The raw permutation p-values are adjusted for multiple testing by
     a call to 'p.adjust'.

_V_a_l_u_e:

 res.all: A data frame which prints information for all pathways

 res.sig: A data frame which prints information for significant
          pathways at a given alpha level

comparison: Print the contrast used in the analysis

     ...

_A_u_t_h_o_r(_s):

     Sarah Song and Mik Black

_R_e_f_e_r_e_n_c_e_s:

     S.Song and M.Black (2006) PCOT2: an R package for assessing
     expression changes in groups of related genes. Submitted to
     Bioinformatics.

_S_e_e _A_l_s_o:

     'corplot','corplot2','aveProbe'

_E_x_a_m_p_l_e_s:

     ns <- 40  ## 40 samples
     cla <- rep(c("Trt","Ctr"),each=ns/2)
     ngene <- 10  ## 10 genes per group 
     npath <- 10  ## 10 groups

     nreal <- 3  ## alter groups ##
     nnull <- npath-nreal   ## null groups ##
     pname <- c(paste("RealP",1:nreal, sep=""), paste("NullP",1:nnull, sep=""))

     ## Three main inputs in the function ##
     ## [1] Simulate (gene) expression matrix (emat) ##
     rmv <- function(mn, covm, nr, nc){
        sigma <- diag(nr)
        sigma[sigma==0] <- covm
        x1 <- rmvnorm(nc/2, mean=mn, sigma=sigma)
        x0 <- rmvnorm(nc/2, mean=rep(0,nr), sigma=sigma)
        mat <- t(rbind(x1,x0))
       return(mat)
     }

     covm <- 0.9  ##covariance 
     ct <- c(6,8,10)  ##mean

     library(mvtnorm)
     emat <- c()
     for (i in 1:nreal) emat <- rbind(emat, rmv(rep(ct[i],ngene),covm=covm, ngene, ns))  # for alt pathways
     for (i in 1:(npath-nreal)) emat <- rbind(emat, rmv(mn=rep(0,ngene),covm=covm, nr=ngene, nc=ns))
     dimnames(emat) <- list(paste("Gene", 1:(ngene*npath),sep=""), cla)

     ## [2] class label ##
     cla

     ## [3] indicator matrix (row: genes and col: pathways)
     imat <- kronecker(diag(npath),rep(1,ngene))
     dimnames(imat) <- list(paste("Gene",1:(ngene*npath), sep=""), pname)

     results.pcot2 <- pcot2(emat, cla, imat)
     results.pcot2$res.sig
     results.pcot2$res.all

