Scientists have mapped the genome of bedbugs in New York City and traced fragments of the pests’ DNA through the subway system.

In the grubby recesses of hundreds of stations, they have discovered surprising genetic diversity among the creatures.

Scientists have found that genetic traces of bedbugs in northern Manhattan are relatively closely related to those in the island’s southern part, while there are bigger variations between bedbugs on the Upper East Side and the Upper West Side.

Christopher Mason, a geneticist who worked on the project, said the reason could be found by looking at a subway map. In Manhattan, for instance, subway lines run the length of the island north to south, while there is no subway link through Central Park connecting the East Side and the West Side.