Primer hairpins and secondary structure
A primer is single-stranded, and a single strand can fold back on itself. When one part of a primer is complementary to another part, it forms ahairpin — a stem-loop that can hide the 3′ end and stop the primer working.
Stem and loop
A hairpin has two parts: a stem, where the primer base-pairs with itself, and a loop of unpaired bases between the two arms. Take GCGCAAAAGCGC: the 5′ GCGC is the reverse complement of the 3′ GCGC, so they pair across the AAAA loop — a 4 bp stem with a 4 nt loop.
Why it matters
A stable hairpin competes with the primer binding its intended target. Worse, if the 3′ end is tied up in the stem, the polymerase has nothing to extend from, so priming fails and yield drops. Hairpins near the 3′ end are the most damaging for exactly this reason.
How stable is “too stable”?
Stability rises with stem length and GC content — G≡C pairs have three hydrogen bonds to A=T’s two. As a rough screen, watch for stems of about4+ base pairs, especially GC-rich stems or any stem involving the 3′ end. Short A/T stems near the 5′ end melt easily at reaction temperature and rarely cause trouble.
A heuristic, not a ΔG
Counting the longest self-complementary run is a fast first-pass check — the same idea as scanning a primer pair for dimers. It flags candidates to avoid, but it doesn’t compute a folding free energy. For a thermodynamic ΔG and a hairpin melting temperature, use a nearest-neighbour secondary-structure tool on anything borderline.