Question: unable to load rsbml for piano reporter metabolite analysis
gravatar for jan.strauss
13 months ago by
jan.strauss0 wrote:

Hi all,

I'm trying to perform a Gene Set Enrichment Analysis using Reporter Metabolites using piano that depends on rsbml and libSBML.

So, I try to install rsbml using the code

if (!requireNamespace("BiocManager", quietly = TRUE))

BiocManager::install("rsbml", lib = "~/Documents/Rpackages", version = "3.8")

Additionally after downloading the stable version of the libSBML R source package for Mac OS X from SourceForge, I install libSBML using

install.packages("~/Downloads/libSBML_5.17.0.tar.gz", repos = NULL, type = "source", lib = "~/Documents/Rpackages")

Both seems to installs without any error message and there does not seem to be a problem to load libSBML using library(libSBML, lib.loc = "~/Documents/Rpackages").

However, when trying to load rsbml with library(rsbml, lib.loc = "~/Documents/Rpackages"), I get:

Error: package or namespace load failed for ‘rsbml’:
 .onLoad failed in loadNamespace() for 'rsbml', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Users/jstrauss/Documents/Rpackages/rsbml/libs/':
  dlopen(/Users/jstrauss/Documents/Rpackages/rsbml/libs/, 6): Library not loaded: /usr/local/opt/libsbml/lib/libsbml.5.dylib
  Referenced from: /Users/jstrauss/Documents/Rpackages/rsbml/libs/
  Reason: image not found

With my limited code literacy, I'm unable to properly trace the error and eliminate it but to me it appears that at least part of my problem seems to be that rsbml doesn't know where to find libSMBL.

I would appreciate any help and/or directions how to solve the issue including the best way to install libSBML and rsbml.

Many thanks in advance,



P.S.: I am using Bioconductor version 3.8 (BiocManager 1.30.3) and BiocManager::valid(lib.loc = "~/Documents/Rpackages") returns TRUE

The output of is:

R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] libSBML_5.17.0      graph_1.60.0        plier_1.52.0        affy_1.60.0         Biobase_2.42.0      BiocGenerics_0.28.0
[7] piano_1.22.0        crayon_1.3.4        limma_3.38.2       

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.19          BiocManager_1.30.3    compiler_3.5.1        pillar_1.3.0          plyr_1.8.4           
 [6] zlibbioc_1.28.0       bitops_1.0-6          sets_1.0-18           tools_3.5.1           preprocessCore_1.44.0
[11] tibble_1.4.2          gtable_0.2.0          lattice_0.20-38       pkgconfig_2.0.2       rlang_0.3.0.1        
[16] Matrix_1.2-15         fastmatch_1.1-0       igraph_1.2.2          fgsea_1.8.0           gridExtra_2.3        
[21] cluster_2.0.7-1       relations_0.6-8       gtools_3.8.1          caTools_1.17.1.1      stats4_3.5.1         
[26] grid_3.5.1            data.table_1.11.8     marray_1.60.0         BiocParallel_1.16.0   gdata_2.18.0         
[31] ggplot2_3.1.0         magrittr_1.5          gplots_3.0.1          scales_1.0.0          colorspace_1.3-2     
[36] KernSmooth_2.23-15    lazyeval_0.2.1        munsell_0.5.0         slam_0.1-43           affyio_1.52.0
ADD COMMENTlink modified 13 months ago by Michael Lawrence11k • written 13 months ago by jan.strauss0

While not an answer to the original question I still want to point out that for the final purpose (running "reporter metabolites", i.e. gene-set analysis using metabolite gene-sets, and as a part of this parsing out gene-metabolite associations from an sbml model) it would probably be easier and quicker to parse out the needed information on your own, depending on how this is annotated in the given model, rather than fighting with libSBML and varying model formats.

ADD REPLYlink written 13 months ago by Leif Väremo70

I'd caution against taking on the technical debt of a custom parser, but SBML is just XML, so the XML parser would get you most of the way there. libSBML mostly gives validation and in principle integration with modeling tools (but the SUNDIALS integration has been broken for a long time).

ADD REPLYlink written 13 months ago by Michael Lawrence11k
Answer: unable to load rsbml for piano reporter metabolite analysis
gravatar for Michael Lawrence
13 months ago by
United States
Michael Lawrence11k wrote:

The libSBML R package is unrelated to rsbml and piano. I think you just need to install libSBML (the library itself) using homebrew.

ADD COMMENTlink written 13 months ago by Michael Lawrence11k

Dear Michael,

Thanks for your answer!

Since I have started to use bioconda instead of homebrew, I was actually trying to install the libSBML library with conda using conda install -c SBMLTeam python-libsbml, which should have successfully installed the library.

Unfortunately, this didn't solve my issue, yet, and additional suggestions would be very welcome.



ADD REPLYlink written 13 months ago by jan.strauss0

Since on the Mac the package shared library has an absolute path to the libSBML library, you're going to need to stick with the homebrew installation, or somehow make it so that the conda installation matches the expectation (/usr/local/opt/libsbml/lib/libsbml.5.dylib).

ADD REPLYlink written 13 months ago by Michael Lawrence11k

Managed to solve my issue by removing my previous bioconda libSBML installation with conda remove python-libsbml and then re-install libSBML using the appropriate .dmg Mac installer from Thanks again for the help!

ADD REPLYlink written 13 months ago by jan.strauss0

Are you using bioconda to install rsbml as well? A consequence of this might be restriction to the previous Bioconductor release, at least in the short term.

ADD REPLYlink written 13 months ago by Martin Morgan ♦♦ 24k

No, I am using BiocManager::install("rsbml", version = "3.8") to install rsbml.

ADD REPLYlink written 13 months ago by jan.strauss0

My suggestion was to use bioconda, since you've opted for that for other packages. bioconda is responsible for managing libraries (I guess it is the main use case) and does so in a way that does not play well with 'native' installations. The worst case scenario is to report to bioconda that their rsbml packaging doesn't work / request that they create a recipe for it.

ADD REPLYlink written 13 months ago by Martin Morgan ♦♦ 24k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 357 users visited in the last hour