In the context of network integration, we propose the INet algorithm. INet assumes a similar network structure, representing latent variables in different network layers of the same system. Therefore, by combining individual edge weights and topological network structures, INet first constructs a Consensus Network that represents the shared information underneath the different layers to provide a global view of the entities that play a fundamental role in the phenomenon of interest. Then, it derives a Case Specific Network for each layer containing peculiar information of the single data type not present in all the others.
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)
# Install from CRAN # install.packages("INetTool") # Install from GitHub # install.packages("devtools") #devtools::install_github("ValeriaPolicastro/INet-Tool")
Load the package and a list with the example datasets. In this case, columns of both datasets represent patients, while rows represent gene expression, methylation and mirna expression respectively.
library(INetTool) data("exampleL_data")
If you do not have already the weighted networks, as in our example, you can construct them throughout this function:
net <- constructionGraph(exampleL_data)
If you have already the networks skip this step.
The function constructs similarity networks based on pearson correlation and the percentile parameter, in our example it constructs 3 patient similarity networks.
For this example we named:
adjL the list of weighted adjacency matrices needed for the next functions
adjL <- net$Adj
graphL the list of graphs needed for the next functions
graphL <- net$Graphs
To detect how similar are the networks you can use the Jaccard distance matrix function:
JWmatrix(graphL)
or the Mean Weighted Jaccard Distance for Multilayer Networks a global distance function:
JWmean(graphL)
To calculate different measures on the different graphs you can easly use the following function:
measures <- measuresNet(graphL, nodes.measures=F)
(default nodes.measures=T gives measures also about the nodes)
The measures of the first graph:
measures[[1]]
To plot all the layers in one plot use:
plotL(graphL,vertex.cex=.1,vertex.labels.cex=.1, vertex.color = 18)
different parameter can be specified for the plot.
To construct the Consensus Network use a list of weighted adjacency matrices:
Note: consensusNet needs the same row and column names for all the matrices, if you do not have it use the adj_renamefunction before the consensus
Con <- consensusNet (adjL, theta=0.05)
From our simulation study, we detected that the best theta for 500 nodes network is 0.04 and the best one for 100 nodes network is 0.06,thus for this example with 200 nodes we setted the parameter to 0.05.
The output are:
Con$graphConsensus
Con$Comparison
Con$similarGraphs
The similar graphs are useful if it is needed to change the final thresholding, instead of computing again the algorithm you can use directly thresholdNet function.
Plotting the Consensus Network you can find the common informations present in all the layers:
plotC(Con$graphConsensus,vertex.size=6, vertex.label.cex =0.5,vertex.color = 18)
To construct Case Specific Networks one for each layer to give information of the peculiar layer not present in the Consensus:
specificNet(graphL, Con$graphConsensus)
To plot a starting layer and the Consensus in one graph with different edge colours: red edges represent edges of the Consensus already present in the starting one, while light blue edges represent new edges constructed by the Consensus.
plotINet(adjL[[1]], Con$graphConsensus, vertex.labels.cex=.01, vertex.size=2)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.