STANFORD, Calif. — On a small darkened platform a handful of fruit flies wander aimlessly. There is a brief flash of light and a robotic arm darts downward, precisely targeting a fly’s thorax, a moving target roughly the size of a pinhead.

The fly seems unfazed, appearing not to notice that it has been snatched by a high-speed laboratory robot.

The system, which has been prototyped by a team of biologists and roboticists at Stanford, makes it possible automate many aspects of research on Drosophila, one of the most popular experimental animals. Tasks such as determining gender, measuring the size of body parts and even performing micro-brain surgery — long performed by graduate students armed with tweezers — can now be assigned to a robot.