The road from Highway 1 rises along the western slopes of the Santa Cruz Mountains, through vineyards and horse farms, to the steepening Empire Grade. A dirt-road turnoff dips into a dank twilight, sun filtering through stands of trees that John Steinbeck called “ambassadors from another time”.

The coast redwoods, ancient and threatened, mix with towering Douglas firs and opportunistic tanoaks throughout this restoration project on a mountaintop just miles from the sea. The redwoods here are youthful, none probably more than a century and a half old. The massive stumps of their old-growth ancestors are encircled by the young, clusters known as “fairy rings”.

As California’s climate changes to one of extremes and humans continue to harvest, the only coast redwoods on the planet are in peril. The challenge to preserving them is here, in forests like this one – and so, scientists believe, is the key to a solution.

Richard Campbell, conservation science manager for Save the Redwoods League, and Emily Burns, director of science for the league, examine redwoods in Deadman Gulch (Washington Post)

For the first time, scientists are mapping the coast redwood’s genome, a genetic code 12 times larger than that of a human being. By the end of the year, scientists hope to have mapped the complete genome of the coast redwood and of the giant sequoia, a close cousin that also is among the tallest trees in the world, some reaching hundreds of feet high. The genetic code of a single 1,300-year-old redwood from a stand just north of here and of a same-age sequoia will serve as baselines and the first step in better understanding how to make these forests more genetically diverse as a defence against rising man-made threats.

When the three-year project is complete, scientists will have the genetic fingerprints of hundreds of redwoods, a sample large enough to determine which trees have the characteristics to best withstand increased moisture or drought, heat increases or temperature drops. The results will be available as an open online resource, a shared tool for those managing the forests.

“We’re trying to apply basic science to the basic decisions we’re making on the ground,” said Emily Burns, director of science for the century-old nonprofit Save the Redwoods League, which is paying for the $2.6m (£1.9m) project through private donations. “What we see around us is the result of environment and genetics. Until now, we’ve been making decisions based only on environment.”

Redwoods absorb moisture from fog at their crowns, but erratic weather patterns risk changing the frequency of fog (Washington Post)

Since the mid-19th-century gold rush showcased the extent of California’s natural wealth, redwood timber has been prized by home builders and furniture makers for its quality and colour. The trees’ harvesting accelerated around the turn of the last century, when new rail lines quickened the pace of the international lumber trade.

Old-growth redwood forests once extended from the now-arid northern edge of southern California to the Columbia River Gorge in Oregon. Just 5 per cent of the redwoods that stood before 1849 are still alive, and the tree’s footprint has shrunk by a third.

About 1.6 million acres of redwoods remain – an area roughly the size of Delaware and Rhode Island combined – and about a quarter of that is protected. Erratic weather patterns have raised the risk to the trees, including changes in the frequency of fog, from which redwoods absorb the moisture at their crowns. Coastal erosion from rising sea levels brings a future threat.

“We don’t know how the climate is going to change nor much about what effect those changes will have on these trees,” Burns said.

The best defence against the unknown is to make stands such as this one in the lush Santa Cruz Mountains more resilient. The best way to accomplish that is to ensure that these forests are genetically diverse.

Burns holds a redwood pine cone (Washington Post)

Knowing a tree’s genetic make-up, and how those traits fit into a larger stand of trees, will allow Burns and Richard Campbell, the league’s conservation science manager, to trust the choices they make in protecting and restoring redwood forests.

“It’s going to be like speaking a new language,” said Burns, 37, who grew up in a redwood house north of San Francisco and, for her doctorate at the University of California at Berkeley, studied the effects of climate on the coastal redwood forests.

Restoration work in “second growth” redwood forests – those that have been harvested at least once before – is sometimes counterintuitive. As the forests re-emerge, they do so in ways that often stifle growth, as young trees compete for root and branch space.

The “fairy rings” around the old-growth stumps, while signs of vitality, also routinely need to be cut back to allow the most promising trees to thrive.

Which trees should be felled and which kept is now largely guesswork based, in this case, on Campbell’s experience, including his time as the director of Yale’s research and demonstration forests in New England.

“Thinning works,” Campbell said. “It’s about choosing the trees we want to see carry into the future. Knowing the genetics will make sure that I don’t screw that choice up.”

The redwood genome project began in April 2017, when a sample was taken from an old-growth redwood in Butano State Park, about an hour’s drive north in San Mateo County. The tree’s exact location is kept secret to prevent overzealous tourism.

Two labs – one at the University of California at Davis, the other at Johns Hopkins University in Baltimore – began work on identifying the tree’s genetic make-up. The science is complex and time-consuming. A human has 3 billion “base pairs” of DNA on its chromosomes; a redwood has 38 billion.

A line of blue spray paint indicates a tree that Campbell has marked to be taken down (Washington Post)

The lead scientist is David Neale, a professor of population biology and plant sciences at UC-Davis who has spent 40 years in the field developing and refining the technology being used in this project.

While examining the initial redwood sample, Neale and his team have gathered genetic material from 10 other old-growth redwoods across a variety of climates and altitudes. This is the second stage of the project: expanding the genetic library available to forest managers.

“It begins to give you an estimate of the kind of genetic variation that can be found in specific stands of these trees,” he said, describing how the information will be used in terms similar to how genetic material is applied in human health care. “Once the patient is determined to be at some genetic risk, you apply treatment and prescribe medicine.”

The redwood’s genetic code can only be “read” in Neale’s lab 150 letters at a time (each piece of genetic information is assigned a letter). At Steven Salzberg’s lab at Johns Hopkins, a more expensive process can read strings of up to 10,000 letters.

Salzberg is a professor of biomedical engineering, computer science and biostatistics. Like Neale, he has mapped a tree’s genome before but never one the size of the redwood’s.

The identification of the genome’s composition is one challenge. The sequencing and assembly – putting the various strands of letters back together in the right order – is another equally daunting one.

“Imagine we took 100 copies of today’s edition of The Washington Post and shredded it so that strings of words remained intact,” Salzberg said. “The job then is to take those scraps and make a single edition of The Post.”

‘Thinning works,’ Campbell said. ‘It’s about choosing the trees we want to see carry into the future’ (Washington Post)

The work is done by matching up overlapping strings of gene sequences. “The longer the strands, the easier to do,” he said.

Salzberg has a number of questions about what he is finding, including, in his words, “Why is there no penalty for having a genome as large as the redwood’s?”

The bigger the genetic code, the more can go wrong, and much of what the genome contains, Salzberg said, is unnecessary. The same is true of humans.

“On a pretty routine basis, we learn about our own biology by studying the genetics of others,” he said. “I’m not saying we will in this case, but redwoods do live a fantastically long life, and it would be fascinating to discover why.”

The restoration project here is gated off and patrolled, protection against off-road enthusiasts, hikers and, as Campbell put it, “the odd dope grow”.

The path slopes down towards Deadman Gulch, where a trickling creek runs past old-growth stumps and new, looming redwoods, their ropy reddish bark distinguishing them from Douglas firs. The ground is spongy, thick with needles and the leathery brown tanoak leaves that Campbell fears might be keeping new trees from emerging. A heavy ground coat can suppress new growth, and it is often burned off in the natural course of a forest’s life.

“The problem here has been not enough fire,” he said, aware that deadly wildfires to the north and south made last year the worst fire season in state history.

Blue rings have been painted around some of the redwoods, meaning Campbell has approved them for removal.

“If Richard knew that tree was genetically different in some significant way from others in this stand, he wouldn’t take it down,” Burns said, looking at one blue-ringed redwood. “Right now, we don’t know.”

Just 5 per cent of the redwoods that stood before 1849 are still alive (Washington Post)

The air is cool, especially low in the gulch. No other tree comes close to absorbing more carbon than the redwood, making these forests invaluable in reducing greenhouse gases. “Saving them seems like a better investment than ever,” Burns said.

The quiet beneath the canopy belies the life in this forest. On the 8,500-acre San Vicente Redwoods preserve, at least eight female mountain lions live with cubs. The animals have been known to make their homes in the hollowed-out stumps of the old-growth giants.

The wandering salamander, a species now at risk because of a dwindling habitat, thrives on bugs living in the moss and leaves that settle into the redwoods’ high branches.

Also at risk is the marbled murrelet, a sea bird that dwells high on heavy branches above the canopy, flying each day to the Pacific to hunt fish. The bird is on the protected list, and that protection extends to the redwood stands where it is found.

“New redwoods are gaining a foothold here,” Burns said. “Within 100 years, we can grow really large redwoods. One aspect of this restoration is that it is possible in our lifetime.”