Metabolism : The Compound Class

class PyFBA.metabolism.Compound(name, location)

A compound is the essential metabolic compound that is involved in a reaction.

A compound has at the very minimum a name and a location. The location is typically one of:
  • e: extracellular
  • c: cytoplasmic
  • h: chloroplast
  • p: periplasm

Other variables associated with the Compound class: :ivar name: the name of the compound :ivar location: the location of the compound. :ivar reactions: a set of reaction objects that this compound is connected to :ivar model_seed_id: the compound id from the model seed. :ivar abbreviation: a short name for the compound :ivar formula: the compounds formula :ivar mw: the molecular weight of the compound :ivar common: Boolean: this is a common compound. This means the coompound is in > COMMON_REACTION_LIMIT reactions :ivar charge: the charge associated with the compound :ivar uptake_secretion: The compound is involved in uptake from the media or secretion back to the media

add_reactions(rxns)

Add a reaction that this compound is involved in. You can add a set of reactions. See the note above about the number of reactions.

Parameters:rxns (set) – A set of reactions
all_reactions()

Return a set of all the reactions that this compound is involved in

Return type:int
calculate_molecular_weight()

Calculate and return the molecular weight of this compound

Returns:The molecular weight
Return type:float
has_reaction(rxn)

Is this compound involved in this reaction?

Parameters:rxn (Reaction) – A Reaction object
Returns:Whether the reaction is present
Return type:bool
is_common(rct_limit=5)

Is this a common compound? This requires that you have added reactions to this compound.

You can either specify the number of reactions or use our default that is currently 50.

Parameters:rct_limit (int) – The limit for a compound to be considered common
Returns:Whether this is a common reaction
Return type:bool
number_of_reactions()

How many reactions is this compound involved in?

Return type:int