Tiny magnetic beads produce an optical signal that could be used to quickly detect pathogens