wTO: an R package for computing weighted topological overlap and a consensus network with integrated visualization tool

Background Network analyses, such as of gene co-expression networks, metabolic networks and ecological networks have become a central approach for the systems-level study of biological data. Several software packages exist for generating and analyzing such networks, either from correlation scores or the absolute value of a transformed score called weighted topological overlap (wTO). However, since gene regulatory processes can up- or down-regulate genes, it is of great interest to explicitly consider both positive and negative correlations when constructing a gene co-expression network. Results Here, we present an R package for calculating the weighted topological overlap (wTO), that, in contrast to existing packages, explicitly addresses the sign of the wTO values, and is thus especially valuable for the analysis of gene regulatory networks. The package includes the calculation of p-values (raw and adjusted) for each pairwise gene score. Our package also allows the calculation of networks from time series (without replicates). Since networks from independent datasets (biological repeats or related studies) are not the same due to technical and biological noise in the data, we additionally, incorporated a novel method for calculating a consensus network (CN) from two or more networks into our R package. To graphically inspect the resulting networks, the R package contains a visualization tool, which allows for the direct network manipulation and access of node and link information. When testing the package on a standard laptop computer, we can conduct all calculations for systems of more than 20,000 genes in under two hours. We compare our new wTO package to state of art packages and demonstrate the application of the wTO and CN functions using 3 independently derived datasets from healthy human pre-frontal cortex samples. To showcase an example for the time series application we utilized a metagenomics data set. Conclusion In this work, we developed a software package that allows the computation of wTO networks, CNs and a visualization tool in the R statistical environment. It is publicly available on CRAN repositories under the GPL −2 Open Source License (https://cran.r-project.org/web/packages/wTO/).


Background
Recent applications of complex network analysis methods have provided important new knowledge of the functioning and interactions of genes at the systems level [1][2][3][4]. Within the area of biological network analyses, co-expression networks have received much attention [5,6]. For the co-expression networks, a pair of nodes are typically connected by a link if the genes they represent show a significantly correlated expression pattern. In the network, this link may be represented as a binary relationship, where 1 = "presence" and 0 = "absence" of the link, or alternatively, the link may have a numeric value (often called weight). The magnitude of the weight is typically interpreted as representing the strength of a gene-pair relationship, and the sign as indicative of the type of associated gene interaction: positive if the genes are co-regulated, negative if they are oppositely controlled [7].
In many implementations of network analyses, we may primarily be interested in an a priori defined subset of genes with a specific set of properties. Examples include transcription factors (TFs), genes with known orthologs in a set of organisms of interest, or disease associated genes [8,9]. For these situations, oftentimes the choice is made to only take into account direct interactions between the gene-subset of interest, instead of including the full set of correlations. A major drawback with such an approach, is that relevant information contained in interaction patterns among excluded genes that would affect network topology and link strength values, is not incorporated in the network. The loss of such information is not only undesirable, but may also lead to biased results.
When analyzing networks in which the links have nonbinary weights, the method of weighted topological (wTO) network analysis [10] has been found very useful. In a wTO-analysis, a new link-weight for a pair of connected nodes is determined through an averaging process that accounts for all common network neighbors [10]. Thus, wTO is a method that implicitly includes correlations among nodes that are going to be exempt from further analysis. The wTO method [10][11][12] can be used to determine the overlap among classes of transcripts, for example TFs and non-coding RNAs (ncRNAs). The resulting wTO network provides a more robust representation of the connections and interactions among the node-set of interest than a simple correlation network analysis focused only on the node-set of interest [13].
The packages WGCNA [14,15] and ARACNe [16,17] are widely used for weighted gene co-expression network analysis studies. The former provides functions for the calculation of the adjacency matrix for all pairs of genes as the n-th power of absolute correlations, resulting in an unsigned network. Network modules can be defined with this package by unsupervised clustering. The latter uses the mutual information (MI) of the expression in order to build the networks. These methods have received much attention in the literature [7,18].
Previously, Nowick and collaborators [13] developed a mathematical method to calculate the wTO for a set of nodes that explicitly takes into account both positive and negative correlations. This version of the wTO-measure is especially valuable for investigating networks, in which it matters whether an interaction is activating or inhibiting/repressing. For instance, in gene regulatory networks the effect of a transcription factor or a ncRNA on its target genes can be activating or repressing. In metabolic networks, the increase of a substance can lead to an increase or decrease of another substance. Or in ecological networks, species interactions can be positive or negative, for instance in symbiotic or predator-prey relationships. In such cases, a distinction between positive and negative correlations for the calculation of the wTO is necessary and using the absolute correlations would falsify the biological insights. This wTO-calculation methodology is implemented in the R package presented here. In order to avoid confusion, we will refer to the method for calculating a pair-wise link score as wTO and to the package as wTO.
When analyzing similar datasets, e.g. from a repeated experiment or independent studies on a similar subject, the resulting networks are usually different [19]. These differences may arise from several sources: (A) technical differences, such as the platform on which the expression data was measured, the facility where data was collected and prepared, or how data was processed. (B) Another cause may be biological differences from confounding factors, such as sex, age, and geographic origin of the individuals measured. It is thus desirable to obtain an integrated network that considers all independently derived networks as biological replicates and systematically identifies their commonalities. We developed a novel method to compute the network that captures all this information; we call this the consensus network (CN).
Here, we present wTO, an R package that is capable of computing both signed and unsigned wTO networks as well as the CN, thus providing methods for assigning p-values to each link. The package also comes with an integrated tool to visualize the resulting networks and allows for nine different methods for network clustering to aid in module identification. The workflow of the package is shown in Fig. 1.
We compare our method to other state of art methods. To exemplify the usage of our package, we show here results from the calculation of wTO and CN networks from three independent genome-wide expression studies of healthy human pre-frontal cortex samples and an analysis of a time-series dataset from a metagenomics study. Fig. 1 The wTO package workflow. Gray boxes refer to inputs, red boxes refer to content of the wTO package, yellow boxes are functions included in the package, blue boxes are outputs of those functions, and green boxes refer to methods internal to the package. Our package can deal with multiple kinds of data, for example RNA-seq counts or normalized values, microarray expression data, abundance data coming from metagenomic studies, and many more. All input data should be pre-processed with the quality control and normalization methods recommended for each respective type of data. The function wTO.Complete calculates the wTO values, as many times as desired. As output, the user will obtain an object containing the signed and absolute wTO values for each pair of nodes, p-values and p adj -values for multiple testing. This output can be used for the construction of a CN from independent networks using the function wTO.Consensus. Outputs from the wTO and CN networks can be used as an input for NetVis, which is an integrated tool for plotting networks. As an interactive tool it also allows the user to modify the network

Input data
Our package can handle a wide range of input data. Data can be discrete or continuous values. We recommend performing all commonly used steps for quality control and normalization before passing on the data to our package. For RNA-Seq data, our package can handle normalized quantification, for example RPKM (Reads Per Kilobase Million), FPKM (Fragments Per Kilobase Million), and TPM (Transcripts Per Kilobase Million). For microarray data, rma or mas5 values can be used. If our package is used with metagenomics data, for instance for analyzing co-occurrence networks, we recommend the abundance data to be normalized per day/ sample.

Weighted topological overlap calculation
For a system of N nodes (e.g. genes or species), we define the adjacency matrix A = [ a i,j ] based on correlations between a pair of nodes i and j as with ρ i,j being a correlation measure. Assuming that nodes i and j represent a sub-set of factors (e.g genes) of particular interest selected from the N nodes, we calculate the weighted topological overlap (wTO [13], ω i,j ) between node i and node j as where Note that, this expression explicitly includes both positive and negative correlations, and thus allows for ω i,j to take both positive and negative values. Other software packages calculating the ω i,j have implemented definitions of the wTO method that do not allow for negative values [14], making this version valuable for gene regulatory network analysis. The wTO package also calculates the unsigned network, and for that, it takes as an input the absolute values of the correlation.
Since Eq. (2) explicitly allows a i,j 0, we need to be aware of the limits of this expression. Consider three nodes i, j and u, and assume that a ij 0. All the terms in the numerator of Eq. (2) will be negative if a iu a uj 0 for all nodes u. However, if a iu a uj > 0, then at least some contributions to the sum will cancel out. The same rationale applies for the case of a ij ≥ 0.
To systematically assess the potential effect of term cancellation in Eq. (2), we calculate the absolute weighted topological overlap, |ω| which uses the absolute value of the correlations (a i,j = |a i,j |) as input for Eq. (2). In this case, the sign of the correlation is excluded from the analysis and only the magnitude of the link-strength is taken into account. Consequently, by generating a scatter plot of the signed and unsigned weights, it is possible to assess at which ω i,j -values term cancellations start affecting the results. Thus, for wTO values of interest, the closer the plot of ω vs. |ω| is to y = |x|, the better.
However, by just computing the wTO network we do not avoid all spurious correlations. A way to detect them is to compute a probability of each one of the link scores being zero using the hypothesis test of the null hypothesis (H 0 ) of no association against the two-sided alternative (H a ) of non-zero association. This can be computed by using bootstrap [20] or permutation resampling methods [13]. In the former, one resamples individuals, thus approximating the weights' empirical distribution and calculating the probability that an observed weight is sufficiently distant from zero. In the latter, one operates under the null hypothesis of no dependence among genes and permutes the gene labels, obtaining the weights' distribution under the null hypothesis, which is rejected if the observed weight is sufficiently extreme. We define δ as the maximal distance between the ω i,j calculated with each bootstrap and the ω i,j of the real dataset. This means that, the smaller δ is, the stronger is our confidence in a particular ω i,j . By default, δ is set to 0.2. One advantage of the wTO package is its application to analyze and make networks out of time-series data. Therefore, we are interested in the implementation of blocked bootstrap resampling [20] that can be used for temporal data without sample replicates for each time point. This type of resampling is necessary once there are two correlation components in those samples: The correlation inside the factors of each sample and the correlation across the time of different samples. For this situation, the use of a lag is required. Lags are particularly helpful in time-series analyses as autocorrelations are often present: a tendency of consecutive values to be correlated. An important benefit of the presence of autocorrelations is that we may be able to identify patterns inside a timeseries, such as seasonality (patterns that repeat themselves at a periodic frequency). Therefore, the lag can be chosen using a partial correlation of the time per sample. This is followed by calculating the wTO for a time series where the observations are not independent of each other.

A method for determining a consensus network
Berto and collaborators [19] described a consensus network based on gene-expression data from primates' frontal lobes by applying a Wilcoxon test on the links. Our proposed methodology allows the use of two or more datasets, each generating different (and significant) wTO values, to be combined into a single CN. Our approach has the advantage of penalizing links with opposite signs. According to the same rationale, links with the same sign among the multiple wTO networks, will have their CN i,j values closer to the largest ω i,j of a link among the k networks. Our first step is to remove nodes that do not exist in all networks. Consequently, if a node is absent in at least one network, we are not able to compute a consensus of the links that belong to that node. It is particularly important not to associate factors that were not measured in a particular condition.
In order to obtain a single integrated network derived from multiple independent wTO networks, we calculate a CN using the following approach: If we have k = 1, . . . , n replicated networks (note that n means the index of the networks, not the exponent of α nor ω), then we define the consensus network wTO CN where A threshold can be used to remove links with i,j values close to zero, thus should not be included in the consensus network. To join networks that were generated with the proposed wTO method into the consensus network, the p-values are combined using the Fisher's method.

Results and discussion
The representation of interactions between a set of nodes by the wTO method [10][11][12] takes into account the overall commonality of all the links a node has, instead of basing the analysis only on calculating raw correlations among the nodes. It thus provides a more comprehensive understanding of how two nodes are related. Therefore, it is expected that a wTO network contains more robust information about the connections among nodes than what would result from simply taking direct correlations into account [11,13]. The wTO can be computed based on a similarity matrix, where the link weights are calculated using Pearson's product moment correlation coefficient or the Spearman Rank correlation. The first one measures the linear relationship between two genes. Note that, the Pearson's correlation coefficient is sensitive to extreme values, and therefore it can exaggerate or underreport the strength of a relationship. The Spearman Rank Correlation is recommended when data is monotonically correlated, skewed or ordinal, and it is less sensitive to extreme outliers than the Pearson coefficient [21][22][23][24].

Package functions
The function wTO calculates the weights for all links according to Eq. (2) between a set of nodes for a given input data set. If the user is not interested in the resampling option, one may simply run this wTO function.
To test whether the calculated wTO is different from random expectation and to decide on a suitable threshold value for including link weights, we implemented the function wTO.Complete. Here, the wTO is calculated a number of times, n specified by the user, by using either the 1) Bootstrapping (method_resampling = "Bootstrap"), or (method_resampling = "BlockBootstrap") for time series data or 2) Permuting the expression values for each individual (method_resampling = "Reshuffle") [13]. The user may specify the correlation method that this function should use, Pearson correlation is the default choice.
Because bootstrapping and permutation tests can be computationally expensive, the wTO.Complete can also run in parallel over multiple cores to reduce the wall clock time. For running in parallel, the user may specify a given number of k computer threads to be used in the calculations. To implement the parallel function, we used the R package parallel [25].
The execution of the wTO.Complete function returns two outputs; a diagnosis set of plots and a list consisting of the following three objects: • $Correlation is a data. The set of plots indicate the quality of the resample: the closer the density of the resampled data is to the real data, the better. Another generated plot is the scatter plot of the ω i,j vs ω i,j , as previously discussed. The scatter plot of p-values against the ω i,j and ω i,j is also plotted along with suggested threshold values that are the empirical quantiles.
Computing of the CN is done using the function wTO.Consensus. This function allows the user to give a list of networks in the format of data.frames with: Node 1, Node 2, the link weight and the p-value. The output is a data.table containing the two nodes' names and the consensus weight, and the combined p-value. This allows the user to filter out the links that were not significant in part of the networks. A visual representation of the Consensus Network methodology is shown in Fig. 2. The thicker the link between two nodes is, the stronger the correlation between them. The signs are represented by the colors blue and orange, respectively. If a link has different signs in the networks, the strength of the link in the CN is close to zero. When all links agree to the same For example, the link between D and E is removed since it has a different signal in the last network value or show little deviation, the strength of the resulting CN value is closer to the determined |maximum| value. If a node is absent in at least one network, it is removed.
The output data.frames (from both, wTO.Complete and wTO.Consensus) can be easily exported using the function export.wTO. This allows, for instance, to pass on the results of our package to Cytoscape [26] for further analysis.
Our R package also includes options to visualize the resulting networks. The function NetVis generates an interactive graph using as input a list of links and their corresponding weights. The analysis functions wTO.Complete and wTO.Consensus both generate network data-structures (edge list) that can be visualized with this function. The user needs to choose a relevant wTO-threshold (the quantiles resulting from the bootstrap), or p-value cut-off, to select the set of links to be plotted. Additionally, the user may choose a layout for the network visualization from those available in the igraph [27] package. By default, the wTO-threshold value is set to 0.5, and the network layout-style is set to layout_nicely. To avoid false positives, we recommend to filter the data according to the desired significance p-value and to choose the wTO-threshold according to the computed empirical quantiles. The size of the nodes is relative to their degree. Our package further includes an option for MakeCluster from the nodes; if allowed, nodes are colored according to the cluster they belong to. The user can choose the method to create the clusters.
One important difference between our package and the WGCNA package, is that we only use significant links for cluster (modules) network representation instead of the full set of co-expressions, as in the WGCNA package. The width of a link is relative to the wTO i,j , and its color is respective to its sign (if a signed network was calculated). Nodes can have different shapes, allowing for labeling nodes of different classes, for example target genes or protein coding and non-protein coding genes. Furthermore, the user may also zoom in and out of the network visualization, drag nodes and links, edit nodes and links, and export the image as html or png. The package provides example datasets and an example of nodes of interest as well.

Algorithm compute time with varying system size
Normally, when running the wTO, the interest lies on a subset of nodes of interest. In Fig. 3 we show the runtime for different network sizes, and different proportions of nodes of interest. When running the wTO for all expressed genes coding for transcription factors (TFs) being the genes of interest, we have around 14% of nodes of interest. Using a standard laptop computer, it's possible to compute the wTO for a full network with 20,000 nodes in 20 miliseconds per link. This shows that it is quite feasible

Comparison with existing methods
A variety of methods currently exist to analyze gene co-expression networks, in particular ARACNe [16,17], SPACE [28] and WGCNA [14,15]. These methods rest on a multitude of different mathematical principles, particularly with respect to how co-expression is quantified. Of particular interest is WGCNA, which shares notable similarities with our wTO package in heuristic terms, but with some substantial differences in functionality. In particular, WGCNA also uses the weighted topological overlap (in their nomenclature, the "topological overlap matrix", or TOM) to quantify co-expression at the gene-pair level. But in WGCNA, the final edge weight corresponds to the absolute value of ω i,j as defined in Eq. 2, or the absolute value of the terms in the numerator of Eq. 2. These are referred to as signed or unsigned, respectively. Topological overlap as a measure of co-expression has previously been shown to compare favourably with other methods [18].
While wTO and WGCNA construct the networks based on overlaping topologies, the ARACNe method builds the network using the mutual information (MI) and removing links that are indirect interactions using data processing inequality (DPI). Another important difference between the methods is that wTO and WGCNA will compute a link for all pair-wise possible connections, while ARACNe will only compute the pair-wise information if their information is not independent (Table 1).
Relative to WGCNA, wTO provides three major additions: the determination of p-values (determined by bootstrapping) for each pairwise wTO value; the calculation of a consensus network, and the ability to visualize the topological overlap network (along with node grouping according to a choice of nine algorithms). While WGCNA provides a variety of tools for visualizing the hierarchical tree forming the network, as well as for rendering the correlation matrix in heatmap form, it does not provide a node-and-edge type view of the co-expression network (but does allow for exporting networks into Cytoscape, in which network views are possible). Additionally, the consensus network as defined in Eq. 6 differs from the consensus TOM defined in WGCNA, which simply assigns to each edge of the consensus network the minimal value of the topological overlap across the input conditions. This is a strict version of consensus (unanimity), in that it will discard any gene pair if the overlap is weak in even a single network. In contrast, while Eq. 6 will remove contributions from networks where the topological overlap is weak (or where the sign of the wTO score is in conflict with the other networks), an edge may still be included if it is sufficiently present across the other networks.
Further additions in wTO include the possibility of choosing the Spearman correlation as the basis of a i,j (while WGCNA provides biweight midcorrelation, or bicor for short; both provide Pearson), as well as reducing computation time by the option of restricting the calculation of wTO scores to a set of genes of interest (while still including the adjacency to genes outside this set in each inter-set wTO score).
Another minor difference resides in how wTO is determined for each gene with itself. From Eq. 2, we see that (assuming a i,i = 0 and a i,j = a j,i ): For an unweighted network, where a i,j = 0 or a i,j = 1 for all (i, j), this approximates to ω i i ≈ 1 for large k i . However, this is not the case for weighted networks. WGCNA differs from the wTO package in that w i,i = 1 is explicitly set for all i, while our package retains the score as defined by Eq. 2.

Comparing wTO, WGCNA and ARACNe using an E. coli transcription factor network
In order to quantitatively compare the performance of wTO, WGCNA and ARACNe, we downloaded a gene expression dataset from E. coli from http://systemsbiology.ucsd.edu/ InSilicoOrganisms/Ecoli/EcoliExpression2 [29][30][31][32]. The data consists of 213 Affymetrix microarray gene expression profiles, corresponding to multiple different strains under different growth conditions, and contains gene expression data for 7312 distinct probes. Gene expressions were calculated as the mean of probes corresponding to the same gene. To assess the capability of the three tools in identifying true TF-TF interactions, we used the RegulonDB [33] database, which contains experimental data from E. coli, as a reference. We defined as True-Positive interactions those that are described in RegulonDB, and as True-Negatives all interactions that could not be experimentally validated in that dataset. For comparison, we also calculated networks using only the raw Pearson correlation. We generated the network for WGCNA following the steps described by the authors in the Tutorial [11,34]. We used the functions pickSoftThreshold and pickHardThreshold for defining the power of the soft-threshold and for choosing the hard-threshold, respectively. The power was defined as 4 and the hard-threshold was set to 0.3.
The ARACNe network was built using the Pearson correlation with build.mim and ARACNe functions in the minet R package [35]. The wTO networks were built using 1000 simulations, Pearson correlation and filtered for p adj -values ≤0.01 and the 90% quantile. One wTO network was constructed using a δ of 0.2, the default of the package, and another network was built using a δ of 0.1. All networks were filtered to only contain TFs with information in the RegulonDB. We calculated the Receiver operating characteristic (ROC)-curve using the pROC R package [36] (see Fig. 4).  ARACNe was able to better identify the amount of true positives compared to WGCNA and wTO, but performs worse when finding true negatives and also has a larger number of false positives (Fig. 4, Table 2). WGCNA is better at finding true negatives, but does not identify many true links. Our proposed wTO method performs better than WGCNA in finding true positives and better than ARACNe in finding true negatives. It also finds fewer false positives than ARACNe. In general, even when using a large δ, wTO performs better than the two other methods, as seen in the Area Under the Curve (AUC; the closer it is to unity, the better). This demonstrates that the use of the wTO method further reduces false effects coming from incorrectly assigned linked genes (false positives) when compared to ARACNe and raw correlations.

Examples of wTO networks using the wTO R package wTO and CN networks for TFs of the human prefrontal cortex
To exemplify the usage and results of our package, we analyzed three independent datasets of microarray data from human prefrontal cortex. Data sets were downloaded as raw data from Gene Expression Omnibus (GEO) website [37]. From the study GSE20168 [38,39], we used data from a total of 15 postmortem brain samples. From the study GSE2164 [40], we used a total of 26 samples from post mortem brains. And finally, from the study GSE54568 [41] we used all the 15 controls. All individuals were older than 5 years and died without any neuropathological phenotypes. We chose the TFs to be our genes of interest and calculated a TF-wTO network for each of the three datasets. Subsequently, we computed the consensus network for the three TF wTO networks.
The downloaded data were pre-processed and normalized by ourselves independently, using the R environment [42], and the affy [43] package from the Bioconductor set. The probe expression levels (RMA expression values) and MAS5 detection p-values were computed, and only probesets significantly detected in at least one sample (p-value <0.05) were considered. After the Quality Control and normalization of the data, the probes that were not specific for only one gene were deleted. If one gene was bound by more than one probeset, the average expression was computed.
Here, we will focus on how TFs are co-expressed in brain networks. We used a set of 3229 unique TF symbols from the TF-Catalog (Perdomo-Sabogal et al. (in preparation)) with ENSEMBL protein IDs. The construction of this catalog contains the information for TF proteins sourced from the most influential studies in the field of human Gene Regulatory Factors (GRF) inventories [44][45][46][47][48][49][50][51] that are associated with gene ontology terms for regulation of transcription, DNAdepending transcription, RNA polymerase II transcription co-factor and co-repressor activity, chromatin binding, modification, remodeling, or silencing, among others.
Signed wTO networks were calculated for each dataset separately using the function wTO.Complete of our wTO R package and then merged with the function wTO.Consensus into the consensus. Significance of all networks was evaluated using 1000 bootstraps, Pearson correlation and filtered for p adj -value of < 0.01. The Consensus Network was built based on the calculated signed wTO values of significant links. Weights for links with in-significant wTO were set to zero.  shows the distributions and the networks for our three datasets.
TFs were clustered using the Louvain algorithm with the NetVis function, which identified 5 clusters in the CN. When considering each network independently, we had 18, 8 and 16 clusters. This shows that the CN detects fewer clusters of genes, which are more densely connected, compared to the clusters detected in the individual wTO networks. In order to investigate the function of each one of the 5 CN clusters, we calculated the correlation of each TF of a cluster with all other expressed genes using Pearson correlation. Genes with a correlation of at least |0.80| with at least one TF of the cluster were used for GO enrichment analysis for that cluster, using the R package topGO [52]. The enrichment analysis revealed many brain related functions, for instance, clusters 1 and    with the SimRel measurement and allowed similarity of 0.5. The size of the circle represents the frequency of the GO term in the database, i.e. GO groups with many members are represented by larger circles. The color code refers to the log 10 (p-value) of the GO enrichment analysis: the closer to 0, the more red, the lower this value, the greener the bubble is. After removing redundancies, the remaining terms are visualized in semantic similarity-based scatter-plots, where the axes correspond to semantic distance. Brain related functions were detected, for instance in Clusters 1 and 3, that are involved with cognition that for them the abundance of the OTU on each specific time point is correlated to the following next 2 time points.
Based on that, we built the network of bacteria cooccurrence in that environment (Fig. 7). We found that 61 out of 67 OTUs had at least one significant Fig. 7 OTUs analysis using the Time-Series method of the wTO package. In this network, the sizes of the nodes are proportional to a node's degree, and the width of a link is proportional to its wTO-absolute value. The link color refers to its sign, with green links being negative and purple ones positive. Nodes belonging to the same cluster are shown in the same color. There are four distinct clusters of bacteria. The orange cluster contains only negative interactions (green links), suggesting that the bacterial species in this cluster do not co-exist. We also notice, that many of the bacteria belonging to the same order are well connected by purple links, indicating that they co-exist and share interactions. However, the number of interactions among non-related bacteria demonstrate that interactions are not intra-order specific interaction (p adj -value < 0.01). Positive correlations in co-occurence networks may represent symbiotic or commensal relationships, while negative correlations may represent predator-prey interactions, allelopathy or competition for limited resources. Using the community detection method for defining clusters we identified four distinct clusters of bacteria. We did not find any association of the phylogeny with clusters, which is in agreement with previous studies. However, we can clearly see (Fig. 7) that the blue group is rich in negative relationships, while both, the purple and orange groups, possess many positive relationships. These positive relationships are formed mostly by Flavobacteriales, bacteria that are known to infect fishes [54] and to live in commensality with other bacteria from the same order [55].

Conclusion
This new wTO package allows wTO network calculation for both, positive and negative correlations, which is not provided in any other published R package. With this feature it becomes valuable for the analysis of gene regulatory network, metabolic networks, ecological networks and other networks, in which the biological interpretation strongly depends on distinguishing between activating and inhibiting/repressing interactions.
Another novel feature is the computation of p-values for each link based on its empirical distribution, which allows for the reduction of false positive links in wTO networks. With our package, networks can also be calculated from time series data. In addition, our package includes the computation of a CN, which enables integrating networks derived from different studies or datasets to determine links that consistently appear in these networks.
By focusing on what these independently derived networks have in common, the CN should be of higher biological confidence than each individual network is. We also provide an interactive visualization tool that can be used to visualize both, wTO networks and CN, for efficient further custom analysis.
We qualitatively and quantitatively compared our new package to state-of-the-art methods and demonstrated that it performs better in identifying true positives and false negatives.
We provide two use cases for our package, one on wTO and CN calculation from three independent genome-wide expression datasets of human pre-frontal cortex samples, and one on wTO co-occurence networks calculated from time series data of a metagenomics abundance dataset from the ocean. Here, we demonstrated that clusters and GO enrichment in the CN are more defined than in individual wTO networks, highlighting the benefits of our package for analyzing and interpreting large biological datasets.