def reaction_charge(reaction, compound_charge):
charge_sum = <NUM_LIT:0.0><EOL>for compound, value in reaction.compounds:<EOL><INDENT>charge = compound_charge.get(compound.name, float('<STR_LIT>'))<EOL>charge_sum += charge * float(value)<EOL><DEDENT>return charge_sum<EOL>
Calculate the overall charge for the specified reaction.

    Args:
        reaction: :class:`psamm.reaction.Reaction`.
        compound_charge: a map from each compound to charge values.