def find_charge_unbalanced_reactions(reactions): """ Find metabolic reactions that are not charge balanced. Parameters ---------- reactions : iterable An iterable of cobra.Reaction's. """ return [ rxn for rxn in reactions if not con_helpers.is_charge_balanced(rxn) ]
def find_charge_imbalanced_reactions(model): """ Find metabolic reactions that are not charge balanced. This will exclude biomass, exchange and demand reactions as they are unbalanced by definition. It will also fail all reactions where at least one metabolite does not have a charge defined. Parameters ---------- model : cobra.Model The metabolic model under investigation. """ internal_rxns = con_helpers.get_internals(model) return [ rxn for rxn in internal_rxns if not con_helpers.is_charge_balanced(rxn) ]