[result, message, pwFile] = pwSBML2PW(fileIn, pwFile, showInEditor,
                               importSettings, activeConversionLink)

 Converts an SBML model given as an xml file or as a converted
 Matlab function into a valid PottersWheel model definition file.


Arguments for pwSBML2PW

 fileIn    Either an SBML file,
           a Matlab function that returns an SBML Matlab struct
           (e.g. created by the PottersWheel SBML conversion web service),
           or an SBML struct
           (e.g. created by the SBML toolbox function TranslateSBML).
           Supported SBML versions: Up to level 3, version 1.

 pwFile    Name of the PottersWheel model definition file to be created.
           File extension should be '.m' since PottersWheel models
           are constructed as Matlab functions.
           If left empty, the model ID is used: modelID.m
           The length of the name of pwFile (without path) must be
           shorter than 63 characters.
           The returned value of pwFile contains the used filename.

 showInEditor  If true, opens the created PW model file in the
               Matlab text editor. Default: true

           Struct with information on how to import the SBML model.
           The struct may also exist as a variable named 'importSettings'
           in the mat file named <sbmlFilename>_pwImportSettings.mat
           in a subfolder SbmlImportSettings, where sbmlFilename is the
           name of the SBML file without extension.
           If the struct is not specified directly or through an external
           file, a graphical user interface will be shown
           for interactive selection of the following settings:
               If a setting is true, the compartment, species, parameters,
               or reaction IDs are ignored and the information in the
               corresponding name attribute is used.
               See below for further information.
               If the settings were entered interactively, a corresponding
               settings struct is automatically saved, so that the dialog
               does not have to be shown when the SBML file is loaded again,
               e.g. after modifications through a third-party software.

           If true, the created model file is linked to the original SBML file,
           so that reloading the model using pwReload includes a new conversion
           of the SBML file. This enables to work with SBML files directly.
           Default value as provided in the configuration:

 result    true for a successful conversion

 message   Reason why conversion was not successful.



 Many mathematical models in Systems Biology are expressed as xml
 files with a certain structure as defined in the Systems Biology
 Markup Language (SBML) standard [1]. Two ways exist to create a
 PottersWheel model definition file based on an SBML model:


1. Using the SBML Matlab Toolbox

 Sarah Keating et al. developed a Matlab Toolbox that converts an SBML file
 into a Matlab object, namely a Matlab struct [2]. PottersWheel uses the
 conversion function within pwSBML2PW and interpretes the returned Matlab
 struct. This approach is useful if you regularly want to convert SBML models
 or in order to work with SBML models directly using pwAddModel and pwReload
 or the corresponding user interface commands.

 Installation of the SBML Matlab Toolbox is unfortunately not straightforward
 for Matlab version older than R2007b (see below). Otherwise, please go to
 in order to install libSBML and, afterwards, the SBML toolbox.

 SBML toolbox support by PottersWheel has been tested using the following configurations:

 R2007b (32 bit) on Windows 7 (64 bit)
 R2010a (both 32 bit) on Windows 7 (64 bit)

 MEX compiler
 lcc (Matlab default)

 each available from

 Version 4.1.0 available from

 Installation procedure for Windows with a 32-bit Matlab version:
 1. Execute libSBML-5.5.0-win-matlab-x86.exe
 2. Run installSBML.m available in
    C:\Program Files (x86)\SBML\libSBML-5.5.0-libxml2-x86\bindings\matlab\matlab
    (if not already done automatically by the setup)
 3. Unzip
 4. Run install.m available in
 5. Test the installation by running "TranslateSBML" and selecting
    the file "test.xml" available in the same folder,

 Installation of the SBMLToolbox is not straightforward for Matlab 2006a,
 which motivated the creation of the SBML conversion webservice which
 is described in the next section.


2. Using the SBML to Matlab conversion service of

 At a web service lets you upload an xml file, e.g.
 InsulinModel.xml, for automatic conversion. The result, e.g. InsulinModel.m,
 is a Matlab file, namely a Matlab function. It will return the same Matlab
 struct as the SBML toolbox when executed. If the Matlab function is saved
 on the local harddisk and its path is supplied to pwSBML2PW,
 a valid PottersWheel model definition file can be created, either
 using the menu button or the command line, e.g.

  pwSBML2PW('../SBML/InsulinModel.m', '../Models/InsulinModel_pw.m');



 The Model ID is limited to 39 characters and will be shortened automatically
 if required.

 SBML models do not comprise driving inputs, where a variable is given
 externally analytically or as a smooth interpolation function.
 Instead, inputs are often specified via time-dependent events.
 This however dramatically reduces integration speed, since the integrator
 has to determine the event (which can not be done by all integrators).
 Therefore, it is recommended to manually convert time-dependent
 events into PottersWheel driving inputs where this is not yet done
 automatically by pwSBML2PW.

 As in PottersWheel, SBML models contain for each species, parameter,
 and reaction an ID and a name attribute. Depending on the used software
 to create the SBML model, it might not be recommended to copy the value of
 the SBML ID to the corresponding ID in the PottersWheel model in order to
 preserve the human-readability of the PottersWheel model. This applies
 e.g. if the IDs in the SBML model are just numbered consecutively like
 species_1, species_2, etc. or if they are global unique identifiers
 like in SBML models exported from the MATLAB Sim Biology (R) toolbox.
 Therefore, PottersWheel allows to select whether to rely on the original
 ID attributes of on the name values which can be configured separately
 for compartments, species, parameters, and reactions in the importSettings

 IDs should be unique in PottersWheel throughout the whole model.
 Therefore, parameters defined in SBML in the context of a single reaction
 and not on the global level, are prefixed with the reaction number,
 R01, R02, etc.

 Names which are used as IDs are converted using pwGetValidVariableName.


Configuration settings





 [1] M. Hucka, S. Hoops, S.M. Keating, N. Le Novère, S. Sahle, and D. Wilkinson
 Systems Biology Markup Language (SBML) Level 2:
 Structures and Facilities for Model Definitions.
 Available from Nature Precedings 2008,

 [2] S.M. Keating, B.J. Bornstein, A. Finney, and M. Hucka
 SBMLToolbox: an SBML toolbox for MATLAB users.
 Bioinformatics 2006, 22(10):1275–1277.

 [3] B.J. Bornstein, S.M. Keating, A. Jouraku, and M. Hucka
 LibSBML: An API Library for SBML.
 Bioinformatics 2008, 24(6):880–881, doi:10.1093/bioinformatics/btn051.

See also