Introduction
RoadRunner is a SBML compliant high performance and portable simulation engine for systems and synthetic biology. To run a simple SBML model and generate time series data we would write the following code:
#undef __cplusplus
#define STATIC_RRC
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[]) {
printf ("Starting Test Program %s\n", argv[0]);
getchar ();
exit (0);
}
printf (rrDataToString (result));
getchar ();
exit (0);
}
C_DECL_SPEC char *rrcCallConv getLastError(void)
Retrieve the current error string.
C_DECL_SPEC int rrcCallConv freeRRCData(RRCDataPtr handle)
Free the memory associated to a RRCData object.
C_DECL_SPEC RRHandle rrcCallConv createRRInstance(void)
Initialize a new roadRunner instance and return a handle to it.
C_DECL_SPEC bool rrcCallConv loadSBMLFromFile(RRHandle handle, const char *fileName)
Load a model from a SBML file.
C_DECL_SPEC RRCDataPtr rrcCallConv simulateEx(RRHandle handle, const double timeStart, const double timeEnd, const int numberOfPoints)
Carry out a time-course simulation based on the given arguments, time start, time end and number of p...
libRoadRunner C wrappers 2012-2013
roadRunner C wrappers 2012
void * RRHandle
Void pointer to a RoadRunner instance.
Definition: rrc_types.h:50
roadRunner C wrappers 2012
Structure for the result type from the simulate calls. The client is responsible for freeing the RRCD...
Definition: rrc_types.h:111
More complex example, using C wrappers:
#undef __cplusplus
#define STATIC_RRC
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[]) {
int index;
int col;
int row;
printf ("Starting Test Program %s\n", argv[0]);
if (!
loadSBML (rrHandle,
"feedback.xml")) {
printf ("Error while loading SBML file\n");
getchar ();
exit (0);
}
index = 0;
for (col = 0; col < result->
CSize; col++)
{
if (col < result->CSize - 1)
{
printf ("\t");
}
}
printf ("\n");
index = 0;
for (row = 0; row < result->
RSize; row++)
{
for (col = 0; col < result->
CSize; col++)
{
printf (
"%10f", result->
Data[index++]);
if (col < result->CSize -1)
{
printf ("\t");
}
}
printf ("\n");
}
getchar ();
exit (0);
C_DECL_SPEC bool rrcCallConv freeRRInstance(RRHandle handle)
Free the roadRunner instance.
C_DECL_SPEC bool rrcCallConv loadSBML(RRHandle handle, const char *sbml)
Load a model from an SBML string.
double * Data
Definition: rrc_types.h:114
char ** ColumnHeaders
Definition: rrc_types.h:116
int CSize
Definition: rrc_types.h:113
int RSize
Definition: rrc_types.h:112
Would create output as shown below:
Starting Test Program: <File path Here>
Notice: Creating C based model generator using ..\compilers\tcc\tcc.exe compiler.
time [S1] [S2] [S3] [S4]
0.000000 0.000000 0.000000 0.000000 0.000000
1.111111 3.295975 1.677255 1.121418 1.074708
2.222222 0.971810 1.658970 1.841065 2.192728
3.333333 0.137340 0.501854 1.295138 2.444883
4.444445 0.141470 0.200937 0.549172 1.505662
5.555556 1.831017 1.317792 1.129982 1.351300
6.666667 0.306310 0.775477 1.304950 1.952076
7.777778 0.193459 0.268986 0.628542 1.483161
8.888889 1.566864 1.219950 1.105718 1.370199
10.000000 0.269437 0.678127 1.199353 1.868247
Installation
Installation documentation is provided at libRoadRunner.org.
License
Copyright (C) 2012 University of Washington, Seattle, WA, USA
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
In plain english this means:
You CAN freely download and use this software, in whole or in part, for personal, company internal, or commercial purposes;
You CAN use the software in packages or distributions that you create.
You SHOULD include a copy of the license in any redistribution you may make;
You are NOT required include the source of software, or of any modifications you may have made to it, in any redistribution you may assemble that includes it.
YOU CANNOT:
redistribute any piece of this software without proper attribution;