Skip to main content

Toolbox for the visualization and analysis of microbial datasets

Project description

GitHub license Python 3.9.6

MicNet Toolbox: visualizing and deconstructing a microbial network

Introduction

This 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 change

This project is part of the collaborative research between Ixulabs and the Laboratory of Experimental and Molecular Evolution, Institute of Ecology, UNAM.

Project Overview


The project is divided into three parts:

  • Visualization
  • SparCC
  • Network Algorithms

Note: Each package has a REAME.md file with a specific description of how the code works.

Visualization

Compositional 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.

SparCC

This algorithm is standard for estimating correlation values from compositional data, in order to infer the network's connections. We made several modifications to the original version of the algorithm to 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 Algorithms

Network 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 use

If you do not wish to use the web app of MicNet which has limited capacity, and you would prefer using your own computer disk and RAM resources, all you have to do is follow these steps. To do this, you must first have the conda package 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:

Miniconda

Anaconda

Once you have conda working on your computer the process is the following:

  1. 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:

    conda env create -f environment.yml 
    

    Be sure to check if the environment was created by typing in your command line the following:

    conda env list 
    

    You should see MicNet-env listed among your environments.

  2. If the MicNet-env environment is in the list, you then need to activate it using the following code:

    conda activate  MicNet-env
    
  3. Finally, you just need to run the following code to get started with micnet:

    pip install micnet
    

Data Details

As validation data, we use the Kombucha data set described in Arikan 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 at MicNet dashboard.

You can load this data with function micnet.load_kombucha() and follow the notebook available at our (github repository)[https://github.com/Labevo/MicNetToolbox/blob/master/notebooks/Kombucha_demo.ipynb]

Licenses

MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

micnet-1.0.0.tar.gz (42.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

micnet-1.0.0-py3-none-any.whl (49.1 kB view details)

Uploaded Python 3

File details

Details for the file micnet-1.0.0.tar.gz.

File metadata

  • Download URL: micnet-1.0.0.tar.gz
  • Upload date:
  • Size: 42.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for micnet-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8af444f5dec4017e28e38baa85bf5c3a53cb208f6adc120e7b8d323ea5b961a4
MD5 13e230ae6f9743231dc74105d495870d
BLAKE2b-256 aa91f3102c96e8c834179cbf33514e9055139568615316ce0e1a661fe8d84bab

See more details on using hashes here.

File details

Details for the file micnet-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: micnet-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 49.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for micnet-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ed36b303bbb1aaadd73239a2461120259553024f9bd461d2ea04abe9ea2a017
MD5 116713ecc4c84ab061c50d2cf731546a
BLAKE2b-256 6c9fc801adc8dda4119a72a641ae08a0fac55aa7268f54fdebe856785f3c2eae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page