Download Links

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

Monday, March 8, 2010

Nested Simulation Experiments

A couple of days ago, I posted a proposal for a Nested Simulation Experiment for SED-ML. There I proposed that instead of defining a new Simulation class for each experiment you’d like to run, it would be better for implementers and modelers alike to be able to compose simulation experiments out of primitives. That is instead of defining:

  • a TimeCourse Simulation experiment like this:

    <timeCourse id="s1" name="time course definition" algorithm="KiSAO:0000019">
    <uniformRange start="0" end="100" numberOfPoints="10" />
    </timeCourse>
  • and next like this:

    <timeCourse id="s1" name="time course definition" algorithm="KiSAO:0000019">
    <vectorRange>
    <value> 1 </value>
    <value> 4 </value>
    <value> 10 </value>
    <value> 23 </value>
    <value> 42 </value>
    </vectorRange>
    </timeCourse>

one could compose these same experiments with primitives. (Just as an aside, note that in the cases above a simulator supporting the simulation experiment would have to implement a different set of operations).

The Primitives

I would envision three primitives:

  • OneStep: this calculates one further output step for the model from its current state. Note that this does NOT have to mean one integration step. The simulator is allowed to take as many steps as needed, all that has to be fulfilled with this simulation class, is that, at the end, the desired output time is reached.
  • SteadyState: This brings the model from its current state to a steady state. This simulation class will also just provide one output row for attached data generators, the state of the model at steady state.
  • SetValue: This is not a simulation class, but rather a convenience function, to change a model variable/parameter. In this way it is akin to ChangeMath / ChangeAttribute / ChangeXML we would have to discuss the actual syntax of it.

These primitives then are used in a nested simulation experiment to describe virtually any simulation experiment. Through the nested class construct. This construct allows to refer to:

  • A task object, which defines the model and simulation experiment to be called repeatedly,
  • A range object, which defines how often the simulation task above is to be called,
  • A SetValue construct describing how model variables are to be changed. Note:that the SetValue construct will have to be able to refer to the ranges current value.

Additionally, flags would indicate, whether the model is supposed to be reset after each run or not.

Examples

So far the proposal, so how would this look in an example. Lets go through each one and make up some examples as we go along.

  • OneStep: This is a simulation class, causing the model time variable to be adapted from the current time with a given step (that determines where the desired output point is):

    <listOfSimulations>
    <oneStep id="s1" algorithm="KiSAO:0000019" step="0.1"/>
    </listOfSimulations>

    when used in a task, this simulation task simulates the model from 0 to 0.1. The data generators are supposed to be calculated to yield the desired outputs for time point 0.1.
  • SteadyState: This is another simulation class, so we would define it as such. Unfortunately KISAO does not currently describe any steady state solvers and instead mostly integrators. So suppose in the following that:

    KISAO:0000099 = steady state solver (it would probably somewhere below KISAO:0000018)

    <listOfSimulations>
    <steadyState id="s2" algorithm="KiSAO:0000099" />
    </listOfSimulations>

    when used in a task, this simulation task brings the model to steady state. Once finished the data generators are supposed to be calculated to yield the desired output points for the model variables at steady state.
  • NestedSimulation: So how would this now look in a nested simulation experiment:
  • <listOfSimulations>
        <nestedSimulation id="s3" algorithm="KiSAO:0000019"
                             resetModel="false" originalTask="task1">
        <vectorRange>
             <value> 1 </value>
            <value> 4 </value>
            <value> 10 </value>
        </vectorRange>
        <setValue target="/sbml/model/listOfParameters/parameter[@id='w']">
         <listOfVariables>
             <variable id="current" name="current range value" target="#current" />
         <listOfVariables/>
         <math>
             <ci>current</ci>
         </math>
        </setValue>
       </nestedSimulation>
    </listOfSimulations>

    The nested simulation above, would carry out task1 3 times. Each time the value of a model parameter ‘w’ is varied by applying one of the three values.  If task1 specifies a steady state primitive, then this snippet produces the steady state values for w=1, w=4 and w=10.

    Or we could have used a uniform range to sweep the parameter. Or a functional range, to vary the parameter in logScale for example.

    If task1 would refer to a uniformTimeCourse Simulation then this would actually perform a simulation, where a parameter is changed in steps. After each time we would see how the model reacts to this discrete parameter change.

Note that you could even define a uniform time course simulation using this approach. Here task1 refers to a ‘oneStep’ simulation task. We would just vary the models time each time:

<listOfSimulations>
    <nestedSimulation id="s3" algorithm="KiSAO:0000019"
                         resetModel="false" originalTask="task1">
    <uniformRange start="0" end="100" numberOfPoints="10" />
    <setValue target="#time">
     <listOfVariables>
         <variable id="current" name="current range value" target="#current" />
     <listOfVariables/>
     <math>
         <ci>current</ci>
     </math>
    </setValue>
   </nestedSimulation>
</listOfSimulations>

You could even think about nesting the nestedSimulation experiments in order to for example perform 2D parameter scans or what have you.

Conclusions

Defining simulation experiments through these primitives will open up SED-ML and make it really useful. These primitives are easy to implement. In fact they are already implemented in available simulators. They are what is needed to implement the proposed Range construct anyway.

So let us not be shackled by having to each time define a new simulation class. The nested approach here will be what is needed to define most simulation experiments. By adding new primitives later on it can be easily extended.

I’m perfectly happy to open it up further. What one could envision would be multiple <setValue> elements to change multiple parameters. or even multiple ranges, though then each would have to have an id, to be used in the SetValue constructs. But I’m sure it could be sorted out.

Tuesday, February 9, 2010

Computational Tools for the Annotation of SBML Models

I was asked to give a brief talk  for the Semantic Web in Biomedicine Seminar, on computational tools that make the task of using all the great ontologies (like MIRIAM, SBO, ChEBI, UniProt, KEGG) that we have come to love easier.

I will add the full presentation below. However, as always without all too much text, thus I’m going to continue below.

I’m deeply involved with the Systems Biology Workbench (SBW), a lightweight framework that enables applications to share their functionality regardless of operating system or programming language. With SBW we also deliver a full toolset for modeling, simulating and analyzing SBML models. About five years back we started to get involved with SBGN. So today it would be great if we could automatically generate SBGN diagrams out of our SBML models. What is needed for that are annotations. Not just any annotations but annotations in the form of SBO ( the material entity branch) would be perfect. Unfortunately this is not quite enough. Additional MIRIAM annotations are needed for example to describe complexes in more detail.

I’ve been looking at this for some time and there are a couple of interesting developments to mention, of course first and foremost the EBI Web Services. They certainly make the work much easier. I introduce the:

  • BioModels Web Service
  • SBO Web Service
  • MIRIAM Web Service
  • Ontology Lookup Web Service

Each web service is briefly tested, using a Generic Soap Client, as this will allow to show the sort of information that is being provided first hand.

Of course it would be great if one would not have to hunt each Web Service down and it would seem that others had the same idea. I mention libAnnotationSBML first, a neat Java library that promises to provide a unified interface for a whole list of web services:

image

(photo grabbed from Neil’s presentation on Slideshare). The only drawback I could find with it is that the library is IMHO not quite ready to use by non Java geniuses. Everyone hearing me: If you are developing a library … especially a library for Java / .NET or any of the other cross platform virtual machines … please please provide a binary for people to use.  It’s been a while that I worked with Java, and an ant build script that won’t work is trouble for me. As it turned out the build failed because just of a couple of missing jar files and a test failure due to changes in the SBO. Still at the end of it all I ended up with a jar file and no instructions on what to do with it. I’ve seen great demos of libAnnoationSBML with the SBMLReactionBalancer for example. This could be made available online as binary as is …

The presentation will go on to introduce SAINT: a lightweight integration environment for model annotation. It follows the same great idea as in libAnnoationSBML of hunting down the individual web services for annotations of your SBML file. However, whereas libAnnotationSBML is a Java library, SAINT is nifty web application based on the Google Web Toolkit(GWT). As such it really brings a long a snappy AJAX UI. SAINT has a lot of potential, but again it would seem I was out of luck, I could not manage to get a model annotated. Here is what went wrong: a) no upload button, but that is fine copying the SBML to clipboard and pasting it was not all that hard b) once I clicked “Annotate” however a whole bunch of Asynchronous worker bee's must have been sent out in order to fetch all my new Annotations. But when they came back they brought along a whole list of annotations I had no interested in:

image

The above image represents all the results found for “glucose”. And while it is great to find so many Pathway Commons Identifiers, the link to Pathway Commons lead to 404. The trick seems to be for me to disable the “New Reactions” checkbox in advanced options. Then I received a couple of SBO terms for my model, however not much more. But SBO terms are a good start, so from here I went to the “Get Annotated Model Code” tab, but try as I might I was never able to actually retrieve my annotated model. 

image

Looking at other currently available software tools like CellDesigner and COPASI, both tools that support MIRIAM annotations I am not sure whether users of the tools will take full advantage of the Annotation process. Thus I end the presentation with a couple of screenshots of software tools using the EBI Web Services, to interact with the BioModels Database, resolve the publication citation and visualize the annotations in a way better suited to the community.

image

Why should we just display the ChEBI identifiers, when we could just as well show a formula, or the name, with a click revealing the full set of annotations.