biocrnpyler.utils.sbmlutil

Functions

add_all_compartments(model, compartments, ...)

Adds the list of Compartment objects to the SBML model :param model: valid SBML model :param compartments: list of compartments to be added to the SBML model :return: None

add_all_reactions(model, reactions[, stochastic])

adds a list of reactions to the SBML model.

add_all_species(model, species, ...[, ...])

adds a list of Species to the SBML model.

add_compartment(model, compartment, **keywords)

Helper function to add a compartment to the SBML model.

add_parameter(mixture, name[, value, debug])

add_reaction(model, crn_reaction, reaction_id)

adds a sbml_reaction to an sbml model.

add_species(model, compartment, ...[, ...])

Helper function to add a species to the sbml model.

create_sbml_model([compartment_id, ...])

Creates an SBML Level 3 Version 2 model with some fixed standard settings.

find_parameter(mixture, id)

getAllIds(allElements)

getSpeciesByName(model, name[, compartment])

Returns a list of species in the Model with the given name compartment : (Optional) argument to specify the compartment name in which to look for the species.

get_compartment_by_name(model, compartment_name)

Helper function to find the SBML compartment object given the compartment name in the SBML file

valid_sbml_id(given_id[, document])

validate_sbml(sbml_document[, ...])

Validates the generated SBML model by using libSBML SBML validation code.

Classes

SetIdFromNames(IdentifierTransformer self)

Internal implementation method.

validateSBML(ucheck)

libSBML class to validate the generated SBML models ## @brief Validates SBMLDocument ## @author Akiya Jouraku (translated from libSBML C++ examples) ## @author Ben Bornstein ## @author Michael Hucka

class biocrnpyler.utils.sbmlutil.SetIdFromNames(IdentifierTransformer self)[source]

Internal implementation method.

property thisown

The membership flag

transform(IdentifierTransformer self, SBase element) int[source]
biocrnpyler.utils.sbmlutil.add_all_compartments(model, compartments: List, **keywords)[source]

Adds the list of Compartment objects to the SBML model :param model: valid SBML model :param compartments: list of compartments to be added to the SBML model :return: None

biocrnpyler.utils.sbmlutil.add_all_reactions(model, reactions: List, stochastic=False, **kwargs)[source]

adds a list of reactions to the SBML model. :param model: an sbml model created by create_sbml_model() :param reactions: list of Reactions :param stochastic: binary flag for stochastic models :return: None

biocrnpyler.utils.sbmlutil.add_all_species(model, species: List, initial_condition_dictionary: dict, compartment=None, **kwargs)[source]

adds a list of Species to the SBML model. :param model: valid SBML model :param species: list of species to be added to the SBML model :param compartment: compartment id, if empty species go to the first compartment :param initial_concentration_dict: a dictionary s –> initial_concentration :return: None

biocrnpyler.utils.sbmlutil.add_compartment(model, compartment, **keywords)[source]

Helper function to add a compartment to the SBML model. :param model: a valid SBML model :param compartment: a Compartment object :return: SBML compartment object

biocrnpyler.utils.sbmlutil.add_reaction(model, crn_reaction, reaction_id: str, stochastic: bool = False, reverse_reaction: bool = False, **kwargs)[source]

adds a sbml_reaction to an sbml model. :param model: an sbml model created by create_sbml_model() :param crn_reaction: must be a chemical_reaction_network.reaction object :param reaction_id: unique id of the reaction :param stochastic: stochastic model flag :param reverse_reaction: :return: SBML Reaction object

biocrnpyler.utils.sbmlutil.add_species(model, compartment, species_name, species_id, initial_concentration=None, **kwargs)[source]

Helper function to add a species to the sbml model. :param model: :param compartment: a compartment in the SBML model :param species: must be chemical_reaction_network.species objects :param initial_concentration: initial concentration of the species in the SBML model :return: SBML species object

biocrnpyler.utils.sbmlutil.create_sbml_model(compartment_id='default', time_units='second', extent_units='mole', substance_units='mole', length_units='metre', area_units='square_metre', volume_units='litre', volume=1e-06, model_id=None, **kwargs)[source]

Creates an SBML Level 3 Version 2 model with some fixed standard settings. Refer to python-libsbml for more information on SBML API. :param compartment_id: :param time_units: :param extent_units: :param substance_units: :param length_units: :param area_units: :param volume_units: :param volume: :param model_id: :return: the SBMLDocument and the Model object as a tuple

biocrnpyler.utils.sbmlutil.getSpeciesByName(model, name, compartment='')[source]

Returns a list of species in the Model with the given name compartment : (Optional) argument to specify the compartment name in which to look for the species.

biocrnpyler.utils.sbmlutil.get_compartment_by_name(model, compartment_name)[source]

Helper function to find the SBML compartment object given the compartment name in the SBML file

class biocrnpyler.utils.sbmlutil.validateSBML(ucheck)[source]

libSBML class to validate the generated SBML models ## @brief Validates SBMLDocument ## @author Akiya Jouraku (translated from libSBML C++ examples) ## @author Ben Bornstein ## @author Michael Hucka

validate(sbml_document, print_results=False)[source]

sbml_document: libSBML SBMLDocument object. print_results: Print toggle for validation warnings.

biocrnpyler.utils.sbmlutil.validate_sbml(sbml_document, enable_unit_check=False, print_results=True)[source]

Validates the generated SBML model by using libSBML SBML validation code.