No one likes a rodent’s nest, and for good reason. Beyond sheltering mice, rats and other creatures we aren’t fond of, they kindle car fires, harbor bloodsucking bugs and infest the walls, ceilings and attics of homeowners.

But for paleoecologists studying the prehistoric natural world, ancient, urine-soaked rat nests can be a treasure trove, not unlike owl pellets dissections that you might have done during a school trip to a natural history museum. Since the 1960s, scientists have examined thousands of fossil rat nests, or middens, to learn about regional changes in climate and ecosystems over time.

Today, with advanced molecular technology, scientists can even tease apart the owners of millenniums-old DNA preserved in those middens. Until now, they’ve targeted small genetic fragments from specific organisms such as plants or viruses. But in a study published Tuesday in Ecology and Evolution, paleoecologists show that an expansive approach can be used to sequence all kinds of DNA found in a single midden — the scientific equivalent of moving from spear fishing to casting a broad net.

“It’s just wild that it works,” said Michael Tessler, an evolutionary biologist at the American Museum of Natural History and one of the study’s authors. “There’s a very rich picture that takes a lot of work to paint — but is now paintable.”