Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Even though I installed libSBML, rbsml does not see it #415

Open
gailrosen opened this issue Jan 29, 2025 · 6 comments
Open

Even though I installed libSBML, rbsml does not see it #415

gailrosen opened this issue Jan 29, 2025 · 6 comments

Comments

@gailrosen
Copy link

from my understanding, it is because there is no libsbml.pc made when it is compiled. Can you help me get the libsbml.pc file -- it is nowhere that I can find. (https://support.bioconductor.org/p/90197/)

library(libSBML)
BiocManager::getOptions("rbsml")
Error: 'getOptions' is not an exported object from 'namespace:BiocManager'
BiocManager::install("rsbml")
'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://cran.rstudio.com/
Bioconductor version 3.20 (BiocManager 1.30.25), R 4.4.2 (2024-10-31)
Installing package(s) 'rsbml'
Package which is only available in source form, and may need compilation of
C/C++/Fortran: ‘rsbml’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package ‘rsbml’

trying URL 'https://bioconductor.org/packages/3.20/bioc/src/contrib/rsbml_2.64.0.tar.gz'
Content type 'application/x-gzip' length 684593 bytes (668 KB)

downloaded 668 KB

  • installing source package ‘rsbml’ ...
    ** package ‘rsbml’ successfully unpacked and MD5 sums checked
    ** using staged installation
    checking for pkg-config... /opt/homebrew/bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    checking for LIBSBML... no
    configure: error: Package requirements (libsbml >= 3.0.2) were not met:

Package 'libsbml' not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBSBML_CFLAGS
and LIBSBML_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
ERROR: configuration failed for package ‘rsbml’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/rsbml’

The downloaded source packages are in
‘/private/var/folders/nd/skrfkw1d11scqbyc524s1q0r0000gn/T/Rtmpt8oo7B/downloaded_packages’
Warning message:
In install.packages(...) :
installation of package ‘rsbml’ had non-zero exit status

@fbergmann
Copy link
Member

thank you for letting us know. We can definitely add a package config file in the next version. To provide you the information right now, so you can fix it on your system. could you let me know you you installed libSBML?

I see that the

library(libSBML)

command succeeded, that indicates, that you already have the libSBML R Bindings installed. Can i ask what you try to achieve with rsbml, that you couldnt achieve using the libSBML R bindings directly?

@gailrosen
Copy link
Author

gailrosen commented Jan 30, 2025 via email

@fbergmann
Copy link
Member

We have quite a number of examples that would show you how to use libSBML from R. They show how to go through the model and interrogate it, or create new ones.

we can work on getting a basic vignette installed with the libSBML R bindings.

@fbergmann
Copy link
Member

If you let me know what you would like to do, then I could create a new example for you. The libSBML R bindings return, either functions that you can call in the form analogous to the C language:

doc  <- readSBML(filename);
model <- SBMLDocument_getModel(document);

...

or the object structure is exposed as S3 functions:

doc  <- readSBML(filename);
model <- doc$getModel();

@gailrosen
Copy link
Author

gailrosen commented Feb 4, 2025 via email

@fbergmann
Copy link
Member

I've just tried it with the AGORA model from:

using the following R snippet (Note that i had to use the full path to the file):

library(libSBML);
doc <- readSBMLFromFile('/Users/Frank/Desktop/Lysinibacillus_sphaericus_C3_41.xml');
doc$printErrors();
model <- doc$getModel();
print (paste('Loaded', model$getName()));

for (i in 0:(model$getNumSpecies()-1)) {
  species <- model$getSpecies(i)
  print(paste("Species", i, ":", species$getName()))
}

that gives me the output i wanted:

source("load_model.R")
[1] "Loaded Lysinibacillus sphaericus C3-41"
[1] "Species 0 : 1,2-Diacyl-sn-glycerol (dioctadecanoyl, n-C18:0)"
[1] "Species 1 : 1,2-Diacyl-sn-glycerol (dioctadecanoyl, n-C18:0)"
[1] "Species 2 : Water"
[1] "Species 3 : proton"
[1] "Species 4 : 1-Pyrroline-4-hydroxy-2-carboxylate"
[1] "Species 5 : Ammonium"
[1] "Species 6 : 2,5-Dioxopentanoate"
[1] "Species 7 : (R)-2,3-Dihydroxy-3-methylpentanoate"
[1] "Species 8 : Nicotinamide adenine dinucleotide phosphate"
[1] "Species 9 : (R)-3-Hydroxy-3-methyl-2-oxopentanoate"
[1] "Species 10 : Nicotinamide adenine dinucleotide phosphate - reduced"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants