The hydroxychloroquine saga shouldn't erode public trust in science - though it should serve as a reminder not to take any individual scientist or study too seriously.
Science in the long haul is self-correcting, which is why we have laser surgery and space stations and telescopes that see to the dawn of time. It never finds absolute truth, and it sometimes trips, but it can right itself and move on.
After United States President Donald Trump touted hydroxychloroquine as a "game changer" in March, the drug became the centre of a political battle that led to retracted papers, lawsuits and even death threats. It's also now the most widely studied treatment for Covid-19.
It all started with a small French pilot study that yielded intriguing results, which sparked some scientific interest. It may have ended earlier this month, when scientists announced that a large controlled trial of hydroxychloroquine showed no benefit.
Though that study has yet to be published in a peer-reviewed journal, experts said the study was credible enough to stop further research on the drug for treating advanced cases of the disease.
Studying this drug for Covid-19 wasn't crazy. The related compounds, chloroquine and hydroxychloroquine, had been proved safe enough to be prescribed routinely for malaria, lupus and other conditions. And they do kill viruses, including Sars-CoV-2, in a test tube at least.
Hydroxychloroquine had also been tested against dengue fever; while it didn't appear to help, it seemed reasonable to try it against the new coronavirus.
However, there were early red flags. The drug can interfere with the so-called innate immune system, says rheumatologist and biotech founder Arthur Krieg. The drug interferes with a pathway by which the body senses invading viruses and sends in a first line of attack - compounds called interferons.
The drug's potential to dampen the immune system wasn't widely appreciated, says Dr Krieg, who told me he contacted Dr Anthony Fauci and people at the US Food and Drug Administration about his concerns. That didn't bode well for people taking the drug to prevent infection after possible exposure, as Mr Trump claimed he was doing late last month, and others were doing as part of a clinical trial.
Dr Krieg says his fears were allayed when a new study in The New England Journal of Medicine concluded there was no protective effect, but also no obvious harm.
The death threats followed a study that focused on already ill patients. A group of researchers studied chloroquine's effect on patients in Brazil, Spain and Mozambique, but had to halt the trial early after they saw signs of potential toxicity - including heart arrhythmias.
The trial used no placebo, but compared patients getting a high dose with those getting a lower one, and saw more deaths and signs of heart problems in the higher dose group. (That dose was within the range considered safe for other illnesses.) Soon after the authors posted an unpublished preprint of their results, they got death threats and were sued, according to a news report in The Lancet.
They were allegedly attacked by conservative bloggers and social media users, including Mr Eduardo Bolsonaro, the son of Brazilian President Jair Bolsonaro.
The results of the trial were later published on April 24 in the Journal of the American Medical Association.
More controversy followed when another study was retracted this month. It was not a controlled trial but an analysis of data from different hospitals' electronic health records. The researchers claimed to have a huge set of data - 15,000 patients getting the drug under emergency authorisation and 81,000 control patients who didn't get the drug. That study's conclusion, published in The Lancet on May 22, was that the drug failed to help patients and might have killed a few by causing heart arrhythmias.
Soon, critics started to raise serious doubts about the validity of that data, which had been supplied by a private company called Surgisphere. Problems included an erroneous overstatement of the number of deaths in Australia, among other things. The lead researcher asked The Lancet to retract the paper when Surgisphere couldn't supply the data for an audit.
Surgisphere data was used in another big study that was retracted at the same time - one published in The New England Journal of Medicine allegedly showing that certain commonly used blood pressure medications did not increase patients' risk of death from Covid-19.
More on this topic
Harvard medical professor and bioinformatics expert Isaac Kohane says he and his colleagues were surprised by the data set. He's been using electronic health records too, as part of a sprawling collaboration across dozens of hospitals. They are trying to gather clues as to why some patients get so severely ill, why some die, and how to predict and avoid those deaths. It's slow, painstaking work, he says, so he was surprised that Surgisphere, a company he'd never heard of, pulled off a "Herculean" feat of data collection from so many thousands of patients in such a short time.
He said he's worried that the retraction will reflect badly on good data science, which he considers vital for finding side effects of drugs or devices that don't always show up in clinical trials, and for learning on the fly during a fast-moving pandemic.
"There are a lot of challenges with observational data, but when used correctly, they can be incredibly helpful," he says.
Did the political leanings of the authors and journal editors, or some enthusiasm for putting Mr Trump's claims to rest, lead people to overlook obvious flaws in the data?
Perhaps some scientists are emotionally tied to the idea that anything Mr Trump said must be wrong. That's not rational - but neither is the insistence on the part of some conservatives that the retraction of The Lancet study shows the drug does work after all. A retracted study cannot prove a drug is safe.
More on this topic
The death rate from Covid-19 has become a political issue as well. Some researchers doing widespread surveys reported very high rates of past infection and, proportionally, a lower death rate, which some people interpreted as reason to treat this disease more like influenza. Others attacked the findings as motivated by a vested interest in preserving the economy.
In the end, deciding how to tackle the pandemic isn't a purely scientific question. It should be partly a political process, in that citizens of a democracy should have a say in how to balance risk and the need for normal economic activity and life.
We can disagree about where to draw that line, but everyone should be working with the same facts - even if sometimes, it takes a little while to agree on them.
• Faye Flam is a Bloomberg Opinion columnist. She has written for The Economist, The New York Times, The Washington Post, Psychology Today, Science and other publications.
We have been experiencing some problems with subscriber log-ins and apologise for the inconvenience caused. Until we resolve the issues, subscribers need not log in to access ST Digital articles. But a log-in is still required for our PDFs.