def parse_reaction_equation_string(equation, default_compartment):
def _translate_compartments(reaction, compartment):<EOL><INDENT>"""<STR_LIT>"""<EOL>left = (((c.in_compartment(compartment), v)<EOL>if c.compartment is None else (c, v))<EOL>for c, v in reaction.left)<EOL>right = (((c.in_compartment(compartment), v)<EOL>if c.compartment is None else (c, v))<EOL>for c, v in reaction.right)<EOL>return Reaction(reaction.direction, left, right)<EOL><DEDENT>eq = _REACTION_PARSER.parse(equation).normalized()<EOL>return _translate_compartments(eq, default_compartment)<EOL>
Parse a string representation of a reaction equation.

    Converts undefined compartments to the default compartment.