The structural analysis library is a C/C++ portable software library for analyzing the structural properties of stoichiometric networks. The library supports the analysis of both flux balance and moiety conservation. The library will accept models in the form of either standard SBML or raw stoichiometry matrices. The software is distributed under the BSD license and was developed through funding from NIH grant 1R01GM081070-01.
README
When building the windows binaries make sure you load the SBW_CLAPACK solution found the root of the distribution. This will, in addition to building the SBW binary files, also build the individual library files (dlls etc) that can be used in non-SBW projects.
The LU, QR etc routines that return the permutation matrix should return a pivot vector to save space. The caller can choose afterwards whether to convert the pivot matrix into a matrix or not. This change would also make it easier to compute the determinant of a matrix.
The library comes into two parts, a base library that exposes parts of LAPACK and additional functionality for numerical linear algebra. The second part builds on the base library to expose methods for calculating a wide variety metrics related to stoichiometry matrices. A unique aspect of the libStructural library that all matrices use or generated by the library can be optionally labeled. When loading a model from a SBML file the labels are provided by the species and reaction Ids. If a raw stoichiometry matrix is loaded, species and reaction labels can be loaded to augment the stoichiometry matrix. Labeled rows and columns are particularly useful in network studies because it allows information on species and reactions to be maintained during calculations.
Summary of capabilities (details in developer documentation below):
Numerical Linear Algebra Library: eigenvalues, GuassJordan, right and left null space, LU, QR, Rank, SVD and Inverse.
Structural Analysis: K, K0, L, L0, N, Nr, N0, Gamma (conservation laws), NDC, NIC (dependent and independent reaction partitions), dependent and independent species.
Example C Code:
// load matrix into the structural analysis library
LibStructural_loadStoichiometryMatrix (stoichMatrix, nRows, nCols);
// load species names and initial concentrations
LibStructural_loadSpecies(speciesNames, initialConcentrations, nRows);
// load reaction names
LibStructural_loadReactionNames(reactionNames, nCols);
// analyze the stoichiometry matrix using the QR method
LibStructural_analyzeWithQR( &sMessage, &nLength);
// get the conservation law matrix and corresponding labels
LibStructural_getGammaMatrix (&gammaMatrix, &numRows, &numCols);
LibStructural_getGammaMatrixLabels (&rows, &numRows, &vols, &numCols);
LibStructural_getKMatrix (&KMatrix, *numRows, &numCols);
LibStructural_getKMatrixLabels (&rows, &numRows, &cols, &numCols)
The library is currently distributed with SBW and is used by a number of SBW modules to carry out various analyses.
Developer Documentation:
C API Documentation
C++ API Documentation
C# API Documentation