Skip to content

Commit

Permalink
Show warnings if 'old' SBML models are loaded
Browse files Browse the repository at this point in the history
Refers to #11
  • Loading branch information
Waschina committed Dec 7, 2024
1 parent 980be9f commit c3c883c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SBML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ SEXP readSBMLfile(std::string file_path) {

// Convert SBML Level 2 to SBML Level 3 with FBC extension
if(document->getLevel() == 2) {
Rcpp::warning("Converting cobra-style SBML level 2 to level 3 incl. fbc extension.");
ConversionProperties props;
props.addOption("convert cobra", true, "Convert Cobra model to FBC");
int result = document->convert(props);
Expand All @@ -49,6 +50,7 @@ SEXP readSBMLfile(std::string file_path) {
// Convert FBC v1 to FBC v2
FbcSBMLDocumentPlugin* dplugin = static_cast<FbcSBMLDocumentPlugin*>(document->getPlugin("fbc"));
if(dplugin->getPackageVersion() == 1) {
Rcpp::warning("Loading SBML with fbc v1. It is recommended to encode flux blance contraints (fbc) in fbc v2.");
ConversionProperties propsFBC;
propsFBC.addOption("convert fbc v1 to fbc v2");
int result = document->convert(propsFBC);
Expand Down

0 comments on commit c3c883c

Please sign in to comment.