Nearing the end of chemotherapy for breast cancer, I peppered my oncologist with questions about how to prevent a recurrence. Should I avoid soy products? Processed foods? What about alcohol? I’d been surfing the Internet looking for information.

My doctor gently interrupted and said plainly, “If you want to prevent a recurrence, you need to get your weight into a healthy range and get an hour of vigorous exercise every day.”

I’d once been a runner. I ran as many as 40 miles a week and competed in races as long as 10 miles. But over the years, work, parenthood and home obligations had taken their toll, and I could no longer devote the time I once had to my own fitness. Eventually, I started commuting to work by bike. It was the most convenient way to get exercise but the first thing to be sacrificed when the schedule was too full. Still, when I was able to ride, it allowed me to continue to maintain my identity as the athlete I’d once been.

Then, in January 2009, at age 45, I was given a diagnosis of cancer. I had a mastectomy and went through six rounds of chemotherapy for Stage I invasive ductal carcinoma. For the six months between my diagnosis and the completion of chemotherapy, I didn’t get on the bike or do any other real physical activity. During chemo, I gained 20 pounds, which I was told wasn’t unusual.

As my oncologist spoke, I thought of the commuting bike, purchased two months before my diagnosis, gathering dust under the basement steps. There was virtually nothing I could control about the nightmare of my cancer, I thought. But give me one thing that I can take charge of, that I can do — that I love to do — and I’m going to ride as if my life depends on it.

Recent studies confirm my oncologist’s advice. A study published last fall in the journal “Cancer” found that obese survivors of certain types of breast cancer were 40 percent more likely to have a recurrence than survivors whose weight was in a healthy range. Even women who were overweight but not obese were more likely to experience a recurrence. In 2005, the Nurses’ Health Study found that breast cancer survivors who exercised as little as three hours per week after diagnosis experienced a lower risk of a fatal recurrence than survivors who did not exercise.

So I began to exercise just days after my last full chemotherapy treatment. (Under my regimen, I continued to receive infusions of Herceptin, a therapy for a certain type of breast cancer, for eight more months.) My return to the bicycle was accompanied by an urgency and seriousness of purpose that I’d lacked before. At the beginning, I felt as if I were starting from scratch. I rode slowly and got tired quickly. But I was patient, telling myself I was in it for the long haul. I settled into a mixed-mode commute — 12 miles round trip by bike, the rest by train — two days a week. I rode my bike for short trips and errands. In a gesture of defiance, I rode to and back home from one of my last chemotherapy appointments.

Gradually, this routine gave way to a bicycle-only commute, 29 miles round trip. And two days per week became three, which led to four, and then some riding on the weekend, too. I shed 35 pounds. Riding became a refuge; two hours of daily solitude in a life that was hectic and sometimes sad. It was a chance to get lost in thought or in no thoughts at all (sometimes, just to get lost). It became second nature. It made me feel healthy even as I harbored doubts about whether reality matched the brave front I put up.

Some women are empowered by a cancer diagnosis, but I was not. I only felt vulnerable. While I trusted the medical professionals caring for me and the treatments I received, I found my role to be unsettlingly passive. Cycling allowed me to be an active participant in my treatment; it gave me agency in my recovery.

I made other changes in my lifestyle, too. My oncologist assured me I could continue to eat soy and drink alcoholic beverages in moderate amounts. I became more deliberate about my eating habits, with an emphasis on fresh fruits and vegetables, whole grains and lean proteins.

Almost four years have passed since I finished chemotherapy, and I am still cancer-free. I am taking a five-year course of tamoxifen, which blocks the effects of certain hormones, to help prevent a recurrence. Riding has continued to be a refuge and an inspiration to challenge myself. I ride about 600 miles per month, most of it commuting. I have completed several centuries (100-mile rides) and a few local events.

I’ve realized my goal when I started bike commuting. By using my bike to get groceries, go to and from work and do many other things I need to do, I can maintain my fitness while going about my life. My well-being is the priority it always should have been.

I have a well-rehearsed answer when someone asks, “Is it safe?” Eighty-five percent of my commute is on a protected trail or bike lane. After all these years, the urban drivers and I know each other well and have long since made peace with our imperfect coexistence.

Really, I just want to reply, “How is it safe not to?” I’m a human being, a living creature. I wasn’t meant to be passive. I was meant to be out in the world, to move, to power up a hill panting, to go flying down the other side as if ready to take flight, to feel the hot sun beating down on my back, to gingerly brace myself against a fierce crosswind on a dark, frigid night and to overcome the tedium of thousands of pedal strokes over the same route, day after day, by making it transcendent. To do more than exist — to live.

Elizabeth MacGregor is a lawyer in Washington.