biosimulators_utils.model_lang.xpp package#

Submodules#

biosimulators_utils.model_lang.xpp.data_model module#

Data model for XPP simulation methods

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2021-08-08

Copyright:

2021, Center for Reproducible Biomedical Modeling

License:

MIT

biosimulators_utils.model_lang.xpp.utils module#

Utilities for working with XPP models

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2021-08-08

Copyright:

2021, Center for Reproducible Biomedical Modeling

License:

MIT

biosimulators_utils.model_lang.xpp.utils.get_parameters_variables_outputs_for_simulation(model_filename, model_language, simulation_type, algorithm_kisao_id=None, set_filename=None, parameter_filename=None, initial_conditions_filename=None, change_level=<class 'biosimulators_utils.sedml.data_model.SedDocument'>, native_ids=False, native_data_types=False, config=None, max_number_of_steps=None)[source]#

Get the possible observables for a simulation of a model

Parameters:
  • model_filename (str) – path to model file or directory of XPP ODE, set, parameters, and initial conditions files

  • model_language (str) – model language (e.g., urn:sedml:language:xpp)

  • simulation_type (types.Type) – subclass of Simulation

  • algorithm_kisao_id (str, optional) – KiSAO id of the algorithm for simulating the model (e.g., KISAO_0000019 for CVODE)

  • set_filename (str, optional) – path to XPP set file

  • parameter_filename (str, optional) – path to XPP parameters file

  • initial_conditions_filename (str, optional) – path to XPP initial conditions file

  • change_level (types.Type, optional) – level at which model changes will be made (SedDocument or Task)

  • native_ids (bool, optional) – whether to return the raw id and name of each model component rather than the suggested name for the variable of an associated SED-ML data generator

  • native_data_types (bool, optional) – whether to return new_values in their native data types

  • config (Config, optional) – whether to fail on missing includes

  • max_number_of_steps (int, optional) – maximum number of steps to record

Returns:

possible attributes of a model that can be changed and their default values list of Simulation: simulations of the model list of Variable: possible observables for a simulation of the model list of Plot: possible plots of the results of a simulation of the model

Return type:

list of ModelAttributeChange

biosimulators_utils.model_lang.xpp.validation module#

Methods for validating XPP files

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2021-08-06

Copyright:

2021, Center for Reproducible Biomedical Modeling

License:

MIT

biosimulators_utils.model_lang.xpp.validation.get_xpp_input_configuration_from_directory(dirname)[source]#

Get input file configuration from a directory of files

  • *.ode: Main model model

  • *.set: Set file

  • *.par: Parameters file

  • *.ic: Initial conditions file

Parameters:

dirname (str) – path to directory of XPP files

Returns:

  • str: path to main model file

  • str: path to set file

  • str: path to parameters file

  • str: path to initial conditions file

  • str: name of a set to use

  • str: name of a set not to use

Return type:

tuple

biosimulators_utils.model_lang.xpp.validation.sanitize_model(filename, keep_only_directives=True, exclude_options=None)[source]#

Sanitize an ODE file for interrogation

  • Join continued statements into individual lines

  • Remove statements

Parameters:
  • filename (str) – path to model file or directory with .ode and possibly set (.set), parameter (.par), andd initial conditions (.ic) files

  • keep_only_directives (bool, optional) – whether to keep only directives which limit output variables

  • exclude_options (list of str, optional) – list of directives to exclude

Returns:

path to sanitized model file

Return type:

str

biosimulators_utils.model_lang.xpp.validation.validate_model(filename, set_filename=None, parameter_filename=None, initial_conditions_filename=None, name=None, config=None)[source]#

Check that a model is valid

Parameters:
  • filename (str) – path to model file or directory with .ode and possibly set (.set), parameter (.par), andd initial conditions (.ic) files

  • set_filename (str, optional) – path to XPP set file

  • parameter_filename (str, optional) – path to XPP parameters file

  • initial_conditions_filename (str, optional) – path to XPP initial conditions file

  • name (str, optional) – name of model for use in error messages

  • config (Config, optional) – whether to fail on missing includes

Returns:

  • nested list of str: nested list of errors (e.g., required ids missing or ids not unique)

  • nested list of str: nested list of errors (e.g., required ids missing or ids not unique)

  • dict: values of parameters of initial conditions of variables

Return type:

tuple