Ever have a nice meal at a fancy restaurant, plop down $75 for a seafood dinner, then get home and open the container of leftovers to see worms wriggling out of your fillet? Maybe (hopefully) this has never happened to you. But the current commitment to local, wild, and unprocessed seafood may be making that more likely.

"I got sea bass and just looked at my leftovers and THEY ARE CRAWLING WITH WORMS ALIVE WORMS." Even without the text in all all caps, it was clear from the midnight text my friend, a local food writer, was freaked out—freaked out enough that she called a medical hotline which recommended she go to the emergency room. The videos she sent me of the squirming, blood-red worms, three of them, were gross. No doubt.

This wasn't from some shack serving black market bass plucked from a slough. This was a meal at one of Portland's top restaurants listed in every major media's "best of" edition. And the fish was purchased from one of Portland's top fish purveyors selling to Portland's most highly regarded restaurants.

"There are parasites in almost every kind of fish," one of Portland's top fish purveyors, who sold the infected fish and wishes to remain anonymous, told me. "What I provide is as fresh as can be. It comes straight from the ocean to the restaurant."

"I don't eat raw fish because of what I've seen," admitted the fish purveyor, who sells to many of the city's top restaurants. "I don't eat sushi anymore."

The worms—nematodes called ascarids—are relatives of hookworms, pinworms, and even trichina worms, the parasite responsible for trichinosis. They are killed by freezing at a temperature of -4 degrees Fahrenheit for at least seven days, or by heating to a temperature of 145 degrees for at least 15 seconds.

You'd think cooking would destroy the parasites. But destroying the nematodes at 145 degrees is like cooking a burger well-done. As Harold McGee explains in On Food and Cooking, "most fish shrink at 120 degrees and begin to become dry around 140 degrees." He places the ideal cooked temperature for most fish at around 130 degrees, but notes that "some dense-fleshed fish, including tuna and salmon, are especially succulent at 120 degrees." That's far short of the temperatures needed to kill the worms. Perfectly cooked fish, like a perfectly cooked burger, means taking a risk.

Oregon requires that most fish served raw in restaurants be frozen first. But even then, fish that's been frozen and is served raw—from sushi to ceviche—must be accompanied by a warning on the menu by law. People who are more susceptible to getting ill from parasites, like residents of nursing homes or children, are not recommended to be served raw fish. Sorry kids, no sashimi-based healthy lunch initiative for you.

And even then, neither freezing or cooking can keep the worm out of your fish; it just means that you'll eat dead worms instead. One commercial strategy is to "candle" the fish, which means placing a bright light under a fillet so that shadows from the worms are visible. It's like a low-tech X-ray. The worms can then be removed or the fish discarded.

"I urge people not to cook whole fish because the parasites can hide in the head and gills," explained that same fish purveyor. "At home, I fillet them right away."

The most effective preventative method, though, may oddly enough be the use of farmed fish. Parasites enter the fish through interaction with an external ecosystem, but farmed fish are segregated from the wild by nets or tanks. Plus, they're fed pellets that are treated for parasites.

In one study from Norway comparing wild, farmed, and hatchery cod, the prevalence of parasites was lower in the latter two groups. This was especially true of nematodes. In another study from Denmark, some wild species of fish—like hake, herring, and mackerel—had an infection rate over 90 percent, but the study found no farmed fish to be infected with nematodes..

This challenges the conventional foodie wisdom that wild is good and farmed is bad. But the science is clear, and food regulators recognize this. Both the Food and Drug Administration's recommendations and Oregon's food regulations allow an exception for eating raw, never-frozen farmed fish. In other words, it says that all raw fish served in restaurants must be previosly frozen unless aquacultured.

I talked to Ryan Roadhouse, chef-owner of the lauded Japanese restaurant Nodoguro and former sushi chef at Masu, about the incident with the worms. "My wife isn't from the United States," he said. "She's from Russia. The only way they trust fish, even frozen, is [if it's] salt-cured."

"There are usually trade-offs," observed Chef Roadhouse. "There is a common sushi fish, hirame, a kind of flounder. Most people are using wild East Coast flounder. That's the gold standard. But those worms are very much a reality with that fish. They can definitely be in there. No pun intended, but it opens a big can of worms." To avoid dealing with the parasite issue with hirame, he buys farm-raised fish from Korea as an alternative. "The fish is pristine," he said, "and one of the cases where you'd be better off with farm-raised than wild." Chef Roadhouse also said he's seen a lot of problems with wild Oregon black cod used for the buttery, miso-glazed dish everyone loves at Japanese restaurants.

The trade-offs in eating farmed fish may often be more ideological than scientific, but there are legitimate concerns about its use of antibiotics, its effects on wild fish populations, and the pollution it creates, among others.

"A lot of times fish that are farmed are dyed and treated," that same purveyor noted. She also worries about the quality of life for the fish, including "the space they're kept in, the way they're treated."

"I dory fish, a dying occupation," said the purveyor. "So many places are focused on price, and I'm trying to bring back local, sustainable fish. It would be sad to lose the traditions—and the quality, too."

There is also the issue of taste.

If we moved from wild fish to farmed fish, or even only served frozen fish, the fish purveyor suspects, "we would lose the quality of fresh seafood. The texture and the taste of fresh fish is better. Even when I freeze it myself, it doesn't taste as good as when it was fresh."

I talked with the chef who served my food-writer friend her wormy bass. (I promised to keep the chef anonymous). He had already reimbursed my friend for her meal, and was moderately apologetic, but worries about losing wild fish from Oregon menus. "Will quality suffer? Of course," he said. "We all know that cheese is better at room temperature, but the health department wants it refrigerated." Unless you want to eat irradiated food sprayed with poisons," he continued, "you have to be willing to accept some risk." The risk of worms in fish, he explained, was no different than the risk of a grub or bug in organic lettuce. Ultimately, he is resigned to whatever the health department requires.

The issue may also be more pressing with climate change and our hot El Niño weather. Parasites such as nematodes have been shown to increase in fish as the water gets warmer. Where the purveyor fishes at this time of the year, the water is normally 52 degrees. "Last week it was 61 degrees."

Chef Roadhouse is optimistic. He thinks whether the balance tips towards wild or farmed, frozen or fresh, that "you evolve and it makes you better." He's been in the restaurant industry for 22 years. "I've seen so many changes: the FDA, the health department, types of fish coming in. And I don't really worry about them, it just makes me more innovative as a fisherman."

Still, this may be an issue that's more about squeamishness than safety. Of the 20,000 cases of nematode infection from eating fish reported globally, over 90 percent of them are in Japan. It's estimated there are only 60 cases annually reported in the United States. By comparison, there are approximately 20 million cases of norovirus in the United States each year, leading to over 500 deaths.

Perhaps we should be less worried about the bugs we see than the ones we can't.