22 March 2013

SED-ML gets more interesting when you start using it: PySCeS

Last year I started getting more active in the "Simulation Experiment Description Markup Language" (SED-ML) community. At its simplest SED-ML is a way of describing time-simulation plots in a standard way, of course it is way more than this, especially after the workshop hosted by Dagmar in Rostock last November year.

Just recently, using Frank Bergmann's.SED-ML tools for the conversion I've added SED-ML support into PySCeS. Its pretty simple to use as well, anything generated with mod.doSimPlot() can be exported.
import pysces
mod = pysces.model('chain.psc','d:\\projects\\modeldir')

mod.exportSimAsSedML() does all the work and its arguments specify that output should be produced as raw SBML/SED-ML files, a SEDML archive (the same files zipped together) and a COMBINE archive (*.omex) a recently proposed archive format that includes the same files with all sorts of metadata.

While this is the simplest use-case, to do this I've wrapped most of the SED-ML 1.1 spec into a Python class that can be used to generate arbitrary SED-ML descriptions. This actually generates Frank's SED-ML script which then either uses libSEDML, installed locally, or the web services provided  here to generate the SED-ML.
sed = pysces.SED.SED(sed_id, sed_output_path)

In [11]: sed.
sed.addTaskPlot sed.addModel
sed.addDataGenerator sed.addTaskDataGenerators
sed.addModelAlt sed.writeCOMBINEArchive
sed.addPlot sed.writeSedScript
sed.addSimulation sed.writeSedXArchive
sed.addTask sed.writeSedXML

In [11]: sed.

This will all be available in the PySCeS 0.9 release (soon :-))

No comments:

Post a Comment