Integrative analysis of metabolome and microbiome

Congcong Gong



The mbOmic package contains a set of analysis functions for microbiomics and metabolomics data, designed to analyze the inter-omic correlation between microbiology and metabolites, referencing the workflow of Jonathan Braun et al1.

# knitr::include_graphics(system.file('extdata', 'intro.png', 'mbOmic'))


Load metabolites and OTU abundance data of plant.2 The OTU had been binned into genera level and were save as the metabolites_and_genera.rda file

path <- system.file('extdata', 'metabolites_and_genera.rda', package = 'mbOmic')


Construct mbSet object.

bSet is S4 class containing the metabolites abundance matrix.

We can use bSet function to directly create bSet class.

There are some function to get or set information of a bSet, such as samples and features.

Extract the samples names from bSet class by function Samples.

Remove bad analytes (OTU and metatoblites)

Removal of analytes only measured in <2 of samples can perform by clean_analytes.

Generate metabolite module

mbOmic can generate metabolite module by coExpress function. The coExpress function is the encapsulation of one-step network construction and module detection of WGCNA package. The coExpress function firstly pick up the soft-threshold. The threshold.d and threshold parameters are used to detect whether is \(R^2\) changing and appropriate.

If there are no appropriate threshold was detected and you do not set the power parameter, the coExpress will throw a error, “No power detected! pls set the power parameter”.

#> Error in coExpress(m, message = TRUE, threshold.d = 0.02, threshold = 0.8,  : 
#>   No power detected! pls set the power parameter
#> [1] "try-error"

If you can’t get a good scale-free topology index no matter how high set the soft-thresholding power, you can directly set the power value by the parameter power, but should be looked into carefully. The appropriate soft-thresholding power can be chosen based on the number of samples as in the table below (recommend by WGCNA package).

Number of samples Unsigned and signed hybrid networks Signed networks
<20 9 18
20~30 8 16
30~40 7 14
>40 6 12

Calculate the Spearman metabolite-genera correlation

you can calculate the correlation between metabolites and OTUs by corr function. It return a data table containing rho, p value, and adjust p value. Moreover, the corr can run in parallel mode.

plot the network

Finally, you can vaisulize the network by plot_network function, taking the coExpressand corr output. The orange nodes correspondes to OTU(genera)).