When I first met Tina, a woman in her late 20s, she had been seeing mental health professionals for virtually her entire life. “One day I’m energetic and creative,” she told me during one of our therapy sessions, “the next I am aimless, or I cry and feel worthless.” Tina had been diagnosed with depression, borderline personality disorder and even schizophrenia. Doctors prescribed antidepressants and later antipsychotics—but the meds only seemed to make her worse. At first I, too, saw her difficulties through the lens of a psychologist, thinking she had bipolar disorder. But later I noticed that her mood swings were accompanied by symptoms such as a racing heart, nausea and joint pain. So I asked her doctors to do a thorough blood workup.

Finally, after her 30th birthday, a doctor discovered the real cause of her suffering: porphyria, a group of rare genetic metabolic disorders. In people with porphyria, precursors of hemoglobin (the molecule that carries oxygen in red blood cells) called porphyrins accumulate in various body systems, causing symptoms from abdominal pain to depression. The female sex hormone progesterone tends to aggravate the condition, so Tina’s moods followed her menstrual cycle. Because the disorder affects the liver, the body has difficulty processing medication, so drugs often create perplexing new symptoms.