The test itself only takes about a day to run if you have all the required reagents. But shortages and shipping logistics can easily add days or even weeks to get a result. (This is, in fact, already happening, but more on that later.) Let’s start with what should happen:

The very first step is collecting a sample. Using a sterile soft plastic stick, health care workers swab the inside of a patient’s nose or back of the throat. The goal is to collect material that’s recently been in the lungs, where the virus is believed to replicate. That stick then gets sealed up and shipped in a cold container to the testing lab. The sample has to stay between 35 and 40 degrees Fahrenheit, and if it’s not processed within four days it either goes into a freezer or gets thrown out.

Once in a lab, the first step is to separate out the RNA from everything else in the sample–human cells, proteins, enzymes that would chew up that viral genetic code. This is called RNA extraction. If you’re doing it by hand, this process usually involves adding chemicals and centrifuging the sample so the RNA winds up in a different layer from everything else. Several large biochemical suppliers make kits with everything you’d need to RNA extraction. There are also automated machines that do it, too.

Once the RNA has been purified, the next step is to add the reverse transcriptase enzyme that converts it to DNA–going from one strand to two. Then the DNA goes into a test tube along with batches of loose nucleotides, a DNA-building enzyme, and short synthesized DNA fragments called “primers.” These primers have been designed to find and bind to specific segments of the viral genome. In other words, they should, if they work right, recognize and amplify only genetic material from the virus, and not from anything else that might be in the sample, like human or bacterial DNA.

This all happens inside a PCR machine, an instrument that runs coordinated temperature cycles. As it heats the tube, the DNA’s double helix separates into two strands, exposing each side. When it subsequently lowers the temperature, the primers lock onto their targeted segments of the exposed DNA. The enzyme uses these primers as a starting place and begins building complementary strands of DNA according to the exposed sequence. About five minutes later, where once there was one strand of DNA, now there are two. After 30 to 40 cycles of this process, a single copy of DNA multiplies to hundreds of millions. That’s enough DNA that scientists can begin to detect it.

They do that with a fluorescent dye that is added to the test tube during the PCR amplification phase. It only glows in the presence of DNA. As the number of copies of DNA increases, so does the amount of light emitted. A special light-measuring instrument inside the PCR machine then reads out these fluorescence patterns to determine which samples have the virus in them and which don’t. “If there’s coronavirus in your sample, then its RNA will be transcribed into DNA and amplified along with a fluorescent signal that tells you if the test is positive or negative,” says Mansky.

Read all of our coronavirus coverage here.

Creating Protocols

What’s important to remember about RT-PCR is it’s not one test for one virus. It’s a method for identifying specific genetic sequences used in academic, commercial, and public health labs around the world. And the exact recipe scientists follow to get trusted results–which RNA extraction kit, which PCR machine, which primers–can vary. These recipes are referred to as “protocols.”

When a novel disease like Covid-19 emerges, universities, national research institutes, and public health organizations like the US Center for Disease Prevention and Control are usually the first to produce RT-PCR protocols. They have the biosafety labs to handle deadly new pathogens, including the ability to grow them–a crucial step for validating any tests. Once those agencies have a working test, they can deploy it to local public health labs and hospitals. Eventually, if the outbreak sticks around, commercial labs and diagnostic companies will produce their own tests, which may or may not require the same amount of expertise and manual lab work.