flatten¶
Helpers for model flattening.
flatten_sbml
¶
Flatten given SBML file.
:param sbml_path: input path to SBML file to flatten (should be a comp model) :param sbml_flat_path: output path for flat SBML :param leave_ports: boolean flag to leave ports in flattened model.
:return: flattened SBMLDocument
flatten_sbml_doc
¶
Flatten SBMLDocument.
Validation should be performed before the flattening and is not part of the flattening routine. If an output path is provided the file is written to the output path.
:param doc: SBMLDocument to flatten. :param sbml_flat_path: Path to write flattended SBMLDocument to :param leave_ports: flag to leave ports
:return: SBMLDocument
flatten_external_model_definitions
¶
Convert all ExternalModelDefinitions to ModelDefinitions.
I.e. the definition of models in external files are read and directly included in the top model. The resulting comp model consists than only of a single file.
The model refs in the submodel do not change in the process, so no need to update the submodels.
:param doc: SBMLDocument :param validate: validation flag :return: SBMLDocument with ExternalModelDefinitions replaced