Inferring multiple microbial interaction networks from compositional taxa_count matrix using the Mixture of Graphical Guassian Model "MixGGM" is a package written in R, which receives a sample-taxa count matrix and extracts k(number of components) different interaction networks between taxa.
Following packages must be installed and loaded in R environment before using "MixGGM":
library(mvtnorm)
library(Matrix)
library(matrixcalc)
library(corpcor)
library(cvTools)
library(huge)
library(edgeR)
library(igraph)
After installing the previous prerequisities, please run the following lines to install the "MixGGM"
library("devtools")
install_github("sahatava/MixGGM")
library("MixGGM")
Please save your data as matrix which its rows represents samples and its columns represents the taxa names. If you are interested in visualising the final graphs, you need to save the taxa names as colnames of this input matrix. K( number of components ) is another input for MixGGM which should be specified by the user. For initialize the optimization using the Kmeans clustering please specified init="Kmeans" and rep=1. Otherwise, init="Random" and rep can be any integer number. As higher value for rep results in higher running time, we suggest to set it as 3 to trade off between the time and accuracy.
out_MixGGM = MixGGM(M , K , penalty , init , rep )
M--------> name of the csv file which includes the sample-taxa matrix
K-----------> number of components
penalty------> method to select tuning parameter: "no_sparsity" , "CV" (cross validation) , "StARS" , "fixed" , "iterative"
init---------> initialization can be "Kmeans" or "Random"
rep----------> number of repeats when initialization is "Random"
out---------> the type of output for each componenet: precision matrix, partial correlation, lambda, mixing coefficiant, clustering membership
threshold---> a value between 0 and 1. This threshold is used to generate adjacency matrix from partial correlation
out_MixGGM$precision[[i]]-----> i_th precision matrix(dXd)
out_MixGGM$partial[[i]]-------> i_th partial correlation matrix(dXd)
out_MixGGM$lambda[[i]]--------> i_th lambda matrix(NXd)
out_MixGGM$pi-----------------> mixing coefficiant
out_MixGGM$cluster------------> clustering membership
visualize(partial , threshold )
partial--------> partial correlation matrix corresponding to one component
threshold------> Threshold to get the adjacency matrix of the graph
The graphical plot for the taxa interaction network.
out_adj = partial2adj(partial, threshold)
partial-------------> partial correlation matrix as a result of running the MixGGM
threshold-----------> a value between 0 and 1
out_adj-------------> 1 and -1 indicate edge existance, 0 indicates no edge
`
M=as.matrix(read.csv("real_data.csv",sep=",",header=TRUE,row.names=1,check.names=FALSE))
out_MixGGM = MixGGM( M , K=2 , penalty="CV", init = "Random" , rep = 2)
visualize(out_MixGGM$partial[[1]] , threshold=0.3 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.