[result, message, pwFile] = pwSBML2PW(fileIn, pwFile, showInEditor,
Converts an SBML model given as an xml file or as a converted
Matlab function into a valid PottersWheel model definition file.
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 . Two ways exist to create a
PottersWheel model definition file based on an SBML model:
2. Using the SBML to Matlab conversion service of potterswheel.de
At www.potterswheel.de 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.
The Model ID is limited to 39 characters and will be shortened automatically
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.
 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, http://dx.doi.org/10.1038/npre.2008.2715.1
 S.M. Keating, B.J. Bornstein, A. Finney, and M. Hucka
SBMLToolbox: an SBML toolbox for MATLAB users.
Bioinformatics 2006, 22(10):1275–1277.
 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.