While more research needs to be done before the test is ready for widespread use, he applauded the effort. “If people don’t push the envelope like this, then we won’t get there,” Dr. Gray said.

About one in 20 babies in newborn intensive care units has a genetic disease, and all too often, no one can figure out what it is. Scientists identified the faulty genes for about 3,500 of 7,500 known genetic diseases, said the paper’s authors, adding that about 500 have treatments.

To test their method, the investigators tried it with two babies whose disease had been diagnosed only through an autopsy. They quickly found the genetic causes. Then they tried the method on four babies who were seriously ill with suspected genetic diseases, including the baby with seizures. They quickly found the mutated gene in three of the four.

The investigators also sequenced the DNA of an older brother of one of the babies who had the same genetic disorder — his organs were reversed. His heart was on the right, instead of the left, for example. This caused a heart defect that was corrected by surgery. The parents had been told the child had a condition that would not happen again.

Then their second baby had the same problem. The researchers found a new genetic defect, never seen before, that they suspect was the cause. They contacted doctors and discovered more than 100 other children with the same unexplained defect. Now the investigators are checking to see if some have the mutation, which would indicate it caused the problem. Then the parents could know of a prenatal diagnosis for future pregnancies.

The baby whose disease remained a mystery was another of Dr. Petrikin’s patients. When he was born, some skin was missing over his eyebrows and in patches on his scalp. Over weeks, he developed severe blistering, eventually losing nearly all the skin in his mouth and on his body and dying of an infection.