libSBNW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Modules Pages
libSBNW

Introduction

libSBNW is an SBML-compliant layout generation program.

Example:

#include "autolayoutc_api.h"
// ...
// type to store layout info
// load the model
// options for layout algo
// read layout info from the model
// randomize node positions
// do layout algo
opt.k = 20.;
opt.boundary = 1;
opt.mag = 0;
opt.grav = 0.;
opt.baryx = opt.baryy = 500.;
opt.autobary = 1;
// save layout information to new SBML file
gf_writeSBMLwithLayout(outfile, mod, l);
// run destructors on the model
// run destructors on the layout

Error handling

The library has several functions in the C API for error handling: gf_haveError, gf_getLastError, and gf_clearError, Errors can be read by gf_getLastError. gf_haveError can be called to determine if there is an error or not.

// Clear any previous errors
// Load a model from disk
gf_SBMLModel* mod = gf_loadSBMLfile("mymodel.xml");
// Did an error occur?
if ( gf_haveError() ) {
// Print the error message
fprintf(stderr, "Error message: %s\n", gf_getLastError());
// Clear the error so that future calls to gf_haveError return false
}

Installation

Installation documentation is provided at https://github.com/sys-bio/sbnw.

Conventions

The library conforms to universial conventions for C such as return zero for success.