How to analyze the 'secondary structure' of your oligos
When designing oligos, there is some ambiguity about whether you want a high or a low Tm, and exactly what region of the molecule to look at, and what tool to use for the calculation. And...it's complicated, but I'll lay it out here as to what is what and how I recommend thinking about it. First, let's disambiguate the term Tm, because there are 3 equally important but different Tm values for the types of oligos you're designing in these tutorials. I'm going to call them the "self-Tm", the "Initial-Round Tm", and the "Later-Rounds Tm". Before we dig into those, let's define Tm which is also explained here. In a nutshell, the Tm is the temperature at which half the molecules are in one state, and half are in the other. That may not be physicochemically kosher, but it's close, and it's a sufficient way to describe things to explain what's going on. Now, the two states in question are different in the three different Tm's for our oligo, but in each case they correspond to two competing secondary structure forms, and a higher Tm means the structure in question is more stable, and lower means lower.
The Self Tm
The self Tm refers to the equilibrium between a DNA oligo that exists in a fully denatured (no Watson-Crick base pairs) and one that is annealed with either itself or other molecules of its own sequence:
Now, the duplex in the illustration looks like normal DNA duplex as we've discussed before. However, in this case, the oligo is annealing to another of its own kind rather than to some template molecule. For both hairpins and duplexes, these are undesirable states for most molecular biology operations because they compete with the template for binding. So, you want the 'self Tm' (which basically is the Tm for whatever is the most stable self-secondary structure) to be low, meaning 'not a particularly stable state'. In practice, other design heuristics we use such as balancing GC content, avoiding homopolymeric runs, and so forth have the desirable side-effect of eliminating this type of secondary structure (often, but not always). So, personally, I very rarely check the self-Tm of oligos, and I do not recommend you worry about it unless you cannot make a 'normal' oligo for the task at hand. Under those circumstances, try your best to keep it below 40°C. It is definitely not the case that higher self-Tm values will cause PCR to fail--I've done PCRs successfully with 80°C self-Tm. However, really bad self-Tm is definitely something that can cause a PCR to fail. So, if you have a really long oligo or an oligo with a weird sequence, you might check this.
But what region of your oligo to test? The whole thing? The annealing region? Wait a second and think about it, then read on. The answer is the whole thing, but the reason why is complicated. First of all, all you really care about is secondary structure that occludes the annealing region of your oligo, typically the 3' most 20bp. So, why not just look at those 20bp? Well, because most likely what that 20bp will hairpin with (that can often be easily fixed) is the 5' tail you added or a GC-rich recognition site that you tacked on. Those you'll only catch by looking at the entire sequence's Tm. If the most-stable structure involves a hairpin that is in the annealing region itself, well, you'd catch that one however you run the test.
Tools to check self-Tm You can't actually use ApE (please send me an email if you've found this functionality in there). Back in the day, I would use a program called oligotech. It was a bare bones .exe kind of thing. The IDT website has a tool that can do all of the above analyses. The 'Hairpin' and 'Self-Dimer' buttons correspond to the two cases outlined here.
Initial Round Tm
Now, these general considerations about oligo design apply to all types of oligo-based molecular biology operations, but the usual scenario is you're doing some PCR thing. So, I'll focus on PCR here. In PCR, different things are happening during the first 2 cycles than what happens during the later 23 cycles or so. When the reaction starts its first denature and anneal, there are no 'new' molecules in the pot beyond what you added. You just have a soup of denatured single stranded template and two oligos trying to stick to themselves, to each other, and to different regions of the template molecules. What determines the ultimate efficiency and accuracy of the resulting amplification is largely determined by these initial steps. If the oligos choose to anneal to themselves rather than the template, then the PCR never gets started. If the homology of the oligo is not good enough, it won't sit on the template, and PCR never gets going. So, what we care about is the stability of the complex that would result from annealing the oligos to the template sequence. Now, I don't have a tool in mind for specifically how to calculate this (though I know they exist). In practice, if you keep within the design criteria outlined in the tutorial for designing 'annealing regions', or the 3'-most ~20bp of the oligo, you'll get a good pcr, no worries, and don't even consider the sequence upstream of the annealing region unless you made it crazy long (like 60+ bp oligos).
Often students read that you should match your annealing temperature for the thermocycling program to the Tm of your oligos. I prefer to think of things in terms of mechanism rather than accept them on empiricism, so let me explain what matters differently. If the first rounds of PCR don't happen, you don't get product, so we need to consider the stability of those initial complexes. If your annealing Tm is, say, 55°C, and the annealing region of your oligo has a Tm of 55°C, then at equilibrium under standard conditions, half your oligos are bound to the template and half aren't. Now, in reality, Le Chatelier's principle should screw with this, and though I've never thought though it fully, you probably find out that at the Tm temp things still pretty much are mostly annealed. Also, the 'gook' companies put into the fancy newer polymerases like Phusion could be changing these equilibrium in your favor. Anyway, in the big picture, there's potentially a sharp decline in binding once you get above the Tm of an oligo, but in reality I bet it's more like 5°C higher where you start to see the damage. If you calculate the hetero duplex Tm for most 20bp sequences -- that's what ApE gives you -- you'll find that typically it's in the ballpark of 50 to 55 degrees for a 'normal' annealing region. In many cases, you introduce mutations into the annealing region of an oligo such as during SOEing to remove restriction sites. Why does this still work? Well, somewhere there is an algorithm that can predict the heteroduplex Tm for the 'bubbled' complex resulting from binding a template DNA to an oligo with a 1bp mismatch. You'll find that the energy cost of one bad basepair isn't that high, so these oligos still initiate PCR even though it's not a 'perfect' heteroduplex. What does matter is how close those mutations get to the 3' end of the annealing region. There's a fairly strict polymerase requirement for 6 exact watson-crick base pairs next to the 3' end. So, you need minimally 6bp of match before a mutation, and I usually give it 8+.
Later Rounds Tm (the hetero duplex tm)
Once you have successfully initiated a PCR, you have some new molecules in the cocktail. The new members have 5' ends that are the physical atoms of your oligos, but they have template sequence on their 3' ends. The reverse complement of that complete sequence (with added tails included) will also be within the pool. So, now it's not as hard to initiate a PCR since your oligos match homologous templates exactly over their entire length. The Tm here is thus the heteroduplex Tm for your full length oligo, just as ApE calculates it. You can also get it from IDT website. Now, this Tm is the least useful of the three Tm values discussed herein. Why? It's always good. You typically add about 11 extra bases (at least) to the 20bp annealing region for PCR cloning experiments. Often, the oligos are much longer. At this 31bp, the heteroduplex is typically around 60-65°C, which is really the upper boundary of how high it is useful to go during a PCR annealing step. So, it's going to anneal as long as there isn't some crazy high self-Tm present competing for the oligo's attention.