CeTF: an R/Bioconductor package for transcription factor co-expression networks using regulatory impact factors (RIF) and partial correlation and information (PCIT) analysis

Background Finding meaningful gene-gene interaction and the main Transcription Factors (TFs) in co-expression networks is one of the most important challenges in gene expression data mining. Results Here, we developed the R package “CeTF” that integrates the Partial Correlation with Information Theory (PCIT) and Regulatory Impact Factors (RIF) algorithms applied to gene expression data from microarray, RNA-seq, or single-cell RNA-seq platforms. This approach allows identifying the transcription factors most likely to regulate a given network in different biological systems — for example, regulation of gene pathways in tumor stromal cells and tumor cells of the same tumor. This pipeline can be easily integrated into the high-throughput analysis. To demonstrate the CeTF package application, we analyzed gastric cancer RNA-seq data obtained from TCGA (The Cancer Genome Atlas) and found the HOXB3 gene as the second most relevant TFs with a high regulatory impact (TFs-HRi) regulating gene pathways in the cell cycle. Conclusion This preliminary finding shows the potential of CeTF to list master regulators of gene networks. CeTF was designed as a user-friendly tool that provides many highly automated functions without requiring the user to perform many complicated processes. It is available on Bioconductor (http://bioconductor.org/packages/CeTF) and GitHub (http://github.com/cbiagii/CeTF). Supplementary Information The online version contains supplementary material available at (10.1186/s12864-021-07918-2).


INTRODUCTION
This vignette provides the necessary instructions for performing the Partial Correlation coefficient with Information Theory (PCIT) (Reverter and Chan 2008) and Regulatory Impact Factors (RIF) (Reverter et al. 2010) algorithm. The PCIT algorithm identifies meaningful correlations to define edges in a weighted network and can be applied to any correlation-based network including but not limited to gene co-expression networks, while the RIF algorithm identify critical transcript factors (TF) from gene expression data. These two algorithms when combined provide a very relevant layer of information for gene expression studies (Microarray, RNA-seq and single-cell RNA-seq data).

REGULATORY INFORMATION FACTORS (RIF)
A gene expression data from microarray, RNA-seq or single-cell RNA-seq spanning two biological conditions of interest (e.g. normal/tumor, healthy/disease, malignant/nonmalignant) is subjected to standard normalization techniques and significance analysis to identify the target genes whose expression is differentially expressed (DE) between the two conditions. Then, the regulators (e.g. Transcript Factors genes) are identified in the data. The TF genes can be obtained from the literature (Wang and Nishida 2015) (Vaquerizas et al. 2009). Next, the co-expression correlation between each TF and the DE genes is computed for each of the two conditions. This allows for the computation of the differential wiring (DW) from the difference in co-expression correlation existing between a TF and a DE genes in the two conditions. As a result, RIF analysis assigns an extreme score to those TF that are consistently most differentially co-expressed with the highly abundant and highly DE genes (case of RIF1 score), and to those TF with the most altered ability to act as predictors of the abundance of DE genes (case of RIF2 score). A given TF may not show a change in expression profile between the two conditions to score highly by RIF as long as it shows a big change in co-expression with the DE genes. To this particular, the profile of the TF gene (triangle, solid line) is identical in both conditions (slightly downwards). Instead, the DE gene (circle, dashed line) is clearly over-expressed in condition B. Importantly, the expression of the TF and the DE gene shows a strong positive correlation in condition A, and a strong negative correlation in condition B. Figure 1. A schematic diagram of the RIF analysis. (A) Gene expression data is normalized and statistically assessed to identify differentially expressed (DE) genes and differentially PIF genes (represented by circles) which together are deemed as the Target genes; Simultaneously, (B) transcription factors (TF, represented by triangles) included in the microarray are collected and (C) their co-expression correlation with the target genes computed for each of the two conditions of interest; Finally, (D) the way in which TF and target genes are differentially co-expressed between the two conditions is used to compute the relevance of each TF according to RIF1 and RIF2 (Reverter et al. 2010).

PARTIAL CORRELATION WITH INFORMATION THEORY (PCIT)
The proposed PCIT algorithm contains two distinct steps as follows: Step 1 -Partial correlations For every trio of genes in x, y and z, the three first-order partial correlation coefficients are computed by: , and similarly for !$." and "$.! .
The partial correlation coefficient between x and y given z (here denoted by !".$ ) indicates the strength of the linear relationship between x and y that is independent of (uncorrelated with) z.
Calculating the ordinary (or unconditional or zero-order) correlation coefficient and comparing it with the partial correlation, we might see that the association between the two variables has been sharply reduced after eliminating the effect of the third variable.

Step 2 -Information theory
We invoke the Data Processing Inequality (DPI) theorem of Information Theory which states that 'no clever manipulation of the data can improve the inference that can be made from the data' (Cover and Thomas 2012). For every trio of genes, and in order to obtain the tolerance level ( ) to be used as the local threshold for capturing significant associations, the average ratio of partial to direct correlation is computed as follows: In the context of our network reconstruction, a connection between genes x and y is discarded if: Otherwise, the association is defined as significant, and a connection between the pair of genes is established in the reconstruction of the GCN. To ascertain the significance of the association between genes x and y, the above mentioned Steps 1 and 2 are repeated for each of the remaining n−2 genes (denoted here by z).

INSTALLATION
To install, just type: for Linux users is necessary to install libcurl4-openssl-dev, libxml2-dev and libssl-dev dependencies.

WORKFLOW
There are many ways to perform the analysis. The following sections will be splited by steps, and finishing with the complete analysis with visualization. We will use the airway (Himes et al. 2014) dataset in the following sections. This dataset provides a RNA-seq count data from four human ASM cell lines that were treated with dexamenthasone -a potent synthetic glucocorticoid. Briefly, this dataset has 4 samples untreated and other 4 samples with the treatment.

PCIT
The first option is to perform the PCIT analysis. The output will be a list with 3 elements. The first one contains a dataframe with the pairwise correlation between genes (corr1) and the significant pairwise correlation (corr2 ≠ 0). The second element of the list stores the adjacency matrix with all correlation. And the last element contains the adjacency matrix with only the significant values:

Histogram of connectivity distribution
After performing the PCIT analysis, it is possible to verify the histogram distribution of the clustering coefficient of the adjacency matrix with the significant values: # Example for trt condition histPlot(PCIT_out_trt$adj_sig)

Density Plot of raw correlation and significant PCIT
It's possible to generate the density plot with the significance values of correlation. We'll use the raw adjacency matrix and the adjacency matrix with significant values. It is necessary to define a cutoff of the correlation module (values between -1 and 1) that will be considered as significant: # Example for trt condition densityPlot(mat1 = PCIT_out_trt$adj_raw, mat2 = PCIT_out_trt$adj_sig, threshold = 0.5)

RIF
To perform the RIF analysis we will need the count data, an annotation table and a list with the Transcript Factors of specific organism (Homo sapiens in this case) and follow the following steps in order to get the output (dataframe with the average expression, RIF1 and RIF2 metrics for each TF):

WHOLE ANALYSIS OF REGULATORY IMPACT FACTORS (RIF) AND PARTIAL CORRELATION AND INFORMATION THEORY ANALYSIS (PCIT)
Finally, it is possible to run the entire analysis all at once. The output will be a CeTF object with all results generated between the different steps. To access the CeTF object is recommended to use the accessors from CeTF class:

Getting some graphical outputs
Based on CeTF class object resulted from runAnalysis function is possible to get a plot for Differentially Expressed (DE) genes that shows the relationship between log(baseMean) and Difference of Expression or log2FoldChange, enabling the visualization of the distribution of DE genes and TF in both conditions. These two first plot provides a initial graphical visualization of results: # Using the runAnalysis output (CeTF class object) SmearPlot(object = out, diffMethod = 'Reverter', lfc = 1.5, conditions = c('untrt', 'trt'), type = "DE") Then is possible to generate the same previous plot but now for a single TF. So, if you have a specific TF that you want to visualize, this is the recommended plot: # Using the runAnalysis output (CeTF class object) SmearPlot(object = out, diffMethod = 'Reverter', lfc = 1.5, conditions = c('untrt', 'trt'), TF = 'ENSG00000185917', label = TRUE, type = "TF") The next output is a network for both conditions resulted from :

# Using the runAnalysis output (CeTF class object) netConditionsPlot(out)
Then we will associate the genes in both conditions with Gene Ontology (GO) and other databases. getGroupGO function will be performed where a set of genes are counted within all possible ontologies, without statistical power. This function is capable of perform groupGO for any organism as long as it's annotation package exists (i.e. org.Hs.eg.db, org.Bt.eg.db, org.Rn.eg.db, etc). In this example we will perform only for first condition: # Loading Homo sapiens annotation package library(org.Hs.eg.db) # Accessing the network for condition 1 genes <-unique(c(as.character(NetworkData(out, "network1")[, "gene1"]), as.character(NetworkData(out, "network1")[, "gene2"]))) # Performing getGroupGO analysis cond1 <-getGroupGO(genes = genes, ont = "BP", keyType = "ENSEMBL", annoPkg = org.Hs.eg.db, level = 3) Alternatively, it is possible to perform the enrichment analysis with a statistical power. In this case, there are many databases options to perform this analysis (i.e. GO, KEGG, REACTOME, etc).
The getEnrich function will perform the enrichment analysis and returns which pathways are enriched in a given set of genes. This analysis requires a reference list of genes with all genes that will be considered to enrich. In this package there is a function, refGenes that has these references genes for ENSEMBL and SYMBOL nomenclatures for 5 organisms: Human (Homo sapiens), Mouse (Mus musculus), Zebrafish (Danio rerio), Cow (Bos taurus) and Rat (Rattus norvegicus). If the user wants to use a different reference set, simply inputs a character vector with the genes.

USING ACCESSORS TO ACCESS RESULTS
Is possible to use the accessors from CeTF class object to access the outputs generated by the runAnalysis function. These outputs can be used as input in Cytoscape (Shannon et al. 2003). The accessors are: • getData: returns the raw, tpm and normalized data; • getDE: returns the DE genes and TFs; • InputData returns the input matrices used to perform RIF and PCIT in runAnalysis function; • OutputData returns the output matrices and lists that output from RIF and PCIT in runAnalysis function; • NetworkData returns the network of interactions between gene and key TFs for both conditions, the keyTFs and the annotation for each gene and TF.
All accessors can be further explored by looking in more detail at the documentation.

ADDITIONAL FEATURES
This package has some additional features to plot the results. Let's use the gene set from airway data previously used. The features are:

Network diffusion analysis
Network propagation is an important and widely used algorithm in systems biology, with applications in protein function prediction, disease gene prioritization, and patient stratification. Propagation provides a robust estimate of network distance between sets of nodes. Network propagation uses the network of interactions to find new genes that are most relevant to a set of well understood genes. To perform this analysis is necessary to install the latest Cytoscape software version and know the path that will be installed the software. After running the diffusion analysis is possible to perform the enrichment for the subnetwork resulted. Finally, ih this vignette we'll not perform the diffusion analysis because this requires Cytoscape to be installed.

Circos plot
This plot makes it possible to visualize the targets of specific TFs or genes. The main idea is to identify which chromosomes are linked to the targets of a given gene or TF to infer whether there are cis (same chromosome) or trans (different chromosomes) links between them. The black links are between different chromosomes while the red links are between the same chromosome.

RIF relationships plots
To visualize the relationship between RIF results (RIF1 and RIF2) is possible to generate the following plot: