Reaction

class modules.gemtractor.network.reaction.Reaction(identifier, name, reversible=True)[source]

Bases: object

a reaction in a network

Parameters:
  • identifier (str) – the reaction’s identifier
  • name (str) – the reaction’s name
  • reversible (bool) – is the reaction reversible?
add_input(species)[source]

adds a species that is consumed by this reaction

Parameters:species (species.Species) – the consumed species
add_output(species)[source]

adds a species that is produced by this reaction

Parameters:species (species.Species) – the produced species
serialize(species_mapper, gene_mapper, gene_complex_mapper)[source]

serialize to a JSON-dumpable object

the object will contain the following information:

  • id: the reaction’s identifier
  • name: the reaction’s name
  • rev: is the reaction reversible?
  • cons: consumed species - as list of integers pointing into the serialized species
  • prod: produced species - as list of integers pointing into the serialized species
  • enzs: enzymes that catalyze this reaction - as list of integers pointing into the serialized enzymes
  • enzc: enzyme complexes that catalyze this reaction - as list of integers pointing into the serialized enzyme complexes
Parameters:
  • species_mapper (dict) – dict that maps a species id to an integer, which corresponds to the entry in the serialized species list
  • gene_mapper (dict) – dict that maps a gene id to an integer, which corresponds to the entry in the serialized genes list
  • gene_complex_mapper (dict) – dict that maps a gene complex id to an integer, which corresponds to the entry in the serialized gene complex list
Returns:

JSON-dumpable object

Return type:

dict