def translate_sbml_reaction(entry, new_id, compartment_map, compound_map):
new_entry = DictReactionEntry(entry, id=new_id)<EOL>if new_entry.equation is not None:<EOL><INDENT>compounds = []<EOL>for compound, value in new_entry.equation.compounds:<EOL><INDENT>compartment = compartment_map.get(<EOL>compound.compartment, compound.compartment)<EOL>new_compound = compound.translate(<EOL>lambda name: compound_map.get(name, name)).in_compartment(<EOL>compartment)<EOL>compounds.append((new_compound, value))<EOL><DEDENT>new_entry.equation = Reaction(<EOL>new_entry.equation.direction, compounds)<EOL><DEDENT>for key, value in iteritems(parse_xhtml_reaction_notes(entry)):<EOL><INDENT>if key not in new_entry.properties:<EOL><INDENT>new_entry.properties[key] = value<EOL><DEDENT><DEDENT>return new_entry<EOL>
Translate SBML reaction entry.