Download Links

Simulate 3D | SBW (Win32) | Bifurcation Discovery | FluxBalance

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.

Sunday, June 10, 2012

SED-ML Nested Proposal V3

A new version of the nested proposal is available immediately from:

http://identifiers.org/combine.specifications/sed-ml.proposal.nested-simulations.FB.version-3

The new version rephrases the Nested Simulation Class as Repeated Task, and addresses comments made by the community over the past couple of months (and of course the discussions at HARMONY 2012). As far as the scope is concerned, the current proposal is capable of describing all experiments possible with the previous version. Additionally through a new listOfSubTasks additional experiments can be run.

Steady state scan image
Pulsing a parameter during a simulation image
Multiple Stochastic Traces image
Timecourse scan image
2D Steady State scan image

 

Of course there also is an implementation available in the SED-ML Web Tools, where all examples can be run directly.

Friday, June 8, 2012

SBML Spatial Extension & Simulation

As part of my new job at the University of Heidelberg I get to work again on spatial simulations. While trying to get my feet wet, I was able to experiment with a spatial simulator by Akira Funahasi’s group (see also his presentation at last years COMBINE). So today I just wanted to share the resulting video with you:

Unable to display content. Adobe Flash is required.

It always is fascinating watching these things. And the real amazing thing is that this is not a hard coded simulation, but one that is interpreted from an SBML file. And while it probably will take a while until we are regularly exchanging spatial models we are definitely on the right way!

Monday, May 21, 2012

LibSED-ML @HARMONY 2012

HARMONY 2012 has finally started. And it started big, first I was privy to the SBML Editors meeting, and great stuff is coming there. Stay tuned on updates with respect to that. Here I’d like to share with you the slides from the introduction of libSED-ML from today:

In the morning the hackathon will start for real. Three parallel sessions: SBML, SBGN and SED-ML + semantic + BioPAX. I certainly hope to push the nested proposal for SED-ML. But luck willing we might even get a strategy for including data in SED-ML.

Saturday, May 12, 2012

libSBML 5.5.0 Released

Only one more week to go until HARMONY 2012 and the libSBML Team is proud to announce the immediate availability of libSBML 5.5.0. Primary changes in this release are:

  • a modification in the behavior of handling custom annotations
  • a better handling of MIRIAM annotations, such that RDF not falling into the subset supported by the SBML specification can be round tripped.

Additionally it is now possible to compile libSBML easily with Borland and Intel compilers (when using the CMake build system. Finally all experimental packages have been updated to allow them to be extended by other packages. That means that now it would be easily possible to use the COMP to extend the Layout elements. For more information see the full release announcement.

SBML logo[3]