geckopy.io

Read and write SBML directly with `geckopy.Model`s.

Proteins are Species, members of Group Protein, with:
  • initialAmount: Concentration.

  • boundary_condition: True

The MW are initialAssingments.

Module Contents

Functions

read_sbml_ec_model(filename: str, number: float = float, f_replace=F_REPLACE, set_missing_bounds: bool = False, hardcoded_rev_reactions: bool = True, **kwargs) → geckopy.model.Model

Create geckopy.Model from SBMLDocument.

write_sbml_ec_model(ec_model: geckopy.model.Model, filename: str, f_replace=F_REPLACE, units=True)

Write cobra model to filename.

geckopy.io.read_sbml_ec_model(filename: str, number: float = float, f_replace=F_REPLACE, set_missing_bounds: bool = False, hardcoded_rev_reactions: bool = True, **kwargs)geckopy.model.Model[source]

Create geckopy.Model from SBMLDocument.

Parameters
  • filename (str) –

  • number (data type of stoichiometry: {float, int}) – In which data type should the stoichiometry be parsed.

  • f_replace (dict of replacement functions for id replacement) –

  • set_missing_bounds (flag to set missing bounds) –

  • hardcoded_rev_reactions (bool) – if reversible reaction to account for proteins being consumed on both directions are written explicitly for in the SBML

Returns

Return type

cobra.core.Model

geckopy.io.write_sbml_ec_model(ec_model: geckopy.model.Model, filename: str, f_replace=F_REPLACE, units=True)[source]

Write cobra model to filename.

Enzyme constraint changes: proteins are written as metabolites with initialAmount.

The created model is SBML level 3 version 1 (L1V3) with fbc package v2 (fbc-v2). If the given filename ends with the suffix “.gz” (for example, “myfile.xml.gz”), libSBML assumes the caller wants the file to be written compressed in gzip format. Similarly, if the given filename ends with “.zip” or “.bz2”, libSBML assumes the caller wants the file to be compressed in zip or bzip2 format (respectively). Files whose names lack these suffixes will be written uncompressed. Special considerations for the zip format: If the given filename ends with “.zip”, the file placed in the zip archive will have the suffix “.xml” or “.sbml”. For example, the file in the zip archive will be named “test.xml” if the given filename is “test.xml.zip” or “test.zip”. Similarly, the filename in the archive will be “test.sbml” if the given filename is “test.sbml.zip”.

Parameters
  • cobra_model (geckopy.Model) – Model instance which is written to SBML

  • filename (string) – path to which the model is written

  • f_replace (dict of replacement functions for id replacement) –