Networks can be displayed to represent the relevant associations between X and Y variables, they are inferred using a pairwise association score between X and Y variables. The user can set a threshold to represent only the variables X and Y with an association score greater than the threshold. By changing this threshold, the user can choose to include or exclude relationships in the relevance network. The output is a graph where each X- and Y-variable corresponds to a node and the edges included in the graph portray associations between them.
Usage in mixOmics
Networks graphs can be obtained in mixOmics via the function network as displayed below:
## Will work with sPLS result data(liver.toxicity) X <- liver.toxicity$gene Y <- liver.toxicity$clinic toxicity.spls <- spls(X, Y, ncomp = 3) network(toxicity.spls, color.node = c("orange","blue"), threshold = 0.75, row.names = FALSE, col.names = FALSE)
network(toxicity.spls,color.edge = c("red","orange","cyan","blue"),row.names=FALSE, threshold = 0.75)
network(toxicity.spls,lty.edge='dotted',row.names = FALSE, threshold = 0.75)
We can export the graph to Cytoscape file format using write.graph from the igraph package.
net.result <- network(toxicity.spls) write.graph(net.result$gR, file = "network.gml", format = "gml")