Download Links

Simulate 3D | SBW (Win32) | Bifurcation Discovery | FluxBalance
Showing posts with label standardization. Show all posts
Showing posts with label standardization. Show all posts

Tuesday, April 15, 2014

Release of libSEDML 0.3.0

Just in time for HARMONY 2014 I am pleased to announce the release of libSEDML 0.3.0, the source of which is available for download from:

https://github.com/fbergmann/libSEDML/releases/tag/v0.3.0

New Features:

  • Support for SED-ML L1V2
  • Support for Notes / Annotations in both versions
  • Support for AddXML / ChangeXML

Bug fixes:

  • sorted issues in supporting both versions and their namespaces
  • numerous improvements

Thanks of course to Sarah Keating, without whom the project would not have been possible, to Bertrand Moreau for helping to improve the CMake build and the Python Bindings.

Please report any issues with libSEDML to:

https://github.com/fbergmann/libSEDML/issues

or directly to me.

Examples for the use of each of the API is available online. If you prefer there to be binaries available for any specific binding language / platform, please let me know.

logoSEDML_567

Friday, December 20, 2013

libSBML Python Bindings

For a long time we have received reports, that the bindings to some of the supported bindings are hard to build. Usually we would prefer to provide binaries, however in the case of some languages this is not feasible, as there are different versions (that are incompatible with each other) being used. For this reason we have decided to work on creating standalone source packages for python, ruby, perl and r bindings.
The first package that I looked into was python. The idea would be to create two flavors of the source packages, one with libSBML core + accepted packages (dubbed python-libsbml), and another that includes also all proposed packages (dubbed python-libsbml-experimental).
With these source packages, installing the python bindings is as simple as running:
python setup.py install
Thanks to the Open Build Service this also makes it possible to provide binaries for a variety of linux distributions for them. They provide even repositories, so that the packages could be automatically updated, when a new version has been released.

Source:
Linux Binaries:

Hopefully in time for the next release we want to add these packages to the standard repositories (like pypi) over. And so I would like to ask you for feedback on the packages so far. Thanks!

Sunday, November 24, 2013

SBML Validation from SBW

The SBML Online Validator, currently represents the most comprehensive validator for SBML files. While we are working on a standalone version of it, it will be some time before it will be released. In the meantime I came across a nice Web Automation Framework (see http://watin.org/). That makes it very easy to test web applications. It was easy enough to wrap it into an SBW module, so that now all SBML files can be easily validated right from your favorite SBW Application:

LaunchOnlineValidator

I’ve pushed the project over to http://fbergmann.github.io/LaunchOnlineValidator/ if you like to see how that was done. Or grab the module right from SourceForge: SetupSBMLValidator_1.0.exe.

Thursday, November 14, 2013

libSBML 5.9.0 Released

Its official the new libSBML 5.9.0 is available immediately from source forge:

http://sourceforge.net/projects/sbml/files/libsbml/5.9.0/

There have been a number of changes. In the past months both the SBML Level 3 Qualitative Modeling Package, and the SBML Level 3 Layout Package have been released. From now on, they will be enabled and fully validated by every libSBML binary release.

And while there are many great new features (such as a converter that promotes all local reaction parameters to global ones, or a converter that attempts to infer units of elements), there are two new API introductions that I want to highlight below. Please see also the full release announcement.

ElementFilters: searching for elements

LibSBML 5.9.0 also introduces a new API, that makes it easier to search for specific elements in the SBML documents. You might be familiar with the SBase::getAllElements method, that until now would have returned all SBase elements below a certain element. So if you called it on a Event you would get a list containing of Trigger, Delay and EventAssignments. New is now, that getAllElements can optionally take an ElementFilter. In order to use the ElementFilter you would create a new class, that inherits from ElementFilter and implements one method:

virtual bool filter(const SBase* element);

This function can inspect an SBase element for its properties, and if it should be returned by getAllElements it would return true and false otherwise. This also works in the bindings languages, such as Python, Java or C#. So for example in C# if you would like a filter that filters for elements that contain Notes, you would implement the method like so:

public override bool filter(SBase element)
{
// return in case we don't have a valid element
// or the element contains no notes.
if (element == null || !element.isSetNotes())
return false;

// otherwise include it in the result
return true;
}

Then you simply pass that class into the call to getAllElements, and you would only receive elements with notes. Examples for this are in the examples folder of libSBML:



IdentifierTransformer: transforming elements


Another new concept included in 5.9.0 is the IdentifierTransformer class. This was initially motivated by the comp package, where often identifiers (SIds / METAIDs) would have to be renamed during flattening. Of course when you rename things, then you have to go through all references, to ensure that these would be corrected as well. To make this easier we included the IdentifierTransformer class. Similar as to the ElementFilter you would again inherit from that class and implement:

virtual int transform(SBase* element);

in order to use the transformer, you would first call getAllElements with the appropriate filter, to get a hold of all elements you would want to transform. and then go through them applying the transformer to the items. Of course this is useful even outside of comp. As example we include a transformer, that will updated all SBML Ids, to be as close as possible to their elements Name (by ensuring that all invalid characters such as spaces are removed from the name to represent a valid id):



Of course these transformers don't have to be used at all in the context of renaming identifiers. The general API also allows them to do pretty much any manipulations of the elements that you would like.

Sunday, November 10, 2013

Updated FluxBalance Tool

Today I want to announce a new version of the FluxBalance tool. New in this version is that it works better with SBW. By adding a new entry to the menu bar “Export L2”, it is now possible to export the Flux Balance problem designed to other SBW modules as SBML Level 2 Version 4 files with the FluxBalance annotation. Is the button not pressed the SBML Level 3 File with the official Flux Balance Constraints Package will be exported. The new installer is available immidiately from SourceForge under:

http://sourceforge.net/projects/sbw/files/modules/FluxBalance/

Screenshot 2013-11-10 16.09.45

Unfortunately, we are still not quite there for the next SBW release, last changes on JDesigner are in the process. In the meantime there is a new update for SBW please feel free to download the latest version.

Wednesday, October 16, 2013

Applying the Scientific Method to Simulation Experiments …

I’ve just finished a one hour Rosa & Co webinar, and thought to post the slides below. You might also be interested in their other webinars, you can find the webinar archive here.

Monday, September 16, 2013

SED-ML Level 1 Version 2–Release Candidate

The COMBINE meeting has just started, and we finally made the release candidate for the SED-ML Level 1 Version 2 specification available. SED-ML L1V2 finally extends the simulation experiments covered by SED-ML to include any kind of repeat and perturbation experiment. Apart from that it also includes the possibility to fully parameterize simulations, by specifying algorithm specific parameters like relative and absolute tolerances of integrators. The specification is available online from:

http://tinyurl.com/sed-ml-l1v2-rc

On my end I’ve updated the libSedML, and the SED-ML Script editor and of course SBW to be able to simulate L1V2. Another major change has been applied to the SED-ML Web Tools that now also support L1V2, and are now also capable of simulating the repeatedTask concept with CellML additionally to SBML.

As always any feedback is appreciated.

SED-ML Logo 5

Sunday, September 1, 2013

Systems Biology Workbench 2.10 (RC1)

As hinted at, a couple of days ago, we are shortly before the release of the next version of SBW with enhancements for all associated programs. Today I want to announce a new release candidate. On SourceForge you will find installers for Windows, OSX as well as Linux (x86 & x64). You can download them from:

http://sourceforge.net/projects/sbw/files/sbw/2.10.0/rc1/

I’ve also created virtual machines & live images with SUSE studio, that are available online:

32bit OpenSUSE 12.3,
64bit OpenSUSE 12.3

Any feedback is appreciated.

SBW-Logo

Wednesday, July 24, 2013

SBML Layout Specification RC2

Finally, after a good 10 years since the first presentation of a layout extension to SBML, the specification has been sent to the SBML editors for approval. One might think it is actually quite easy to describe where something is, and it should not take all that long to agree on a bare minimum for a standard, but be that as it may, we are now in the final stretches. If you like, you could have a look at the specification:

SBML Layout Specification RC2

It is of course fully supported by libSBML. Now that the specification is in the approved format for L3 packages, including a whole number of validation rules, validation is currently added to libSBML and will be available from the Online Validator with the acceptance of the package. In the meantime you could use the

SBML RNG Online Validator

Software support is shaping up: SBW has been supporting SBML Layout since 2005, and COPASI has it enabled in publicly released builds since last year. Both software tools also import CellDesigner annotations! At last years HARMONY meeting the layout specification has received its biggest change, by adding a GeneralGlyph, that makes it possible to also layout elements, that previously where not possible. Support for that is available in the latest SBW builds,

SBML Online Layout Viewer

And within the COPASI codebase, to be released sometime soon.Here a screenshot, showing the exchange between COPASI & SBW of an SBML Level 3 model with a GeneralGlyph that represents an SBML Event, including Trigger and Event Assignment:

image

Friday, April 5, 2013

COMBINE archive … an implementation

It has been quite some time ago, that the COMBINE archive was proposed it seemed a simple enough format. I had a library for some time, but was not yet sure where to read it. As with any format, if no files are around there will be no applications written to support them.

In any case, since the conversion is going again, I’ve decided to put all the information about the library, and an first version of a graphical frontend for it. As with any experimental frontend it is written again for Windows. The links below have the details:

About the User Interface

When you open an archive in the application, you will find the following layout:

image

On the left you find the list of files contained in the archive, separated by their type, currently only a limited number of the COMBINE standards is recognized and an even smaller number can be interacted with, but that will change in the future. When you select a file, the systems preview handler will be used to generate a preview, as you can see in the screenshot with the PDF. Also recognized are images, and websites. Can the format not be determined, the file will be displayed as plain text, which may or may not be helpful.

If an SBML file is selected, it will be displayed as plain text. But if you have SBW installed, you will see this pane on the top:

image

That will allow you to open the file immediately for simulation / editing with one of the defined favorite applications. Or you could choose any other installed SBW Analyzer. The next version will allow you to simulate SED-ML files, and view SBGN files … stay tunes! I’m also working on an online version for sysbioapps.

Monday, March 4, 2013

libSBML 5.8.0 Released

Just as follow up to the release of the SBML Level 3 Package for Flux Balance Constraints: we have now released a new version of libSBML, that includes the FBC package enabled in all binaries. That is not just the core library, but also all language bindings (including MATLAB). Particularly I want to highlight three features:

  • the first one is full validation: all validation rules have been implemented in libSBML and will be validated automatically on a checkConsistency() call on SBMLDocuments.
  • the other one are the converters: we have included converters from the COBRA annotation to the FBC package and vice versa. Examples are available online, or in the source archives including the package.
  • Finally, C++ documentation of the package is available online. While package documentation is not yet available for language bindings, they do use the same function calls, so the information is transferable.

See also the full release announcement for more information.

Thursday, February 14, 2013

SBML Level 3 Package for Flux Balance Constraints

It is official, the SBML Level 3 Package for Flux Balance Constraints has been released! In its first version it allows to efficiently store constraints of Flux Balance models along with objectives to be met.

image

You can find the full specification online under:

http://identifiers.org/combine.specifications/sbml.level-3.version-1.fbc.version-1.release-1

As of today the next release of libSBML (5.8.0) has gone into code freeze, that will include the FBC package, along with full validation and conversions from SBML Levels that use the COBRA annotations to SBML Level 3 models with the FBC package. This new version is bound to be released by the end of the month. In the meantime nightly windows builds can be found on our build server.

With this release I’ve also made a new version of my FluxBalance tool available. Version 1.7 now already uses the COBRA importer, and has been redesigned to efficiently compute flux balance solutions for even genome scale models (albeit the loading of these models still takes a while).

A big thanks to the SBML editors and the community to make this possible!

Sunday, February 10, 2013

New SBML Test Suite Database!

As you might have noticed there is a new online service available on sbml.org, the SBML Test Suite Database. We of course had the SBML Test Suite for quite some time, with an amazing number of 1196 tests (to date), that now also include tests for the Flux Balance Package and even Hierarchical Modeling. This new application lets you browse all these tests, filter for tests (for example: Show me all tests, that test ‘RandomEventExecution’) and  download a selection of tests right there.

2013-01-30_-_TestSuiteDB

At the heart of course is the capability to *upload* a zipped set of test results, and analyze them for yourself in a private area, and once you are happy with them have them published publicly for the world to see. I’ve am working on a new version of SBW, that uses the 5.7.0 version of libSBML. And here is what a result for RoadRunner would look like:

2013-01-30_-_TestSuiteDB_RR_Result

As you can see in yellow, RoadRunner will still not support AlgebraicRules, FastReactions or CSymbolDelay. However, libSBML will flatten comp models for RoadRunner, and so all comp tests that do not use the above mentioned elements will work just fine.

Monday, January 28, 2013

libSBML 5.7.0 Released

I know I’m two weeks late by now, still I wanted to let you know that we released a new version of libSBML (be sure to have a look at the full release announcement). Since the last release the hierarchical modeling composition package was approved and thus for the first time the comp package is enabled in all binaries. So no matter which one you grab, you will be able to build comp models with it, and read and write them. Much work has gone into the flattening algorithm so that even if your software does not actually make use of the comp package yet, you could automatically flatten the model into a Level 3 core model. To make this possible even from the (otherwise from comp neglected) C API, we finally wrapped the libSBML Converter API for C (including the SBMLConverterRegistry). So now you can query for converters from all languages. Example conversions are available that demonstrate how to flatten the model for all binding languages. Just as example, given an SBMLDocument ‘doc’ all it would take to convert the model are these three lines (in C#)

var props = new ConversionProperties();
props.addOption("flatten comp", true, "flatten comp");
int result = doc.convert(props);

After that, the document will be flattened. And can be treated as a regular Level 3 model. (Though you might want to check for a zero result, just to make sure no issues crept up during the conversion (which would be logged in the error log)).


Perhaps one more word about ExternalModelDefinitions. LibSBML will automatically locate files on the *local* hard drive, relative to the document opened. If you are loading documents from string, and want this feature to be working, you can set the SBMLDocuments locationURI property. More generally the comp package includes a ResolverRegistry, where you can register your own resolvers. These resolvers basically allow you to return an SBML document for a given URI. This facility also would allow you to easily extend the resolvers to resolve documents from the web, from databases and other non-local sources. To demonstrate this, I wrote an example, the SBMLHttpResolverExample, that uses libCURL to download a model from any given website (with the caveat that the comp specification does not allow the inclusion of non-level 3 models, which means that all models from the BioModels Database are rejected for the time being. If you, like me, don’t particularly like that behavior, you might want to raise that issue with the comp working group).


Please grab the new version from SourceForge:


http://sourceforge.net/projects/sbml/files/libsbml/5.7.0/


Happy coding!


SBML logo

Sunday, November 11, 2012

SBW Flux Balance Analysis Tool … v2

Brett Olivier was here last week in HD, and we made quite some progress on the FBC specification. We also started with a test suite for tools implementing the FBC package. And as can be expected, these tests revealed quite some room in the original FBA Tool that from 2009.

2012-11-11_-_FBA

The new version fully supports the SBML FBC package, will properly inform whether a solution was found or not, and sorts a number of problems (such as dealing with infinite bounds). The new version is still aimed as teaching tool, but now is much better suited as such. The list of changes:

  • fixed issue with infinite bounds
  • fixed issue accessing the results from the c library
  • added display of objective value and solution quality to status bar
  • added export of LP files
  • added import of COPASI / Jarnac files (if latest SBW is installed)

In any case I started a github page for the project, where the first windows installer is available for download:

https://github.com/downloads/fbergmann/FluxBalance/SetupFBA-1.3.exe

Sunday, October 21, 2012

Using LibSBML from Tomcat

I frequently hear that it would be difficult to use libSBML from Tomcat. So I figured I take some time to investigate what the problems could be. In the process I rewrote the SBML Online Validator to use libSBML java bindings and tomcat. It turned out that libSBML is actually easy enough to set up to be used by tomcat, one just has to take certain particularities of the java programming language (with respect to P/Invoke ) into account:

  • libraries can only be loaded once
  • native resources can only be accessed from the thread that created them
  • you have hardly any control of the garbage collection, however all native classes have to be freed on the same thread as they were created on
  • be careful that your elements do not go out of scope (i.e.: even if you are working with SBML Models, you can not let the SBML Document get out of scope)

I’ve written all this up and published it on github, it would be great to hear what you think about it. There you will find:

Thursday, September 6, 2012

Custom Annotation for using Distribution Functions in SBML Models

Drawing random numbers is a task occasionally encountered. However, there is no standard way to do that in SBML. Of course that is precisely what the SBML Level 3 package for Distributions and Ranges is for. But what to do in the meantime, or what to do when you want it working for SBML Level 2? This is precisely what I encountered a couple of weeks back, and that is why below you will find a specification for a very short custom annotation, that allows to tag an SBML function definition as distribution function. Here an example:

<functionDefinition id="normal" name="Normal distribution">
  <annotation>
    <distribution xmlns="
http://sbml.org/annotations/distribution" definition="http://en.wikipedia.org/wiki/Normal_distribution" />
  </annotation>
  <math xmlns="
http://www.w3.org/1998/Math/MathML">
    <lambda>
      <bvar>
        <ci> m </ci>
      </bvar>
      <bvar>
        <ci> s </ci>
      </bvar>
      <ci> m </ci>
    </lambda>
  </math>
</functionDefinition>

The annotation (in the namespace http://sbml.org/annotations/distribution) contains one attribute definition, whose value tells us precisely which distribution we would like to draw numbers from. All software that supports it will know that we are dealing with a distribution and know what to do with it. Other software at least get the mean whenever they invoke the function.

2012-09-06_-_Result

Here the full specification of the Custom Distribution Annotation. (and here the SBML model). The annotation is so far supported by JarnacLite and RoadRunner (Windows Installer). As the same functionality is available in other software packages it would be great if they could be tagged with the annotation as well.

Sunday, August 5, 2012

Updates to the LibSBML Layout Support

The libSBML 5.6.0 release contains changes to the Layout code as was discussed during HARMONY 2012. While the time between HARMONY and this release was not sufficient to fully update the specifications, we thought that it would be better to update the implementation so that people could test the changes. The changes include a modification of the GraphicalObject base class through adding of a “metaIdRef” attribute and the introduction of two now classes:

  • GeneralGlyph and
  • ReferenceGlyph

The new metaIdRef attribute means that now elements can be referenced by specifying the metaId of elements to reference elements that have no SId.

They are to be used analog to ReactionGlyphs and SpeciesReferenceGlyphs. However, they are not specific to a given SBML Class, and thus can address the use case of wanting to represent Events, Rules or even InitialAssignments visually. So how do these classes look? Obviously both are extending GraphicalObject, and so get their Ids and all the SBase goodness from there, additional elements are:

image

So the ReferenceGlyph References an SBML element via the “reference” attribute, and additionally allows to reference a Layout Glyph via the “glyph” attribute. For the time being we allow free form ‘role’ strings to be applied.

image

These ReferenceGlyphs are then used by the GeneralGlyph, that analog to the ReactionGlyph references an SBML element via the “reference” attribute and contains a list of these reference elements (in a listOfReferenceGlyphs), together with an optional Curve and optional additional glyphs to be rendered (that are kept in a listOfSubGlyphs). These additional glyphs can be any subclass of GraphicalObject.  The GeneralGlyphs can be found in the containing Layout in the listOfAdditionalGraphicalObjects. So how would it look in a full SBML model? Here a model represening a rule glyph as image:

image

and in SBML:

<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1" xmlns:render="http://www.sbml.org/sbml/level3/version1/render/version1" level="3" version="1" layout:required="false" render:required="false">
  <model timeUnits="time">
    <listOfUnitDefinitions>
      <unitDefinition id="volume">
        <listOfUnits>
          <unit kind="litre" exponent="1" scale="0" multiplier="1"/>
        </listOfUnits>
      </unitDefinition>
      <unitDefinition id="substance">
        <listOfUnits>
          <unit kind="mole" exponent="1" scale="0" multiplier="1"/>
        </listOfUnits>
      </unitDefinition>
      <unitDefinition id="time">
        <listOfUnits>
          <unit kind="second" exponent="1" scale="0" multiplier="1"/>
        </listOfUnits>
      </unitDefinition>
    </listOfUnitDefinitions>
    <listOfCompartments>
      <compartment id="compartment" spatialDimensions="3" size="1" units="volume" constant="true"/>
    </listOfCompartments>
    <listOfSpecies>
      <species id="species" compartment="compartment" initialConcentration="0" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
    </listOfSpecies>
    <listOfParameters>
      <parameter id="variable1" value="0.1" constant="true"/>
      <parameter id="variable2" value="0.1" constant="true"/>
    </listOfParameters>
    <listOfRules>
      <assignmentRule variable="species">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <plus/>
            <ci> variable1 </ci>
            <ci> variable2 </ci>
          </apply>
        </math>
      </assignmentRule>
    </listOfRules>
    <layout:listOfLayouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <layout:layout layout:id="test">
        <layout:dimensions layout:width="837" layout:height="445.5"/>
        <layout:listOfSpeciesGlyphs>
          <layout:speciesGlyph layout:id="sGlyph_0" layout:species="species">
            <layout:boundingBox>
              <layout:position layout:x="298" layout:y="199"/>
              <layout:dimensions layout:width="62" layout:height="40"/>
            </layout:boundingBox>
          </layout:speciesGlyph>
        </layout:listOfSpeciesGlyphs>
        <layout:listOfTextGlyphs>
          <layout:textGlyph layout:id="tGlyph_0" layout:text="species" layout:graphicalObject="sGlyph_0">
            <layout:boundingBox>
              <layout:position layout:x="298" layout:y="199"/>
              <layout:dimensions layout:width="62" layout:height="40"/>
            </layout:boundingBox>
          </layout:textGlyph>
          <layout:textGlyph layout:id="tGlyph_1" layout:text="variable1" layout:graphicalObject="glyph_1">
            <layout:boundingBox>
              <layout:position layout:x="477" layout:y="116"/>
              <layout:dimensions layout:width="62" layout:height="40"/>
            </layout:boundingBox>
          </layout:textGlyph>
          <layout:textGlyph layout:id="tGlyph_2" layout:text="variable2" layout:graphicalObject="glyph_2">
            <layout:boundingBox>
              <layout:position layout:x="477" layout:y="289"/>
              <layout:dimensions layout:width="62" layout:height="40"/>
            </layout:boundingBox>
          </layout:textGlyph>
        </layout:listOfTextGlyphs>
        <layout:listOfAdditionalGraphicalObjects>
          <layout:generalGlyph layout:id="glyph_1" layout:reference="variable1">
            <layout:boundingBox>
              <layout:position layout:x="477" layout:y="116"/>
              <layout:dimensions layout:width="62" layout:height="40"/>
            </layout:boundingBox>
          </layout:generalGlyph>
          <layout:generalGlyph layout:id="glyph_2" layout:reference="variable2">
            <layout:boundingBox>
              <layout:position layout:x="477" layout:y="289"/>
              <layout:dimensions layout:width="62" layout:height="40"/>
            </layout:boundingBox>
          </layout:generalGlyph>
          <layout:generalGlyph layout:id="ruleGlyph">
            <layout:boundingBox>
              <layout:position layout:x="0" layout:y="0"/>
              <layout:dimensions layout:width="0" layout:height="0"/>
            </layout:boundingBox>
            <layout:listOfReferenceGlyphs>
              <layout:referenceGlyph layout:id="Reference_J0_0" layout:reference="species" layout:glyph="sGlyph_0" layout:role="product">
                <layout:curve>
                  <layout:listOfCurveSegments>
                    <layout:curveSegment xsi:type="CubicBezier">
                      <layout:start layout:x="425" layout:y="220"/>
                      <layout:end layout:x="367" layout:y="218.425925925926"/>
                      <layout:basePoint1 layout:x="383" layout:y="218"/>
                      <layout:basePoint2 layout:x="383" layout:y="218"/>
                    </layout:curveSegment>
                  </layout:listOfCurveSegments>
                </layout:curve>
              </layout:referenceGlyph>
              <layout:referenceGlyph layout:id="Reference_J0_2" layout:reference="variable1" layout:glyph="glyph_1" layout:role="substrate">
                <layout:curve>
                  <layout:listOfCurveSegments>
                    <layout:curveSegment xsi:type="CubicBezier">
                      <layout:start layout:x="495.46511627907" layout:y="163"/>
                      <layout:end layout:x="425" layout:y="220"/>
                      <layout:basePoint1 layout:x="467" layout:y="222"/>
                      <layout:basePoint2 layout:x="467" layout:y="222"/>
                    </layout:curveSegment>
                  </layout:listOfCurveSegments>
                </layout:curve>
              </layout:referenceGlyph>
              <layout:referenceGlyph layout:id="Reference_J0_3" layout:reference="variable2" layout:glyph="glyph_2" layout:role="substrate">
                <layout:curve>
                  <layout:listOfCurveSegments>
                    <layout:curveSegment xsi:type="CubicBezier">
                      <layout:start layout:x="495.574712643678" layout:y="282"/>
                      <layout:end layout:x="425" layout:y="220"/>
                      <layout:basePoint1 layout:x="467" layout:y="222"/>
                      <layout:basePoint2 layout:x="467" layout:y="222"/>
                    </layout:curveSegment>
                  </layout:listOfCurveSegments>
                </layout:curve>
              </layout:referenceGlyph>
            </layout:listOfReferenceGlyphs>
          </layout:generalGlyph>
        </layout:listOfAdditionalGraphicalObjects>
        <render:listOfRenderInformation render:versionMajor="1" render:versionMinor="0">
          <render:renderInformation render:id="ConvertedRenderStyle" render:programName="SBML Layout Viewer - SBW version" render:programVersion="2.7.4513.22555 Compiled on: 11.05.2012 12:31:50" render:backgroundColor="#FFFFFFFF">
            <render:listOfColorDefinitions>
              <render:colorDefinition render:id="Color_0" render:value="#ff9900"/>
              <render:colorDefinition render:id="Color_1" render:value="#008000"/>
              <render:colorDefinition render:id="Color_2" render:value="#000000"/>
            </render:listOfColorDefinitions>
            <render:listOfGradientDefinitions>
              <render:linearGradient render:id="LinearGradient_0" render:spreadMethod="reflect" render:x2="0">
                <render:stop render:offset="0" render:stop-color="#ffffff"/>
                <render:stop render:offset="100%" render:stop-color="#ffcc99"/>
              </render:linearGradient>
            </render:listOfGradientDefinitions>
            <render:listOfLineEndings>
              <render:lineEnding render:id="product">
                <layout:boundingBox>
                  <layout:position layout:x="-10" layout:y="-5"/>
                  <layout:dimensions layout:width="10" layout:height="10"/>
                </layout:boundingBox>
                <render:g render:stroke="Color_1" render:stroke-width="0.001" render:fill="Color_1" render:font-size="0" render:text-anchor="start" render:vtext-anchor="top">
                  <render:polygon render:fill="Color_1">
                    <render:listOfElements>
                      <render:element xsi:type="RenderPoint" render:x="0" render:y="0"/>
                      <render:element xsi:type="RenderPoint" render:x="100%" render:y="50%"/>
                      <render:element xsi:type="RenderPoint" render:x="0" render:y="100%"/>
                      <render:element xsi:type="RenderPoint" render:x="33%" render:y="50%"/>
                      <render:element xsi:type="RenderPoint" render:x="0" render:y="0"/>
                    </render:listOfElements>
                  </render:polygon>
                </render:g>
              </render:lineEnding>
            </render:listOfLineEndings>
            <render:listOfStyles>
              <render:style render:idList="sGlyph_0">
                <render:g render:stroke-width="0" render:fill-rule="nonzero" render:font-size="0" render:font-family="sans-serif" render:font-style="normal" render:font-weight="normal" render:text-anchor="start" render:vtext-anchor="top">
                  <render:curve render:stroke="Color_0" render:stroke-width="2">
                    <render:listOfElements>
                      <render:element xsi:type="RenderPoint" render:x="20" render:y="0"/>
                      <render:element xsi:type="RenderCubicBezier" render:x="0" render:y="20" render:basePoint1_x="8.95431" render:basePoint1_y="0" render:basePoint2_x="0" render:basePoint2_y="8.95431"/>
                      <render:element xsi:type="RenderCubicBezier" render:x="20" render:y="40" render:basePoint1_x="0" render:basePoint1_y="31.0457" render:basePoint2_x="8.95431" render:basePoint2_y="40"/>
                      <render:element xsi:type="RenderPoint" render:x="42" render:y="40"/>
                      <render:element xsi:type="RenderCubicBezier" render:x="62" render:y="20" render:basePoint1_x="53.0457" render:basePoint1_y="40" render:basePoint2_x="62" render:basePoint2_y="31.0457"/>
                      <render:element xsi:type="RenderCubicBezier" render:x="42" render:y="0" render:basePoint1_x="62" render:basePoint1_y="8.95431" render:basePoint2_x="53.0457" render:basePoint2_y="0"/>
                      <render:element xsi:type="RenderPoint" render:x="20" render:y="0"/>
                    </render:listOfElements>
                  </render:curve>
                </render:g>
              </render:style>
              <render:style render:idList="glyph_1">
                <render:g render:stroke-width="0" render:fill-rule="nonzero" render:font-size="0" render:font-family="sans-serif" render:font-style="normal" render:font-weight="normal" render:text-anchor="start" render:vtext-anchor="top">
                  <render:curve render:stroke="Color_0" render:stroke-width="2">
                    <render:listOfElements>
                      <render:element xsi:type="RenderPoint" render:x="20" render:y="0"/>
                      <render:element xsi:type="RenderCubicBezier" render:x="0" render:y="20" render:basePoint1_x="8.95431" render:basePoint1_y="0" render:basePoint2_x="0" render:basePoint2_y="8.95431"/>
                      <render:element xsi:type="RenderCubicBezier" render:x="20" render:y="40" render:basePoint1_x="0" render:basePoint1_y="31.0457" render:basePoint2_x="8.95431" render:basePoint2_y="40"/>
                      <render:element xsi:type="RenderPoint" render:x="42" render:y="40"/>
                      <render:element xsi:type="RenderCubicBezier" render:x="62" render:y="20" render:basePoint1_x="53.0457" render:basePoint1_y="40" render:basePoint2_x="62" render:basePoint2_y="31.0457"/>
                      <render:element xsi:type="RenderCubicBezier" render:x="42" render:y="0" render:basePoint1_x="62" render:basePoint1_y="8.95431" render:basePoint2_x="53.0457" render:basePoint2_y="0"/>
                      <render:element xsi:type="RenderPoint" render:x="20" render:y="0"/>
                    </render:listOfElements>
                  </render:curve>
                </render:g>
              </render:style>
              <render:style render:idList="glyph_2">
                <render:g render:stroke-width="0" render:fill-rule="nonzero" render:font-size="0" render:font-family="sans-serif" render:font-style="normal" render:font-weight="normal" render:text-anchor="start" render:vtext-anchor="top">
                  <render:curve render:stroke="Color_0" render:stroke-width="2">
                    <render:listOfElements>
                      <render:element xsi:type="RenderPoint" render:x="20" render:y="0"/>
                      <render:element xsi:type="RenderCubicBezier" render:x="0" render:y="20" render:basePoint1_x="8.95431" render:basePoint1_y="0" render:basePoint2_x="0" render:basePoint2_y="8.95431"/>
                      <render:element xsi:type="RenderCubicBezier" render:x="20" render:y="40" render:basePoint1_x="0" render:basePoint1_y="31.0457" render:basePoint2_x="8.95431" render:basePoint2_y="40"/>
                      <render:element xsi:type="RenderPoint" render:x="42" render:y="40"/>
                      <render:element xsi:type="RenderCubicBezier" render:x="62" render:y="20" render:basePoint1_x="53.0457" render:basePoint1_y="40" render:basePoint2_x="62" render:basePoint2_y="31.0457"/>
                      <render:element xsi:type="RenderCubicBezier" render:x="42" render:y="0" render:basePoint1_x="62" render:basePoint1_y="8.95431" render:basePoint2_x="53.0457" render:basePoint2_y="0"/>
                      <render:element xsi:type="RenderPoint" render:x="20" render:y="0"/>
                    </render:listOfElements>
                  </render:curve>
                </render:g>
              </render:style>
              <render:style render:roleList="sidesubstrate substrate" render:idList="ruleGlyph">
                <render:g render:stroke="Color_1" render:stroke-width="2" render:fill-rule="nonzero" render:font-size="0" render:font-family="sans-serif" render:font-style="normal" render:font-weight="normal" render:text-anchor="start" render:vtext-anchor="top"/>
              </render:style>
              <render:style render:roleList="product">
                <render:g render:stroke="Color_1" render:stroke-width="2" render:fill-rule="nonzero" render:font-size="0" render:font-family="sans-serif" render:font-style="normal" render:font-weight="normal" render:text-anchor="start" render:vtext-anchor="top" render:endHead="product"/>
              </render:style>
              <render:style render:idList="tGlyph_0">
                <render:g render:stroke="Color_2" render:stroke-width="0" render:fill-rule="nonzero" render:font-size="11" render:font-family="Arial" render:font-style="normal" render:font-weight="normal" render:text-anchor="middle" render:vtext-anchor="top"/>
              </render:style>
              <render:style render:idList="tGlyph_1">
                <render:g render:stroke="Color_2" render:stroke-width="0" render:fill-rule="nonzero" render:font-size="11" render:font-family="Arial" render:font-style="normal" render:font-weight="normal" render:text-anchor="middle" render:vtext-anchor="top"/>
              </render:style>
              <render:style render:idList="tGlyph_2">
                <render:g render:stroke="Color_2" render:stroke-width="0" render:fill-rule="nonzero" render:font-size="11" render:font-family="Arial" render:font-style="normal" render:font-weight="normal" render:text-anchor="middle" render:vtext-anchor="top"/>
              </render:style>
            </render:listOfStyles>
          </render:renderInformation>
        </render:listOfRenderInformation>
      </layout:layout>
    </layout:listOfLayouts>
  </model>
</sbml>

Friday, August 3, 2012

libSBML 5.6.0 Released

I’m glad to announce that we have just released libSBML 5.6.0. This new release comes with more binary installers. Among them Python 3 and R bindings in two flavors: with or without SBML package code. Main changes in this release are:

  • An updated python 2.x binding, contributed by Gordon Ball, that makes the python API more python like. Here just one example on how this can look:
    Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from libsbml import *
    >>> doc = readSBML('/Development/libsbml/examples/sample-models/from-spec/level-3/membrane.xml')
    >>> doc.model
    <Model Model_1 "Reaction on membrane">
    >>> doc.model.compartments[0]
    <Compartment cyt "Cytosol">
    >>> doc.model.compartments[0].name
    'Cytosol'
    >>>


  • Updated Layout package with GeneralGlyph / ReferenceGlyphs for those that want to represent other things than just compartments, species and reactions.


  • (experimental) Implementation of the QUAL package


  • (experimental) Updated Spatial package to make it easier dealing with ImageData as well as Spatial Parameters


  • (experimental) Updated Groups package that includes the ‘kind’ attribute.


  • (experimental) Updated FBC package that allows to set Operations and FluxBounds through enums.

All this is rounded up by bug fixes, with handling of MIRIAM annotations among others. The full release announcement is online.


Please grab the new version from SourceForge:


http://sourceforge.net/projects/sbml/files/libsbml/5.6.0/


SBML logo[3]

Thursday, July 12, 2012

R bindings for libSBML 5.5.0

R, an environment for statistical computing, enjoys popularity in the wider fields of computational biology. Until now, if you would feel like consuming an SBML model in R you could use the Bioconductor project rsbml. It would be great for reading SBML (by transforming it into a DOM).

r-logo

Over the past weeks I’ve spend some time looking into R bindings for libSBML based on SWIG code generation. This will make it possible to fully create / manipulate / validate SBML documents from R. At the same time support for all SBML packages will be readily available.

First experiments seem to be quite convincing, I’ve ported all the C examples over to R (isn’t it nice how you can write C code in any language?). From here I would hope that some R and SBML enthusiast could write some helper functions to make the functions more R-like. Here the examples:

In order to install the bindings you need to have R 2.15.1 simply download the binary package for your system:

And then execute

R CMD INSTALL <archivename>



(or choose install from local package in the RGui.) I did not have luck renaming these files, so perhaps the names have to be what they are. If you are interested in compiling a binary package from source, you can use the CMake build files and select WITH_R to have it build the R bindings (tested with SWIG 2.0.4). In any case I would look forward to hear how it is working for you.