sbmlutils.comp
¶
Package for SBML comp.
Submodules¶
Package Contents¶
Functions¶
|
Create comp ExternalModelDefinition. |
|
Create ports for given model. |
|
Flatten given SBML file. |
|
Flatten SBMLDocument. |
- sbmlutils.comp.create_ExternalModelDefinition(doc_comp, emd_id, source)[source]¶
Create comp ExternalModelDefinition.
- Parameters:
doc_comp (libsbml.CompSBMLDocumentPlugin) – SBMLDocument comp plugin
emd_id (str) – id of external model definition
source (str) – source
- Returns:
- Return type:
libsbml.ExternalModelDefinition
- sbmlutils.comp.create_ports(model, portRefs=None, idRefs=None, unitRefs=None, metaIdRefs=None, portType=factory.PortType.PORT, suffix=factory.PORT_SUFFIX)[source]¶
Create ports for given model.
Helper function to create port creation. :param model: SBML model :param portRefs: dict of the form {pid:portRef} :param idRefs: dict of the form {pid:idRef} :param unitRefs: dict of the form {pid:unitRef} :param metaIdRefs: dict of the form {pid:metaIdRef} :param portType: type of port :param suffix: suffix to use in port generation
- Returns:
- Parameters:
model (libsbml.Model) –
portRefs (Optional[Any]) –
idRefs (Optional[Any]) –
unitRefs (Optional[Any]) –
metaIdRefs (Optional[Any]) –
portType (sbmlutils.factory.PortType) –
suffix (str) –
- Return type:
List[sbmlutils.factory.Port]
- sbmlutils.comp.flatten_sbml(sbml_path, sbml_flat_path, leave_ports=True)[source]¶
Flatten given SBML file.
- Parameters:
sbml_path (pathlib.Path) – input path to SBML file to flatten (should be a comp model)
sbml_flat_path (pathlib.Path) – output path for flat SBML
leave_ports (bool) – boolean flag to leave ports in flattened model.
- Returns:
flattened SBMLDocument
- Return type:
libsbml.SBMLDocument
- sbmlutils.comp.flatten_sbml_doc(doc, sbml_flat_path=None, leave_ports=True)[source]¶
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.
- Parameters:
doc (libsbml.SBMLDocument) – SBMLDocument to flatten.
sbml_flat_path (Optional[pathlib.Path]) – Path to write flattended SBMLDocument to
leave_ports (bool) – flag to leave ports
- Returns:
SBMLDocument
- Return type:
libsbml.SBMLDocument