The rats that lurk in the parks and sewers of Manhattan are the bane of existence for the millions of humans who live and work on the storied island.

But those rats have developed distinct populations that appear as diverse as human neighborhoods from the Upper West Side to Greenwich Village, writes a team of scientists from Fordham University in the journal Molecular Biology.

The pests from the Uptown and Downtown parts of the island were cousins, but their DNA clearly showed they had separated into two populations all their own, they find.

“A clear split between major Uptown and Downtown genetic clusters as well as minor spatial genetic structuring within those areas suggest heterogeneity in the extent of gene flow and drift after the urban landscape,” they write.

The experiment began with capturing the critters. In public places and with permission on some pieces of private property, the team set out lethal “snap traps” across the borough. A total of 393 rats were killed between June 2014 and December 2015, and they were whittled down to a group of 262 samples for the greatest possible geographic diversity.

The Fordham scientists then cut off up to 4 centimeters of each tail – and sequenced the DNA, using a grand total of 61,401 single-nucleotide polymorphisms (SNPs).

The geographic locations were defined as: the southern tip of the island north to 14th Street as Downtown; Midtown sandwiched between 14th Street and 59th Street; and Uptown with all the streets and residences from 59th Street north to the tip of the island.

The populations were assessed statistically using multiple methods, among them Bayesian clustering, and also Principal Components Analysis (PCA) to identify major genetic trends.

Their results showed the rats tend to stick close to home, never generally wandering farther than 200 meters in any direction from where they were born. The populations thus became a bit isolated from one another over a number of centuries, they write.

Midtown was a homogenous rat group, and there were fewer of them. But the rest of the Big Apple’s rats had developed into pockets. Downtown and Uptown were their own distinct subpopulations. Even within the “Uptown” group, there were two sets that were established: one extending from Upper Manhattan to western and central parts of Harlem, and another population holding sway of the Upper West Side and Upper East Side, in addition to the eastern sections of Harlem.

The New York City rat population was also compared to a global dataset, to determine their relation to the critters worldwide. The group of 314 brown rats extended across the globe. But the genetic analysis they were extremely similar to their rodent counterparts from Great Britain. Their analysis also pinpoint a time frame and travel method: between the 1750s and 1770s, at which time their “invasion” of the British colonial island began in the south from British rats that had stowed away aboard ships, they write.

The genetic diversity showed some surprising relations to counterparts in other far-flung locales. For instance, the New York City rats were very similar to those in Brazil, Argentina and New Orleans. However, they were a completely different population from Baltimore, a city considerably closer on the Eastern Seaboard.