Detecting life-threatening infections is hard for doctors to do. An infected heart tumor, for example, requires examining chest X-rays of patients over days or weeks. New genomic diagnostics that aim to diagnose and quickly control deadly infections, like sepsis, could make diagnosing it possible with a simple scan, as well as provide immediate treatment options.

Sensational data from commercial genetic-testing services shows that many people are infected by bacteria but not realizing it. Only half the times, according to an analysis of data from the Centers for Disease Control and Prevention’s Healthcare Cost and Utilization Project, do people attend a lab and get tested for bacteria or antibodies to fight it.

That’s not going to work, according to Scott Krinsky, the director of the Advanced Genomics Institute at Case Western Reserve University in Cleveland.

“People need to understand that we’re dealing with microorganisms that live forever,” he said. “These aren’t organisms that die easily.”

The reasons for the lack of tests vary, but nearly all people have different bacteria inside their bodies. In addition, many of these bacterial cells will keep the same DNA structure and cause different diseases if they infect the same organ.

In the case of a heart tumor that can spread to the brain, for example, a genetic test would show the type of bacteria that caused the infection but not show which parts of the brain the bacteria invaded.

The reason these bacterium-detection tests are difficult to do, however, is because they are based on DNA sequences that are easily mutable. When asked about this, Paul Wenger, vice president of systems science at Illumina, a maker of gene sequencing equipment, said that often a diagnosis can be made, if treatment is given. But he added that these tests could be done more quickly in the future.

“We’ve built tremendous advances in genome sequencing that can differentiate the DNA sequences associated with sepsis, which can differentiate among hundreds of different organisms,” Mr. Wenger said.

Sensational data from commercial genetic-testing services shows that many people are infected by bacteria but not realizing it.

Some infectious diseases, including bacterial pneumonia, can have wide variations, with zero or one of their proteins causing the infection, so a gene-expression test might also reveal this.

This new approach, however, still has a long way to go. The test currently used to assess sepsis is being delayed and harder to administer than the old-fashioned tests because the length of the diagnostic window is too short, said Eugenia Bosques, chief research officer at the Clinical Center for Genetics and Genomics at the University of Miami Miller School of Medicine. The test does a blood test of naturally-occurring bacterium called Streptococcus pneumoniae, but very few samples are willing to donate it — because, as Ms. Bosques said, it is still not popular to donate blood.

Robert Currie, a professor of pathology at University of California, San Francisco, said he had hoped that gene-expression tests could be broadly available in a decade. It still could be, he said, but he thinks that they will be useful in diagnosis of a rare case, such as a surgical wound that has been infected, or a diagnosis of sepsis with a laceration, because those aren’t likely to be everyday infections. For those, he said, the test might still be useful, because the reaction time would still be long.

In his lab, at the Children’s Hospital of Philadelphia, Michael Smith, the director of clinical research, has been using these genetic tests in an experimental program. He hopes they will be widely accepted one day — and have implications beyond infectious diseases.

“It tells us about the condition of the individual in the event that a patient presents with a mental condition, a psychiatric condition, a neurological condition or a cardiac issue,” Dr. Smith said.