Package: micnet
MicNet Toolbox: visualizing and deconstructing a microbial networkIntroductionThis project contains a set of tools to detect, analyze and visualize microbial interaction networks from compositional data. The main objective was to implement different tools of the different algorithms to reconstruct, analyze and visualize a co-ocurrence network with microbial interactions. For that, we use standard algorithms for compositional data processing (SparCC), Network or Graphics Algorithms and Umap Algorithms.tini changeThis project is part of the collaborative research between Ixulabs and the Laboratory of Experimental and Molecular Evolution, Institute of Ecology, UNAM.Laboratory of Experimental and Molecular Evolution, Instituto de EcologÃ­a, UNAMIxulabsProject OverviewThe project is divided into three parts:VisualizationSparCCNetwork AlgorithmsNote:Each package has a REAME.md file with a specific description of how the code works.VisualizationCompositional data cannot be processed or worked like normal data, it has particular geometric and statistical properties. Using different transformations (Dirichlet transformation, Normalization or CLR) and the original data we estimate a mapping through the UMAP algorithm to the Hyperbolic Space. This to have a visualization of the data and its possible interactions. Furthermore, through the HDBSCAN algorithm we detect clusters based on density and which points are possible outliers and noise.SparCCThis algorithm is standard for estimating correlation values from compositional data, in order to infer the network's connections. We made several modifications to theoriginal version of the algorithmto improve the ability to process large samples of data. Part of the stages were parallelized and the execution of the algorithm and its statistical tests were better controlled. To run this on your local please refer to the README.md in the sparcc folder.Network AlgorithmsNetwork analyses were used to characterise both the overall structure and the local interactions of the microbial network, in which each OTU was represented as a node and the correlations found by SparCC as undirected weighted edges, such that an edge between two nodes implies a relationship between the two corresponding OTUs. Given that most network analyses can only handle positive interactions, we normalized the SparCC correlation matrix from -1 to 1 to a range from 0 to 1, except for the structural balance analysis which directly uses the positive and negative correlation values. The dashboard includes the calculation of large scale metrics of the network, structural balance analysis and community/HDBSCAN subnetwork analysis. To run percolation analysis and topology comparison please refer to the README.md in the network_alg folder.Local useIf you do not wish to use the web app of MicNet which has limited capacity, and you would prefer usingyour own computer disk and RAM resources, all you have to do is follow these steps. To do this, you must first have thecondapackage manager installed. If you do not have it installed, we recommend that you install the miniconda or anaconda packages. You can find the instructions to install it at this link:MinicondaAnacondaOnce you have conda working on your computer the process is the following:First be sure to be situated in the MicNet repository folder that you have clone into your computer. Then, the first step to run the dashboard is to create the environment, thus, first you must run the following code in the command line or terminal:condaenvcreate-fenvironment.ymlBe sure to check if the environment was created by typing in your command line the following:condaenvlistYou should see MicNet-env listed among your environments.If the MicNet-env environment is in the list, you then need to activate it using the following code:condaactivateMicNet-envFinally, you just need to run the following code to get started with micnet:pipinstallmicnetData DetailsAs validation data, we use the Kombucha data set described inArikan et al., (2020). .All data can be find in the folder named "Data". The "Kombucha_abundance_table.txt" can be used as input to run the UMAP/HDBSCAN and SparCC modules. We have also included the co-occurence matrix ("Kombucha_Sparcc_matrix.csv") and the HDBSCAN output file ("Kombucha_HDBSCAN.csv") which can be used as input to test the network module. The kombucha example can be easily inspected using the web dashboard atMicNet dashboard.You can load this data with functionmicnet.load_kombucha()and follow the notebook available at our (github repository)[https://github.com/Labevo/MicNetToolbox/blob/master/notebooks/Kombucha_demo.ipynb]LicensesMIT License.