qpFunctionalCoherence        package:qpgraph        R Documentation

_F_u_n_c_t_i_o_n_a_l _c_o_h_e_r_e_n_c_e _e_s_t_i_m_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Estimates functional coherence for a given transcriptional
     regulatory network.

_U_s_a_g_e:

     qpFunctionalCoherence(I, TFgenes, chip, minRMsize=5, verbose=FALSE)

_A_r_g_u_m_e_n_t_s:

       I: incidence matrix of the undirected graph representing the
          transcriptional regulatory network.

 TFgenes: vector of transcription factor gene (matching the genes at
          the rows and column names of 'I'.

    chip: name of the '.db' package containing the Gene Ontology (GO)
          annotations.

minRMsize: minimum size of the target gene set in each regulatory
          module where functional enrichment will be calculated and
          thus where functional coherence will be estimated.

 verbose: logical; if TRUE the function will show progress on the
          calculations; if FALSE the function will remain quiet
          (default).

_D_e_t_a_i_l_s:

     This function estimates the functional coherence of a
     transcriptional regulatory network represented by means of an
     undirected graph encoded by an incidence matrix and of a set of
     transcription factor genes. The functional coherence of a
     transcriptional regulatory network is calculated as specified by
     Castelo and Roverato (2008) and corresponds to the distribution of
     individual functional coherence values of every of the regulatory
     modules of the network each of them defined as a transcription
     factor and its set of putatively regulated target genes. In the
     calculation of the functional coherence value of a regulatory
     module, Gene Ontology (GO) annotations are employed through the
     given annotation '.db' package and the conditional hyper-geometric
     test implemented in the 'GOstats' package from Bioconductor.

_V_a_l_u_e:

     A list with three slots, a first one containing the
     transcriptional regulatory network as a list of regulatory modules
     and their targets, a second one containing this same network but
     including only those modules with GO BP annotations and a third
     one consisting of a vector of functional coherence values.

_A_u_t_h_o_r(_s):

     R. Castelo and A. Roverato

_R_e_f_e_r_e_n_c_e_s:

     Castelo, R. and Roverato, A. Reverse engineering molecular
     regulatory networks from microarray data with qp-graphs. _J. Comp.
     Biol., accepted_, 2008.

_S_e_e _A_l_s_o:

     'qpAvgNrr' 'qpGraph'

_E_x_a_m_p_l_e_s:

     library(annotate)
     library(org.EcK12.eg.db)

     # load RegulonDB data from this package
     data(EcoliOxygen)

     # pick two TFs from the RegulonDB data in this package

     TFgenes <- c("mhpR", "iscR")

     # get their Entrez Gene Identifiers
     TFgenesEgIDs <- unlist(mget(TFgenes, revmap(getAnnMap("SYMBOL", "org.EcK12.eg.db"))))

     # get all genes involved in their regulatory modules from
     # the RegulonDB data in this package
     mt <- match(filtered.regulon6.1[,"EgID_TF"], TFgenesEgIDs)

     allGenes <- as.character(unique(as.vector(
                 as.matrix(filtered.regulon6.1[!is.na(mt),
                                               c("EgID_TF","EgID_TG")]))))

     mtTF <- match(filtered.regulon6.1[,"EgID_TF"],allGenes)
     mtTG <- match(filtered.regulon6.1[,"EgID_TG"],allGenes)

     # select the corresponding subset of the RegulonDB data in this package
     subset.filtered.regulon6.1 <- filtered.regulon6.1[!is.na(mtTF) & !is.na(mtTG),]
     TFi <- match(subset.filtered.regulon6.1[,"EgID_TF"], allGenes)
     TGi <- match(subset.filtered.regulon6.1[,"EgID_TG"], allGenes)
     subset.filtered.regulon6.1 <- cbind(subset.filtered.regulon6.1,
                                         idx_TF=TFi, idx_TG=TGi)

     # build an incidence matrix representing the transcriptional regulatory
     # relationships from these regulatory modules
     p <- length(allGenes)
     incidenceMatrix <- matrix(FALSE, nrow=p, ncol=p)
     rownames(incidenceMatrix) <- colnames(incidenceMatrix) <- allGenes
     idxTFTG <- as.matrix(subset.filtered.regulon6.1[,c("idx_TF","idx_TG")])
     incidenceMatrix[idxTFTG] <-
       incidenceMatrix[cbind(idxTFTG[,2],idxTFTG[,1])] <- TRUE

     # calculate functional coherence on these regulatory modules
     fc <- qpFunctionalCoherence(incidenceMatrix, TFgenesEgIDs, "org.EcK12.eg.db")

     print(sprintf("the %s module has a FC value of %.2f",
                   mget(names(fc$functionalCoherenceValues),org.EcK12.egSYMBOL),
                   fc$functionalCoherenceValues))

