Python Guide for the Systems Biology Workbench

Introduction
This document describes the Python interface to the Systems Biology Workbench (Hucka et al., 2001b).

The Python interface has been designed so that it is very simple to call remote methods in other SBW aware modules. The intention in developing the Python module was that if should enable users to easily control SBW applications using Python scripts.

In addition to providing simple access to SBW modules, the Python interface also exposes many of the functions in the standard SBW API. The reader is recommended to consult the SBW API documentation for more details. In the majority of cases, users will not find it necessary to access the SBW API directly.

When a SBW module starts, Python is notified and a Python interface is automatically constructed to represent the module, this makes it very easy to access a module’s functionality.

When the module closes, Python will automatically remove the module’s interface. As an example consider a module which has a number of mathematical functions, including sin, cos and tan. Also assume that these functions are under the service heading ‘trig’, with the module name being ‘Trig’.

When the Trig module starts up, the following appears on the Python console.
     >>> ****** Trig is started up... creating proxy....done
     >>>
     >>> Trig
     <__main__.TrigClass instance at 0087D574>
     >>>

When Python creates a proxy object to the module, it uses the name of the modules as the basis for the variable name which will be created to represent the module. For example, the variable ‘Trig’ is automatically created to represent the ‘Trig’ module. This variable has one variable field called ‘services’. This field holds the names of the services currently available.
Thus the following scripts yields the output:
     >>> Trig.services
     [’trig’, ’log’]
     >>>

In other words, Trig contains two services, called ‘trig’ and ‘log’. To find out the methods associated with a service use the ‘methods’ field variable on a particular service. For example:
     >>> Trig.trig.methods
     [’sin’, ’cos’, ’tan’]
     >>>

Invoking a particular method is very straight forward, to invoke the sin method we for example simply use the statement:
     >>> Trig.trig.sin (30.0)
     -0.98803162409286183
     >>>

Download Python Guide for the Systems Biology Workbench



Related PDF Manuals Guide:
Moodle Teacher Guide: Getting Started with Moodle
QUALCOMM Globalstar GSP-1600 Tri-Mode Phone User Guide
PR Guide to Starting a Blog
The Citizen Soldier’s Guide to Mobilization Finance
Instore Demonstrations & Liquor Tasting Guide
A Guide to ERP Success
Photobucket Developer API Guide
PHP Manual


Leave a Reply