:mod:`geckopy.io` ================= .. py:module:: geckopy.io .. autoapi-nested-parse:: 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 ~~~~~~~~~ .. autoapisummary:: geckopy.io.read_sbml_ec_model geckopy.io.write_sbml_ec_model .. function:: 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. :param filename: :type filename: str :param number: In which data type should the stoichiometry be parsed. :type number: data type of stoichiometry: {float, int} :param f_replace: :type f_replace: dict of replacement functions for id replacement :param set_missing_bounds: :type set_missing_bounds: flag to set missing bounds :param hardcoded_rev_reactions: if reversible reaction to account for proteins being consumed on both directions are written explicitly for in the SBML :type hardcoded_rev_reactions: bool :returns: :rtype: cobra.core.Model .. function:: write_sbml_ec_model(ec_model: geckopy.model.Model, filename: str, f_replace=F_REPLACE, units=True) 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". :param cobra_model: Model instance which is written to SBML :type cobra_model: geckopy.Model :param filename: path to which the model is written :type filename: string :param f_replace: :type f_replace: dict of replacement functions for id replacement