Example of converting a COBRA-style SBML Level 2 model to SBML Level 3 using the Flux Balance Constraints package.
Example of converting a COBRA-style SBML Level 2 model to SBML Level 3 using the Flux Balance Constraints package.
#include <iostream>
using namespace std;
LIBSBML_CPP_NAMESPACE_USE
int
main (int argc, char* argv[])
{
if (argc != 3)
{
cout << endl << "Usage: convertCobraToFbc input-filename output-filename"
<< endl << endl;
return 2;
}
{
}
else
{
props.
addOption(
"convert cobra",
true,
"Convert Cobra model to FBC");
{
cout<< "conversion failed ... " << endl;
return 3;
}
}
return 0;
}
Definition of ConversionProperties, the class encapsulating conversion configuration.
SBMLDocument_t * readSBML(const char *filename)
Reads an SBML document from the given file.
Include all SBML types in a single header file.
int writeSBML(const SBMLDocument_t *d, const char *filename)
Writes the given SBML document d to the file named by filename.
@ LIBSBML_SEV_ERROR
Definition XMLError.h:534
Definition ConversionProperties.h:84
virtual void addOption(const ConversionOption &option)
Adds a copy of the given option to this properties object.
Definition ConversionProperties.cpp:232
Definition SBMLDocument.h:351
unsigned int getNumErrors() const
Returns the number of errors or warnings encountered during parsing, consistency checking,...
Definition SBMLDocument.cpp:1169
void printErrors(std::ostream &stream=std::cerr) const
Prints all the errors or warnings encountered trying to parse, check, or translate this SBML document...
Definition SBMLDocument.cpp:1192
virtual int convert(const ConversionProperties &props)
Converts this document using the converter that best matches the given conversion properties.
@ LIBSBML_OPERATION_SUCCESS
Definition operationReturnValues.h:61