HORNBROOK, Calif. — On a frigid morning in a small metal-sided building, a team of specialists prepared to orchestrate an elaborate breeding routine. The work would be wet and messy, so they wore waders. Their tools included egg trays and a rubber mallet, which they used to brain a fertile female coho salmon, now hanging dead on a hook.  Diana Chesney, a biologist, studied a piece of paper with a matrix of numbers, each one denoting a male salmon and potential match for the female coho.  “This is the bible,” she said of the matrix. “It’s what Carlos says.”  John Carlos Garza, a geneticist based a day’s drive south in Santa Cruz, has become a key figure in California’s effort to preserve its decimated salmon stocks. Using the latest genetic techniques, he and his team decide which individual fish should be bred together. At several major state conservation hatcheries, like the coho program here at Iron Gate, no two salmon are spawned until after Dr. Garza gives counsel — a “salmon mating service,” he jokingly calls it.  CreditJim Wilson/The New York Times  His painstaking work is the latest man-made solution to help fix a man-made problem that is about 150 years old: Dams, logging, mining, farming, fishing and other industries have so fractured and polluted the river system that salmon can no longer migrate and thrive. In fact, today, owing to the battered habitat, virtually all salmon in California are raised in hatcheries.  Traditionally, the practice entailed killing fertile salmon and hand-mixing eggs and male milt, or sperm, then raising the offspring packed in containers or pools. When they were old enough to fend for themselves, they were released to rivers or sometimes trucked or ferried to release points to find the ocean on their own.  This practice gave them a necessary transition before they hit saltwater and a semblance of the quintessential salmon experience of migrating to the sea and back. To that end, they eventually swam back to hatcheries, where they became the next breeders in the cycle.  While hatcheries have helped propagate the species, they have also created new problems. The salmon they produce can be inbred and less hardy through domestication, hurting their chances for surviving and thriving in the wild.  Dr. Garza hopes some high-tech ingenuity can help fix the salmon’s troubles. When the fish return to a hatchery, scientists there separate them into individual tubes, clip their fins, then Fed-Ex the tissue samples to Dr. Garza and his team. They then analyze each salmon’s DNA, and match breeding pairs that have no genetic relationship to each other.  The goal is to avoid breeding siblings or cousins, a break from traditional methods of breeding the biggest fish (thought to be strong) without knowing if the fish were related. At some smaller hatcheries, 50 percent or more of salmon are inbred, Dr. Garza’s work has shown.  “We’re not trying to create the biggest, best, most productive fish,” said Dr. Garza, 51, who runs the molecular ecology and genetic analysis team for the National Oceanic and Atmospheric Administration.  Those traditional methods led to homogeneity rather than the diversity that makes a species more able to survive myriad challenges in nature, including predators and disease.  “We’re trying to mimic what’s going on in nature,” he added.  His tactics, first used a decade ago and now used to breed half a million offspring each year, inspire strong reactions, and hopes, in the passionate community of scientists, environmentalists and commercial fish experts eager to see the species preserved.  Underscoring the value of Dr. Garza’s input, and of the genetic tools, he is one of only a few people who consult with all 11 major hatcheries in California.  “Carlos may hold the keys to the future,” said John McManus, the executive director of the Golden Gate Salmon Association, an advocacy group for commercial and recreational fisherman. Perhaps the technology, Mr. McManus said, can be expanded from a small subset of conservation hatcheries that focus on the most endangered species to the bigger facilities relied upon by the fishing industry and “infuse wildlike diversity back into hatchery production.”  But others question whether the mating service is just another misguided step down a primrose path of human intervention. It is hubris, skeptics say, to think that natural selection can be recreated through technology.  “It’s a question of how much playing God will actually work,” said Peter B. Moyle, a distinguished professor emeritus of biology at the University of California, Davis.  “Anytime you get tech solutions to natural problems,” he added, “it seems to me you wind up in trouble in the long run.”  According to a Garza family story, Carlos was 4 years old when he first said he wanted to be a scientist. But he would face several major detours as a child.  He, his younger sister and his mother lived in a rough Philadelphia neighborhood. Stubborn, angry and without his father around, Carlos battled gang members, and wound up requiring the intervention of social services.  Life did not improve much when he was 13 and the family moved to San Diego. Carlos was kicked out of middle school for insolence and then dropped out of high school because of a lack of interest, clashed with his family and left home when he was 15. His sister, Mariel Garza, now an editorial writer for The Los Angeles Times, thought “he’d be a bum of some variety,” she said with a laugh, knowing he is anything but.  Reviving his childhood dream of becoming a scientist, he attended community college, then the University of California, San Diego, where he graduated magna cum laude. He began researching monkeys in Thailand in 1990 — “the dawn of molecular genetics,” he said.  He earned his Ph.D. from the University of California, Berkeley, in integrative biology. When he took a job at NOAA studying fish in 1999, he remembered his Berkeley classmates being surprised he chose a job so practical, so applied, as some scientists who favor theoretical work say with derision.  Dr. Garza did not care much about fish. “Maybe to eat,” he said. But he did like solving real-world problems, even one involving the debate about salmon. “It’s not for the faint of heart,” he said, adding: “I grew up in that kind of environment.”  Dr. Garza summarized the disagreement as one between what he called purists and pragmatists. Purists want to see the tiny remaining population of wild fish segregated from hatchery fish so that a native group can thrive; pragmatists believe such segregation is impossible because of habitat loss and the fact that hatcheries have already created genetic commingling. Once the hatchery fish are released, the pragmatists say, you cannot control where they swim, making segregation unrealistic.  The West Coast hatcheries, and the debates they inspire, date to the early 1870s. In 1875, Spencer Fullerton Baird, the first leader of the United States Commission of Fish and Fisheries, wrote to the authorities in Oregon, telling them that the way to preserve salmon was through hatcheries, said Jim Lichatowich, a salmon biologist and historian. At the time, the challenge to the salmon population was twofold: mining destroyed many rivers and the fish were a popular source of protein for pioneers.  “Buy into these hatcheries and you will make salmon so abundant you won’t need to regulate the harvest,” Mr. Baird wrote in the letter, according to Mr. Lichatowich’s description of its key message.  Was that prediction accurate? “Not by a long shot,” the historian said.  Early hatcheries collected eggs from riverbeds, hatched them and released months-old fry. “They did that until, in some cases, the stream ran out of fish, and then moved on,” Mr. Lichatowich said.  In some cases, fish were released hundreds of miles from their native streams. The fry lived in pools — early farms — over which a dead cow’s head was hung. Maggots would collect to devour the carcass, fall into the water and become salmon food. It was the beginning of another self-defeating act: It taught hatchery fish to wait for food to drop from the sky, and short-circuited instincts that the shadows from above might be predators. Finally, in other cases, fish were picked at random to spawn, their eggs and sperm mixed in dishes, which led to inbreeding.  As damming and other water diversions reduced the natural habitat, the hatcheries became indispensable. Today, in California, they produce 50 million offspring a year. Even so, the state has less than 10 percent of its historic population of natural salmon, leaving 32 different kinds of salmon and trout in the state as endangered, threatened or at risk, Dr. Moyle said.  But in 2012, Dr. Garza and other scientists wrote a critical report about how hatcheries had done as much harm as good.  Among its key recommendations: Fish should no longer be inbred, a particular problem for the most endangered species because dwindling populations leave few mating choices (and a higher prospect of inbreeding).  “It’s an extinction vortex,” Dr. Garza said, “where inbreeding accelerates the process of decline.”  The story of F12, a female coho, shows the frantic intervention in the life of an endangered salmon.  It began on Nov. 23 when she swam into the trap at the Iron Gate hatchery. Her luck at having made it that far cannot be overstated. Each year, around 75,000 juvenile coho are released from the hatchery, which is at the base of a dam on the Klamath River. On their swim to the ocean and back, the coho face predatory birds, dry stream beds and disease. Most years, around 900 return in the coho salmon run. This year, fewer than 100 did.  By the time F12 reached the trap, her time was running out. Female salmon, once they are ripe to spawn, typically drop their eggs in the gravel, then die within days. On the Monday morning when F12 was plucked from the trap, Ms. Chesney, the biologist, worked quickly. She clipped F12’s fin with scissors, put the sample into a manila coin envelope and, along with clips from eight other fish, Fed-Exed it to Santa Cruz.  In the meantime, F12 was placed in a white tube and left in a round pool. The tube separated her from other fish, each in its own tube, so they would not become mixed up with one another when it was time to breed.  F12’s fin clip arrived at 10:30 the next morning at the Southwest Fisheries Science Center in Santa Cruz. Dr. Garza’s team quickly processed the clip, given F12’s ticking clock. When fin clips arrive, Dr. Garza said, “it pre-empts everything else.”  In a lab with some $2 million of equipment, Libby Gilbert-Horvath, a geneticist, put F12’s clip into a solution to break the sample into molecular parts, like proteins and nucleic acids. Then, F12’s molecules were processed by a machine that filters DNA. Next, a technique called enzymatic amplification made millions of copies of F12’s DNA to allow further study.  The next morning, Ms. Gilbert-Horvath used technology that allows fluids to be studied at a nano scale; in this case, it let the team identify markers at 96 of F12’s individual gene sites. This technique, which Dr. Garza developed, allows individual fish to be DNA fingerprinted. Finally, F12’s DNA was compared with that of the Iron Gate males to see which made the best breeding partners.  At 5:07 p.m. on Nov. 25, the results were emailed to the hatchery. Because of the Thanksgiving holiday, the breeding did not happen until Monday, Nov. 30. It was, in Ms. Chesney’s words, “not romantic.”  F12’s tube was pulled onto a stainless steel table. Ms. Chesney studied the mating matrix from Santa Cruz while hatchery staff members waited for directions.  “Who’s my home boy?” asked Bobby Cook, a staff member, wondering which males would be spawned with F12.  Unfortunately, several top choices had died in their tubes over the long weekend. The team was nervous. “We just hope they’re alive. This is the scary part,” Ms. Chesney said.  Two matrix-approved males, named 28MN and 17MJ, were alive. Each was pulled from its tube and smacked twice on the head with the mallet.  It was time to breed F12, who now hung by her gills, dead, on a hook. Mr. Cook stuck a needle into her side. This device forced air through F12’s body and caused bright orange roe to spill from her vents, about 1,500 eggs. Mr. Cook divided them into two trays. Another staff member picked up each dead male and squeezed milt into the eggs. The dead fish were tossed on a conveyor belt for further study.  “It’s a slaughterhouse,” said Morgan Knechtle, the lead biologist at Iron Gate, though he said the genetic sequencing tools provided a sharp contrast. “In many places in the world, this level of technology is not provided to humans.”  It was a bittersweet day for the team. The good news was that it had spawned four females, but, unfortunately, no new salmon returned to the trap.  “That’s a run, folks,” Mr. Cook said as the trap came up empty.  But Mr. Knechtle said he thought it would have been worse without the salmon matchmaker, maybe only 50 coho over all, rather than the 100 they had seen.  Dr. Garza said he saw a bright future for this process. He wants to use genetic tools at large hatcheries — not to dictate every mating but to get DNA fingerprints and then track every hatchery fish from birth to death. That way, he said, the hatcheries could deduce which spawning and management techniques led to healthier fish.  Others agreed that there was no choice but to put these powerful technologies to work. (They are also used in Idaho, Maine and Washington.)  “I know it’s disheartening to people who want this kind of pure fish that exists without us getting in the way of it doing its thing,” said Jeanette Howard, the associate director of science for the Nature Conservancy of California. “But we’re too far away from that.”  “It’s the best chance for saving this species,” she added of Dr. Garza’s method. “He’s created a great scientific enterprise.”  But Dr. Moyle, from the University of California, Davis, said that while he marveled at the technology, he feared that this may be another technological fix that could create its own unforeseen problems.  “We think we can do better than Mother Nature,” Dr. Moyle said. “You wind up getting hooked on that system.”  A version of this article appears in print on January 17, 2016, on page A1 of the New York edition with the headline: To Save Its Endangered Salmon, California Turns to the Genetic Matchmaker . Order Reprints| Today's Paper|Subscribe
At a hatchery on the Klamath River, biologists are using genetic techniques to reduce inbreeding, though some argue natural methods are more effective.