Dr. William Shearer, who treated the so-called bubble boy — a youngster isolated from birth in sterile plastic cocoons because he lacked a functioning immune system — through the last years of his short life, died on Oct. 9 at his home in Houston. He was 81.

His wife, Lynn DesPrez, confirmed his death. She said he had polymyositis, an inflammatory disease that causes muscle weakness.

Dr. Shearer, a pediatric immunologist, was a professor of pediatrics at Washington University in St. Louis when he was hired in 1978 by Texas Children’s Hospital in Houston to take over the case of David Vetter, a bright-eyed 7-year-old with severe combined immunodeficiency, or SCID. David had by then been living in a series of bubbles that guarded him against exposure to bacteria and viruses, which would have probably been fatal.

In their first meeting, David “immediately put his arms in the gloves extending from his plastic isolator system to shake my hand,” Dr. Shearer wrote on the hospital’s blog in 2011. The boy then peppered him with questions to see if he was competent to care for him.