Repurposing a chemosensory macromolecular machine