Showing posts with label pysces. Show all posts
Showing posts with label pysces. Show all posts

24 August 2013

The real advantage of a "human readable" model definition format

A colleague of mine wanted to submit a model along with a paper that they had published and had somehow converted from their native format into SBML, unfortunately this had not been entirely successful and I was asked to diagnose the problem after COPASI reported a serious error in the file.

Using PySCeS I converted the file to the PySCeS model format where some translation errors were immediately apparent, could be compared to the original equation and fixed. Reloading the file, testing the steady-state solution and re-exporting it to SBML was a piece of cake.

Not bad going for a Friday afternoon ;-)

05 June 2013

PySCeS 0.9.0 has been released

Finally, after far too long, I'm happy to release a new version of PySCeS. This release has many bug fixes and provides a diverse range of new features, including:


  • parallel parameter scanning

  • generalized supply demand analysis

  • exporting simulations as SED-ML (including COMBINE archives)

  • support for scanning moiety totals

  • compatbility support for the latest versions of scipy/numpy

  • enhanced plotting support e.g. users may now choose the Matplotlib backend



This hopefully is the start of a whole new development/maintenance cycle, more news on the PySCeS website (http://pysces.sf.net) and thanks to Che for helping to debug an irritating Windows issue.

 

25 March 2013

Writing out arrays and linked lists with pysces.write.*

PySCeS array export facilities have been expanded with a new set of array export functions. This includes exporting arrays and linked lists (lists of lists) to various flavours of text file.

These methods are either fully customizable and generic or specifically tailored for writing CSV (comma) and Text (<tab> delimited) files that include the array data and optionally row/col labels. They are all available in the ''pysces.write.*'' module (see documentation/docstrings for details).
In [3]: pysces.write.
pysces.write.exportArray2CSV
pysces.write.exportArray2TXT
pysces.write.exportLabelledArray
pysces.write.exportLabelledArray2CSV
pysces.write.exportLabelledArray2TXT
pysces.write.exportLabelledArrayWithHeader
pysces.write.exportLabelledArrayWithHeader2CSV
pysces.write.exportLabelledArrayWithHeader2TXT
pysces.write.exportLabelledLinkedList

 

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.doSimPlot(50,100)
mod.exportSimAsSedML(output='files,archive,combine')

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 :-))