biosimulators_xpp package¶
- biosimulators_xpp.exec_sed_doc(doc, working_dir, base_out_path, rel_out_path=None, apply_xml_model_changes=False, log=None, indent=0, pretty_print_modified_xml_models=False, log_level=StandardOutputErrorCapturerLevel.c, config=None)[source]¶
Execute the tasks specified in a SED document and generate the specified outputs
- Parameters
doc (
SedDocument
orstr
) – SED document or a path to SED-ML file which defines a SED documentworking_dir (
str
) – working directory of the SED document (path relative to which models are located)base_out_path (
str
) –path to store the outputs
CSV: directory in which to save outputs to files
{base_out_path}/{rel_out_path}/{report.id}.csv
HDF5: directory in which to save a single HDF5 file (
{base_out_path}/reports.h5
), with reports at keys{rel_out_path}/{report.id}
within the HDF5 file
rel_out_path (
str
, optional) – path relative tobase_out_path
to store the outputsapply_xml_model_changes (
bool
, optional) – ifTrue
, apply any model changes specified in the SED-ML file before callingtask_executer
.log (
SedDocumentLog
, optional) – log of the documentindent (
int
, optional) – degree to indent status messagespretty_print_modified_xml_models (
bool
, optional) – ifTrue
, pretty print modified XML modelslog_level (
StandardOutputErrorCapturerLevel
, optional) – level at which to log outputconfig (
Config
, optional) – BioSimulators common configurationsimulator_config (
SimulatorConfig
, optional) – tellurium configuration
- Returns
ReportResults
: results of each reportSedDocumentLog
: log of the document
- Return type
tuple
- biosimulators_xpp.exec_sed_task(task, variables, preprocessed_task=None, log=None, config=None)[source]¶
Execute a task and save its results
- Parameters
task (
Task
) – taskvariables (
list
ofVariable
) – variables that should be recordedpreprocessed_task (
dict
, optional) – preprocessed information about the task, including possible model changes and variables. This can be used to avoid repeatedly executing the same initialization for repeated calls to this method.log (
TaskLog
, optional) – log for the taskconfig (
Config
, optional) – BioSimulators common configuration
- Returns
VariableResults
: results of variablesTaskLog
: log- Return type
tuple
- Raises
NotImplementedError –
Task requires a time course that XPP doesn’t support * Task requires an algorithm that XPP doesn’t support
- biosimulators_xpp.exec_sedml_docs_in_combine_archive(archive_filename, out_dir, config=None)[source]¶
Execute the SED tasks defined in a COMBINE/OMEX archive and save the outputs
- Parameters
archive_filename (
str
) – path to COMBINE/OMEX archiveout_dir (
str
) –path to store the outputs of the archive
CSV: directory in which to save outputs to files
{ out_dir }/{ relative-path-to-SED-ML-file-within-archive }/{ report.id }.csv
HDF5: directory in which to save a single HDF5 file (
{ out_dir }/reports.h5
), with reports at keys{ relative-path-to-SED-ML-file-within-archive }/{ report.id }
within the HDF5 file
config (
Config
, optional) – BioSimulators common configuration
- Returns
SedDocumentResults
: resultsCombineArchiveLog
: log
- Return type
tuple
- biosimulators_xpp.get_simulator_version()[source]¶
Get the installed version of XPP
- Returns
version
- Return type
str
- biosimulators_xpp.preprocess_sed_task(task, variables, config=None)[source]¶
Preprocess a SED task, including its possible model changes and variables. This is useful for avoiding repeatedly initializing tasks on repeated calls of
exec_sed_task
.- Parameters
task (
Task
) – taskvariables (
list
ofVariable
) – variables that should be recordedconfig (
Config
, optional) – BioSimulators common configuration
- Returns
preprocessed information about the task
- Return type
dict
Submodules¶
biosimulators_xpp.core module¶
BioSimulators-compliant command-line interface to the XPP simulation program.
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2021-08-06
- Copyright
2021, Center for Reproducible Biomedical Modeling
- License
MIT
- biosimulators_xpp.core.exec_sed_doc(doc, working_dir, base_out_path, rel_out_path=None, apply_xml_model_changes=False, log=None, indent=0, pretty_print_modified_xml_models=False, log_level=StandardOutputErrorCapturerLevel.c, config=None)[source]¶
Execute the tasks specified in a SED document and generate the specified outputs
- Parameters
doc (
SedDocument
orstr
) – SED document or a path to SED-ML file which defines a SED documentworking_dir (
str
) – working directory of the SED document (path relative to which models are located)base_out_path (
str
) –path to store the outputs
CSV: directory in which to save outputs to files
{base_out_path}/{rel_out_path}/{report.id}.csv
HDF5: directory in which to save a single HDF5 file (
{base_out_path}/reports.h5
), with reports at keys{rel_out_path}/{report.id}
within the HDF5 file
rel_out_path (
str
, optional) – path relative tobase_out_path
to store the outputsapply_xml_model_changes (
bool
, optional) – ifTrue
, apply any model changes specified in the SED-ML file before callingtask_executer
.log (
SedDocumentLog
, optional) – log of the documentindent (
int
, optional) – degree to indent status messagespretty_print_modified_xml_models (
bool
, optional) – ifTrue
, pretty print modified XML modelslog_level (
StandardOutputErrorCapturerLevel
, optional) – level at which to log outputconfig (
Config
, optional) – BioSimulators common configurationsimulator_config (
SimulatorConfig
, optional) – tellurium configuration
- Returns
ReportResults
: results of each reportSedDocumentLog
: log of the document
- Return type
tuple
- biosimulators_xpp.core.exec_sed_task(task, variables, preprocessed_task=None, log=None, config=None)[source]¶
Execute a task and save its results
- Parameters
task (
Task
) – taskvariables (
list
ofVariable
) – variables that should be recordedpreprocessed_task (
dict
, optional) – preprocessed information about the task, including possible model changes and variables. This can be used to avoid repeatedly executing the same initialization for repeated calls to this method.log (
TaskLog
, optional) – log for the taskconfig (
Config
, optional) – BioSimulators common configuration
- Returns
VariableResults
: results of variablesTaskLog
: log- Return type
tuple
- Raises
NotImplementedError –
Task requires a time course that XPP doesn’t support * Task requires an algorithm that XPP doesn’t support
- biosimulators_xpp.core.exec_sedml_docs_in_combine_archive(archive_filename, out_dir, config=None)[source]¶
Execute the SED tasks defined in a COMBINE/OMEX archive and save the outputs
- Parameters
archive_filename (
str
) – path to COMBINE/OMEX archiveout_dir (
str
) –path to store the outputs of the archive
CSV: directory in which to save outputs to files
{ out_dir }/{ relative-path-to-SED-ML-file-within-archive }/{ report.id }.csv
HDF5: directory in which to save a single HDF5 file (
{ out_dir }/reports.h5
), with reports at keys{ relative-path-to-SED-ML-file-within-archive }/{ report.id }
within the HDF5 file
config (
Config
, optional) – BioSimulators common configuration
- Returns
SedDocumentResults
: resultsCombineArchiveLog
: log
- Return type
tuple
- biosimulators_xpp.core.preprocess_sed_task(task, variables, config=None)[source]¶
Preprocess a SED task, including its possible model changes and variables. This is useful for avoiding repeatedly initializing tasks on repeated calls of
exec_sed_task
.- Parameters
task (
Task
) – taskvariables (
list
ofVariable
) – variables that should be recordedconfig (
Config
, optional) – BioSimulators common configuration
- Returns
preprocessed information about the task
- Return type
dict
biosimulators_xpp.data_model module¶
Data model
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2021-08-07
- Copyright
2021, Center for Reproducible Biomedical Modeling
- License
MIT
biosimulators_xpp.utils module¶
Utility methods
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2021-08-06
- Copyright
2021, Center for Reproducible Biomedical Modeling
- License
MIT
- biosimulators_xpp.utils.apply_model_changes(xpp_model, sed_changes)[source]¶
Validate the SED variables for a XPP model
- Parameters
xpp_model (
dict
) – XPP modelsed_changes (
list
ofModelAttributeChange
) – SED model attribute changes
- biosimulators_xpp.utils.exec_xpp_simulation(sim_filename, simulation, set_filename=None, overwrite_parameters=True, overwrite_initial_conditions=True, overwrite_method=True)[source]¶
Execute an XPP simulation, optionally overwriting its default parameters and initial conditions
- Parameters
sim_filename (
str
) – path to the XPP filesimulation (
dict
) – simulation parameters, initial conditions, and method to override defaultsset_filename (
str
, optional) – path to XPP set fileoverwrite_parameters (
bool
, optional) – whether to overwrite the default parametersoverwrite_initial_conditions (
bool
, optional) – whether to overwrite the default initial conditionsoverwrite_method (
bool
, optional) – whether to overwrite the default simulation method and its settings
- Returns
simulation results
- Return type
pandas.DataFrame
- biosimulators_xpp.utils.get_results_of_sed_variables(sed_simulation, xpp_results, sed_variables)[source]¶
Get the results of a list of SED variables
- Parameters
sed_simulation (
UniformTimeCourseSimulation
) – SED simulationxpp_results (
pandas.DataFrame
) – raw results generated by XPPsed_variables (
list
ofVariable
) – SED variables
- Returns
results
- Return type
VariableResults
- biosimulators_xpp.utils.get_simulation_method_kisao_map()[source]¶
Invert the map from KiSAO ids to simulation methods
- Returns
inverted map
- Return type
dict
- biosimulators_xpp.utils.set_up_simulation(sed_sim, xpp_sim, config=None)[source]¶
Apply SED simulation settings to the configuration of a XPP simulation
- Parameters
sed_sim (
UniformTimeCourseSimulation
) – SED simulationxpp_sim (
dict
) – XPP simulationconfig (
Config
, optional) – configuration
- Returns
dict
: XPP simulationstr
: KiSAO id of the algorithm to execute
- Return type
tuple
- biosimulators_xpp.utils.validate_variables(xpp_model, sed_variables)[source]¶
Validate the SED variables for a XPP model
- Parameters
xpp_model (
dict
) – XPP modelsed_variables (
list
ofVariable
) – SED variables
- biosimulators_xpp.utils.write_method_to_xpp_simulation_file(simulation_method, in_filename, out_filename)[source]¶
Overwrite the simulation method settings in an XPP simulation file
- Parameters
simulation_method (
dict
) – dictionary of simulation method settingsin_filename (
str
) – base XPP simulation fileout_filename (
str
) – path to save modified XPP simulation file
- biosimulators_xpp.utils.write_xpp_initial_conditions_file(initial_conditions, filename)[source]¶
Write a set of initial conditions to a XPP initial conditions (
.ic
) file- Parameters
initial_conditions (
collections.OrderedDict
) – dictionary that maps the id of each parameter to its valuefilename (
str
) – path to save the initial conditions