[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ET5PCMNW12478126WD9RSK":3,"skill-same:01M7ET5PCMNW12478126WD9RSK":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7ET5PCMNW12478126WD9RSK","bio-primer-design-primer-validation",null,"Validates chosen PCR\u002FqPCR oligos for intramolecular thermodynamic liabilities with primer3-py - hairpins, self-dimers, cross-dimers (calc_hairpin\u002Fhomodimer\u002Fheterodimer), and 3'-end stability (calc_end_stability) - returning ThermoResult dG\u002FTm and ASCII structures. Covers why a \"dimer-free\" verdict is a PREDICTION at the supplied salt\u002FMg\u002FdNTP\u002Foligo conditions and temp_c (so the same primer is fine or dimer-prone depending on conditions), why a 3'-END dimer or hairpin is the lethal class (polymerase-extendable into primer-dimer) so structures are ranked by dG at the annealing temperature and 3'-end involvement rather than global Tm, that ThermoResult dG is in cal\u002Fmol not kcal\u002Fmol, and that .structure_found must gate the numbers. Use when checking primer pairs before ordering, troubleshooting primer-dimers or smears, or screening oligos for secondary structure. Genome off-target\u002Fmispriming is primer-specificity; design is primer-basics; probe assays are qpcr-primers.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fdesign\u002Fbio-primer-design-primer-validation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-primer-design-primer-validation\ndescription: Validates chosen PCR\u002FqPCR oligos for intramolecular thermodynamic liabilities with primer3-py - hairpins, self-dimers, cross-dimers (calc_hairpin\u002Fhomodimer\u002Fheterodimer), and 3'-end stability (calc_end_stability) - returning ThermoResult dG\u002FTm and ASCII structures. Covers why a \"dimer-free\" verdict is a PREDICTION at the supplied salt\u002FMg\u002FdNTP\u002Foligo conditions and temp_c (so the same primer is fine or dimer-prone depending on conditions), why a 3'-END dimer or hairpin is the lethal class (polymerase-extendable into primer-dimer) so structures are ranked by dG at the annealing temperature and 3'-end involvement rather than global Tm, that ThermoResult dG is in cal\u002Fmol not kcal\u002Fmol, and that .structure_found must gate the numbers. Use when checking primer pairs before ordering, troubleshooting primer-dimers or smears, or screening oligos for secondary structure. Genome off-target\u002Fmispriming is primer-specificity; design is primer-basics; probe assays are qpcr-primers.\ntool_type: python\nprimary_tool: primer3-py\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"primer-design\u002Fprimer-validation\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: primer3-py 2.3+.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show primer3-py` then `help(primer3.calc_heterodimer)` to check signatures\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Primer Validation -- Thermodynamic Self-Structure of the Chosen Oligos\n\n**\"Are these primers free of dimers and hairpins?\"** -> Predict the most stable intramolecular and inter-primer structures and judge them at the reaction conditions -- because a structure's harm is set by its dG at the annealing temperature and by whether it ties up the 3' end, not by a single global score.\n- Python: `primer3.calc_hairpin(seq)`, `calc_homodimer(seq)`, `calc_heterodimer(seq1, seq2)`, `calc_end_stability(seq1, seq2)` return a `ThermoResult` with `.tm`, `.dg`, `.structure_found`.\n\nScope: thermodynamic validation of the OLIGOS themselves (hairpin, homodimer, heterodimer, 3'-end stability, pair Tm match) under stated conditions. Genome-wide off-target \u002F mispriming \u002F in-silico PCR -> primer-specificity. Designing primers -> primer-basics. qPCR primer+probe co-design -> qpcr-primers.\n\n## The Single Most Important Modern Insight -- A \"Dimer-Free\" Verdict Is a Prediction at the Conditions Supplied, and the 3' End Is What Kills the Reaction\n\n1. **These are predictions, not facts.** `calc_hairpin`\u002F`calc_homodimer`\u002F`calc_heterodimer` compute a dG\u002FTm under a specific monovalent\u002Fdivalent\u002FdNTP\u002Foligo concentration and an evaluation temperature (`temp_c`). The same primer can read \"fine\" at default 37 C \u002F default salt and \"dimer-prone\" at the real annealing temperature and Mg2+. Validate at the conditions and `temp_c` of the actual reaction, or the verdict is decorative.\n2. **The 3' end is the lethal locus.** A dimer or hairpin that pairs the primer's 3' end is polymerase-EXTENDABLE: it gets turned into primer-dimer that amplifies exponentially, consumes reagents, and (in SYBR qPCR) generates competing signal. A structure with a more negative GLOBAL dG but a free 3' end is far less harmful. So do NOT rank by global dG or global Tm -- inspect 3'-end involvement (`calc_end_stability` and the ASCII structure) and judge at the annealing temperature.\n3. **Read the units and the gate.** `ThermoResult.dg`, `.dh` are in cal\u002Fmol (and `.ds` in cal\u002F(K.mol)) -- a value of -6000 is -6 kcal\u002Fmol, so divide by 1000 before comparing to kcal\u002Fmol heuristics. Always check `.structure_found` first: if no structure formed, the `.tm`\u002F`.dg` are not a real duplex.\n\n## The Three Structures, and Why They Differ\n\n- **Hairpin** (intramolecular): the primer folds on itself; harmful mainly when it sequesters the 3' end or raises effective Tm enough to block template annealing.\n- **Homodimer** (self-dimer): two copies of one primer pair; common with self-complementary or palindromic primers.\n- **Heterodimer** (cross-dimer): the forward and reverse primers pair with each other. A primer can be individually clean and still cross-dimer with its partner, so the pair must be checked explicitly -- this is the dimer most often missed.\n\n## Tool Taxonomy\n\n| Function | Citation | Mechanism \u002F role | When |\n|----------|----------|------------------|------|\n| `calc_hairpin(seq)` | Untergasser 2012 *Nucleic Acids Res* 40:e115 | most stable self-fold via thermodynamic alignment (ntthal) | screen a single primer\u002Fprobe for hairpins |\n| `calc_homodimer(seq)` | Untergasser 2012 *Nucleic Acids Res* 40:e115 | most stable self-self duplex | self-dimer of one oligo |\n| `calc_heterodimer(s1, s2)` | Untergasser 2012 *Nucleic Acids Res* 40:e115 | most stable cross duplex of two oligos | forward-vs-reverse (and probe) cross-dimer |\n| `calc_end_stability(s1, s2)` | SantaLucia & Hicks 2004 *Annu Rev Biophys* 33:415 | dG of the 3' end of s1 annealing to s2 | the 3'-anchored, extendable-dimer question |\n| `calc_*_tm` (float) | Untergasser 2012 *Nucleic Acids Res* 40:e115 | the `.tm` only, no structure object | fast high-throughput screening |\n| `calc_tm(seq)` | SantaLucia 1998 *PNAS* 95:1460 | nearest-neighbor Tm vs perfect complement | the pair Tm-match check |\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended | Why |\n|----------|-------------|-----|\n| Standard pre-order check of a pair | `calc_hairpin`\u002F`homodimer` on each + `calc_heterodimer` on the pair, at reaction conditions and `temp_c` = Ta | the four-call panel that catches self-structure |\n| Suspect a primer-dimer artifact (gel, low-Tm melt peak) | `calc_heterodimer` + `calc_end_stability`, read the ASCII structure for 3'-end pairing | 3'-end dimers are extendable; that is the artifact source. A dimer that appears only at LOW template is diagnostic -- with scarce target, primer-primer collisions win the kinetic competition |\n| Screening hundreds of oligos | `calc_hairpin_tm`\u002F`calc_homodimer_tm` (floats) | fast triage; promote flagged ones to full `ThermoResult` |\n| One primer designed with a 5' tail | run the calls on the FULL tailed oligo | the tail exists physically (palindromic sites\u002FGibson arms dimerize) |\n| Pair anneals unevenly \u002F one strand dominates | compare `calc_tm` of the two primers | a Tm mismatch >2-3 C, not a dimer, is the cause |\n| \"Will it amplify only the target?\" | -> primer-specificity | that is genome off-target, a different question and toolset |\n\nDefault when uncertain: run the four-call panel at the real salt\u002FMg\u002FdNTP\u002Foligo concentrations with `temp_c` set to the annealing temperature, flag any structure whose dG is strongly negative at Ta, and weight 3'-end involvement most.\n\n## Validate a Primer Pair at Reaction Conditions\n\n**Goal:** Decide whether a chosen forward\u002Freverse pair will misbehave through hairpins or dimers in the actual reaction, with the 3' end weighted appropriately.\n\n**Approach:** Run hairpin and homodimer on each primer and heterodimer on the pair, all at the reaction's salt\u002FMg\u002FdNTP\u002Foligo concentrations and with `temp_c` set to the annealing temperature; gate every result on `.structure_found`; additionally compute `calc_end_stability` on the heterodimer to expose 3'-anchored (extendable) dimers; compare the two primer Tms for a match.\n\n```python\nimport primer3\n\nfwd, rev = 'GTCTCCTCTGACTTCAACAGCG', 'ACCACCCTGTTGCTGTAGCCAA'\nCOND = dict(mv_conc=50.0, dv_conc=3.0, dntp_conc=0.8, dna_conc=250.0, temp_c=60.0)  # match the qPCR\u002FPCR reaction + Ta\n\ndef flag(label, res):\n    if res.structure_found:\n        print(f'{label}: Tm={res.tm:.1f}C dG={res.dg\u002F1000:.2f} kcal\u002Fmol')   # dg is cal\u002Fmol -> \u002F1000\n    else:\n        print(f'{label}: no structure')\n\nfor name, seq in [('fwd', fwd), ('rev', rev)]:\n    flag(f'{name} hairpin', primer3.calc_hairpin(seq, **COND))\n    flag(f'{name} homodimer', primer3.calc_homodimer(seq, **COND))\n\nflag('heterodimer', primer3.calc_heterodimer(fwd, rev, **COND))\nend = primer3.calc_end_stability(fwd, rev, **COND)            # 3'-end-anchored stability = the extendable-dimer risk\nprint(f\"3'-end stability dG={end.dg\u002F1000:.2f} kcal\u002Fmol\")\n\ndtm = abs(primer3.calc_tm(fwd, **{k: COND[k] for k in ('mv_conc','dv_conc','dntp_conc','dna_conc')})\n          - primer3.calc_tm(rev, **{k: COND[k] for k in ('mv_conc','dv_conc','dntp_conc','dna_conc')}))\nprint(f'pair Tm difference={dtm:.1f}C')\n```\n\n## Reading the Result: dG, the 3' End, and the Structure\n\n`ThermoResult.dg` is in cal\u002Fmol (divide by 1000 for kcal\u002Fmol). More negative = more stable = more concerning. But two structures with similar Tm can have very different dG at the annealing temperature, and the structure's own Tm is just where its dG crosses zero -- so judge by dG at `temp_c` = Ta, not by Tm. Print `res.ascii_structure` (or `res.ascii_structure_lines`) to SEE where the duplex sits: a dimer that pairs the recessed 3' ends is extendable and disqualifying even at modest dG, while a stronger structure with free 5'\u002Finternal pairing only transiently lowers free primer. `calc_end_stability(fwd, rev)` isolates exactly the 3'-end-of-fwd-against-rev stability, which is the right number for \"will this dimer extend.\" It scores the 3' end of the FIRST argument, so check both directions (also `calc_end_stability(rev, fwd)`) -- either primer's 3' end can anchor the extendable dimer.\n\n## Per-Method Failure Modes\n\n### Ranking dimers by global dG or Tm\n**Trigger:** Accepting\u002Frejecting a structure on its overall dG or Tm. **Mechanism:** a weak dimer that locks the 3' ends is extended into artifact, while a strong dimer with free 3' ends is benign. **Symptom:** a \"passing\" pair still produces primer-dimer; a \"failing\" pair amplifies fine. **Fix:** inspect 3'-end involvement (`calc_end_stability`, ASCII structure) and weight it above whole-molecule dG.\n\n### Validating at the wrong temperature\u002Fconditions\n**Trigger:** Using default `temp_c=37` and default salt instead of the reaction's Ta and Mg2+. **Mechanism:** structure stability is strongly condition-dependent; a structure that melts below Ta is harmless. **Symptom:** false alarms (or false passes) that do not match the bench. **Fix:** set `temp_c` to the annealing temperature and pass the real mv\u002Fdv\u002Fdntp\u002Fdna concentrations.\n\n### Trusting dG without a structure\n**Trigger:** Reading `.dg`\u002F`.tm` without checking `.structure_found`. **Mechanism:** when no structure forms the fields are not a real duplex. **Symptom:** nonsense or contradictory numbers. **Fix:** gate every result on `.structure_found` before reporting.\n\n### Unit confusion (cal vs kcal)\n**Trigger:** Comparing `.dg` directly to a kcal\u002Fmol threshold. **Mechanism:** primer3-py reports dG in cal\u002Fmol, so -6000 is -6 kcal\u002Fmol. **Symptom:** thresholds off by 1000x; everything looks catastrophic or fine. **Fix:** divide `.dg` by 1000 before comparing.\n\n### Validating only the binding core of a tailed primer\n**Trigger:** Checking the template-binding portion of a primer that carries a 5' tail. **Mechanism:** the full oligo (tail included) is what physically exists; palindromic restriction sites and complementary Gibson arms dimerize. **Symptom:** clean validation, dimers on the bench. **Fix:** run the calls on the FULL tailed oligo.\n\n## Quantitative Thresholds\n\nThese are FLAGGING heuristics for inspection, not hard cutoffs; they are condition-dependent (salt, Mg2+, primer concentration, Ta). Read the structure and judge at Ta before accepting or rejecting.\n\n| Threshold | Source | Rationale |\n|-----------|--------|-----------|\n| Hairpin Tm at least ~10 C below Ta | SantaLucia & Hicks 2004 *Annu Rev Biophys* 33:415 | a hairpin that melts well below the anneal step is largely denatured |\n| Dimer dG flag if more negative than ~ -6 to -9 kcal\u002Fmol | -- | common practice line; below ~ -9 generally rejected; condition-dependent |\n| 3'-END dimer dG: be stricter, flag ~ -3 to -5 kcal\u002Fmol | Kwok 1990 *Nucleic Acids Res* 18:999 | 3'-anchored dimers are extendable, so weight them above global dG |\n| Pair Tm difference \u003C= 2 C | Koressaar & Remm 2007 *Bioinformatics* 23:1289 | matched Tm so both primers anneal at one Ta |\n| Evaluate at `temp_c` = annealing temperature | SantaLucia & Hicks 2004 *Annu Rev Biophys* 33:415 | dG at Ta, not at 37 C, is the harm-relevant quantity |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| `AttributeError: calcHeterodimer` | camelCase deprecated since primer3-py 1.0.0 | use snake_case `calc_heterodimer` |\n| Validation disagrees with the bench | default `temp_c`\u002Fsalt, not the real reaction | pass reaction mv\u002Fdv\u002Fdntp\u002Fdna and `temp_c` = Ta |\n| A \"clean\" pair still makes primer-dimer | judged by global dG, missed the 3' end | check `calc_end_stability` and the ASCII structure |\n| dG threshold seems 1000x off | `.dg` is cal\u002Fmol, not kcal\u002Fmol | divide by 1000 before comparing |\n| `.tm`\u002F`.dg` look meaningless | no structure formed | gate on `.structure_found` |\n| Pair amplifies one strand only | Tm mismatch, not a dimer | compare `calc_tm` of the two primers; redesign Tm-matched (primer-basics) |\n\n## References\n\n- Untergasser A, Cutcutache I, Koressaar T, et al. 2012. Primer3 - new capabilities and interfaces. *Nucleic Acids Res* 40:e115.\n- SantaLucia J Jr, Hicks D. 2004. The thermodynamics of DNA structural motifs. *Annu Rev Biophys Biomol Struct* 33:415-440.\n- SantaLucia J Jr. 1998. A unified view of polymer, dumbbell, and oligonucleotide DNA nearest-neighbor thermodynamics. *PNAS* 95:1460-1465.\n- Koressaar T, Remm M. 2007. Enhancements and modifications of primer design program Primer3. *Bioinformatics* 23:1289-1291.\n- Kwok S, Kellogg DE, McKinney N, et al. 1990. Effects of primer-template mismatches on the polymerase chain reaction: human immunodeficiency virus type 1 model studies. *Nucleic Acids Res* 18:999-1005.\n\n## Related Skills\n\n- primer-basics - Design Tm-matched primer pairs (redesign if validation fails)\n- primer-specificity - Genome-wide off-target \u002F in-silico PCR (a different question)\n- qpcr-primers - Co-design qPCR primers and probes, including probe self-structure\n- sequence-manipulation\u002Fseq-objects - Reverse-complement and assemble tailed oligos to validate\n","## Version Compatibility\n\nReference examples tested with: primer3-py 2.3+.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show primer3-py` then `help(primer3.calc_heterodimer)` to check signatures\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Primer Validation -- Thermodynamic Self-Structure of the Chosen Oligos\n\n**\"Are these primers free of dimers and hairpins?\"** -> Predict the most stable intramolecular and inter-primer structures and judge them at the reaction conditions -- because a structure's harm is set by its dG at the annealing temperature and by whether it ties up the 3' end, not by a single global score.\n- Python: `primer3.calc_hairpin(seq)`, `calc_homodimer(seq)`, `calc_heterodimer(seq1, seq2)`, `calc_end_stability(seq1, seq2)` return a `ThermoResult` with `.tm`, `.dg`, `.structure_found`.\n\nScope: thermodynamic validation of the OLIGOS themselves (hairpin, homodimer, heterodimer, 3'-end stability, pair Tm match) under stated conditions. Genome-wide off-target \u002F mispriming \u002F in-silico PCR -> primer-specificity. Designing primers -> primer-basics. qPCR primer+probe co-design -> qpcr-primers.\n\n## The Single Most Important Modern Insight -- A \"Dimer-Free\" Verdict Is a Prediction at the Conditions Supplied, and the 3' End Is What Kills the Reaction\n\n1. **These are predictions, not facts.** `calc_hairpin`\u002F`calc_homodimer`\u002F`calc_heterodimer` compute a dG\u002FTm under a specific monovalent\u002Fdivalent\u002FdNTP\u002Foligo concentration and an evaluation temperature (`temp_c`). The same primer can read \"fine\" at default 37 C \u002F default salt and \"dimer-prone\" at the real annealing temperature and Mg2+. Validate at the conditions and `temp_c` of the actual reaction, or the verdict is decorative.\n2. **The 3' end is the lethal locus.** A dimer or hairpin that pairs the primer's 3' end is polymerase-EXTENDABLE: it gets turned into primer-dimer that amplifies exponentially, consumes reagents, and (in SYBR qPCR) generates competing signal. A structure with a more negative GLOBAL dG but a free 3' end is far less harmful. So do NOT rank by global dG or global Tm -- inspect 3'-end involvement (`calc_end_stability` and the ASCII structure) and judge at the annealing temperature.\n3. **Read the units and the gate.** `ThermoResult.dg`, `.dh` are in cal\u002Fmol (and `.ds` in cal\u002F(K.mol)) -- a value of -6000 is -6 kcal\u002Fmol, so divide by 1000 before comparing to kcal\u002Fmol heuristics. Always check `.structure_found` first: if no structure formed, the `.tm`\u002F`.dg` are not a real duplex.\n\n## The Three Structures, and Why They Differ\n\n- **Hairpin** (intramolecular): the primer folds on itself; harmful mainly when it sequesters the 3' end or raises effective Tm enough to block template annealing.\n- **Homodimer** (self-dimer): two copies of one primer pair; common with self-complementary or palindromic primers.\n- **Heterodimer** (cross-dimer): the forward and reverse primers pair with each other. A primer can be individually clean and still cross-dimer with its partner, so the pair must be checked explicitly -- this is the dimer most often missed.\n\n## Tool Taxonomy\n\n| Function | Citation | Mechanism \u002F role | When |\n|----------|----------|------------------|------|\n| `calc_hairpin(seq)` | Untergasser 2012 *Nucleic Acids Res* 40:e115 | most stable self-fold via thermodynamic alignment (ntthal) | screen a single primer\u002Fprobe for hairpins |\n| `calc_homodimer(seq)` | Untergasser 2012 *Nucleic Acids Res* 40:e115 | most stable self-self duplex | self-dimer of one oligo |\n| `calc_heterodimer(s1, s2)` | Untergasser 2012 *Nucleic Acids Res* 40:e115 | most stable cross duplex of two oligos | forward-vs-reverse (and probe) cross-dimer |\n| `calc_end_stability(s1, s2)` | SantaLucia & Hicks 2004 *Annu Rev Biophys* 33:415 | dG of the 3' end of s1 annealing to s2 | the 3'-anchored, extendable-dimer question |\n| `calc_*_tm` (float) | Untergasser 2012 *Nucleic Acids Res* 40:e115 | the `.tm` only, no structure object | fast high-throughput screening |\n| `calc_tm(seq)` | SantaLucia 1998 *PNAS* 95:1460 | nearest-neighbor Tm vs perfect complement | the pair Tm-match check |\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended | Why |\n|----------|-------------|-----|\n| Standard pre-order check of a pair | `calc_hairpin`\u002F`homodimer` on each + `calc_heterodimer` on the pair, at reaction conditions and `temp_c` = Ta | the four-call panel that catches self-structure |\n| Suspect a primer-dimer artifact (gel, low-Tm melt peak) | `calc_heterodimer` + `calc_end_stability`, read the ASCII structure for 3'-end pairing | 3'-end dimers are extendable; that is the artifact source. A dimer that appears only at LOW template is diagnostic -- with scarce target, primer-primer collisions win the kinetic competition |\n| Screening hundreds of oligos | `calc_hairpin_tm`\u002F`calc_homodimer_tm` (floats) | fast triage; promote flagged ones to full `ThermoResult` |\n| One primer designed with a 5' tail | run the calls on the FULL tailed oligo | the tail exists physically (palindromic sites\u002FGibson arms dimerize) |\n| Pair anneals unevenly \u002F one strand dominates | compare `calc_tm` of the two primers | a Tm mismatch >2-3 C, not a dimer, is the cause |\n| \"Will it amplify only the target?\" | -> primer-specificity | that is genome off-target, a different question and toolset |\n\nDefault when uncertain: run the four-call panel at the real salt\u002FMg\u002FdNTP\u002Foligo concentrations with `temp_c` set to the annealing temperature, flag any structure whose dG is strongly negative at Ta, and weight 3'-end involvement most.\n\n## Validate a Primer Pair at Reaction Conditions\n\n**Goal:** Decide whether a chosen forward\u002Freverse pair will misbehave through hairpins or dimers in the actual reaction, with the 3' end weighted appropriately.\n\n**Approach:** Run hairpin and homodimer on each primer and heterodimer on the pair, all at the reaction's salt\u002FMg\u002FdNTP\u002Foligo concentrations and with `temp_c` set to the annealing temperature; gate every result on `.structure_found`; additionally compute `calc_end_stability` on the heterodimer to expose 3'-anchored (extendable) dimers; compare the two primer Tms for a match.\n\n```python\nimport primer3\n\nfwd, rev = 'GTCTCCTCTGACTTCAACAGCG', 'ACCACCCTGTTGCTGTAGCCAA'\nCOND = dict(mv_conc=50.0, dv_conc=3.0, dntp_conc=0.8, dna_conc=250.0, temp_c=60.0)  # match the qPCR\u002FPCR reaction + Ta\n\ndef flag(label, res):\n    if res.structure_found:\n        print(f'{label}: Tm={res.tm:.1f}C dG={res.dg\u002F1000:.2f} kcal\u002Fmol')   # dg is cal\u002Fmol -> \u002F1000\n    else:\n        print(f'{label}: no structure')\n\nfor name, seq in [('fwd', fwd), ('rev', rev)]:\n    flag(f'{name} hairpin', primer3.calc_hairpin(seq, **COND))\n    flag(f'{name} homodimer', primer3.calc_homodimer(seq, **COND))\n\nflag('heterodimer', primer3.calc_heterodimer(fwd, rev, **COND))\nend = primer3.calc_end_stability(fwd, rev, **COND)            # 3'-end-anchored stability = the extendable-dimer risk\nprint(f\"3'-end stability dG={end.dg\u002F1000:.2f} kcal\u002Fmol\")\n\ndtm = abs(primer3.calc_tm(fwd, **{k: COND[k] for k in ('mv_conc','dv_conc','dntp_conc','dna_conc')})\n          - primer3.calc_tm(rev, **{k: COND[k] for k in ('mv_conc','dv_conc','dntp_conc','dna_conc')}))\nprint(f'pair Tm difference={dtm:.1f}C')\n```\n\n## Reading the Result: dG, the 3' End, and the Structure\n\n`ThermoResult.dg` is in cal\u002Fmol (divide by 1000 for kcal\u002Fmol). More negative = more stable = more concerning. But two structures with similar Tm can have very different dG at the annealing temperature, and the structure's own Tm is just where its dG crosses zero -- so judge by dG at `temp_c` = Ta, not by Tm. Print `res.ascii_structure` (or `res.ascii_structure_lines`) to SEE where the duplex sits: a dimer that pairs the recessed 3' ends is extendable and disqualifying even at modest dG, while a stronger structure with free 5'\u002Finternal pairing only transiently lowers free primer. `calc_end_stability(fwd, rev)` isolates exactly the 3'-end-of-fwd-against-rev stability, which is the right number for \"will this dimer extend.\" It scores the 3' end of the FIRST argument, so check both directions (also `calc_end_stability(rev, fwd)`) -- either primer's 3' end can anchor the extendable dimer.\n\n## Per-Method Failure Modes\n\n### Ranking dimers by global dG or Tm\n**Trigger:** Accepting\u002Frejecting a structure on its overall dG or Tm. **Mechanism:** a weak dimer that locks the 3' ends is extended into artifact, while a strong dimer with free 3' ends is benign. **Symptom:** a \"passing\" pair still produces primer-dimer; a \"failing\" pair amplifies fine. **Fix:** inspect 3'-end involvement (`calc_end_stability`, ASCII structure) and weight it above whole-molecule dG.\n\n### Validating at the wrong temperature\u002Fconditions\n**Trigger:** Using default `temp_c=37` and default salt instead of the reaction's Ta and Mg2+. **Mechanism:** structure stability is strongly condition-dependent; a structure that melts below Ta is harmless. **Symptom:** false alarms (or false passes) that do not match the bench. **Fix:** set `temp_c` to the annealing temperature and pass the real mv\u002Fdv\u002Fdntp\u002Fdna concentrations.\n\n### Trusting dG without a structure\n**Trigger:** Reading `.dg`\u002F`.tm` without checking `.structure_found`. **Mechanism:** when no structure forms the fields are not a real duplex. **Symptom:** nonsense or contradictory numbers. **Fix:** gate every result on `.structure_found` before reporting.\n\n### Unit confusion (cal vs kcal)\n**Trigger:** Comparing `.dg` directly to a kcal\u002Fmol threshold. **Mechanism:** primer3-py reports dG in cal\u002Fmol, so -6000 is -6 kcal\u002Fmol. **Symptom:** thresholds off by 1000x; everything looks catastrophic or fine. **Fix:** divide `.dg` by 1000 before comparing.\n\n### Validating only the binding core of a tailed primer\n**Trigger:** Checking the template-binding portion of a primer that carries a 5' tail. **Mechanism:** the full oligo (tail included) is what physically exists; palindromic restriction sites and complementary Gibson arms dimerize. **Symptom:** clean validation, dimers on the bench. **Fix:** run the calls on the FULL tailed oligo.\n\n## Quantitative Thresholds\n\nThese are FLAGGING heuristics for inspection, not hard cutoffs; they are condition-dependent (salt, Mg2+, primer concentration, Ta). Read the structure and judge at Ta before accepting or rejecting.\n\n| Threshold | Source | Rationale |\n|-----------|--------|-----------|\n| Hairpin Tm at least ~10 C below Ta | SantaLucia & Hicks 2004 *Annu Rev Biophys* 33:415 | a hairpin that melts well below the anneal step is largely denatured |\n| Dimer dG flag if more negative than ~ -6 to -9 kcal\u002Fmol | -- | common practice line; below ~ -9 generally rejected; condition-dependent |\n| 3'-END dimer dG: be stricter, flag ~ -3 to -5 kcal\u002Fmol | Kwok 1990 *Nucleic Acids Res* 18:999 | 3'-anchored dimers are extendable, so weight them above global dG |\n| Pair Tm difference \u003C= 2 C | Koressaar & Remm 2007 *Bioinformatics* 23:1289 | matched Tm so both primers anneal at one Ta |\n| Evaluate at `temp_c` = annealing temperature | SantaLucia & Hicks 2004 *Annu Rev Biophys* 33:415 | dG at Ta, not at 37 C, is the harm-relevant quantity |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| `AttributeError: calcHeterodimer` | camelCase deprecated since primer3-py 1.0.0 | use snake_case `calc_heterodimer` |\n| Validation disagrees with the bench | default `temp_c`\u002Fsalt, not the real reaction | pass reaction mv\u002Fdv\u002Fdntp\u002Fdna and `temp_c` = Ta |\n| A \"clean\" pair still makes primer-dimer | judged by global dG, missed the 3' end | check `calc_end_stability` and the ASCII structure |\n| dG threshold seems 1000x off | `.dg` is cal\u002Fmol, not kcal\u002Fmol | divide by 1000 before comparing |\n| `.tm`\u002F`.dg` look meaningless | no structure formed | gate on `.structure_found` |\n| Pair amplifies one strand only | Tm mismatch, not a dimer | compare `calc_tm` of the two primers; redesign Tm-matched (primer-basics) |\n\n## References\n\n- Untergasser A, Cutcutache I, Koressaar T, et al. 2012. Primer3 - new capabilities and interfaces. *Nucleic Acids Res* 40:e115.\n- SantaLucia J Jr, Hicks D. 2004. The thermodynamics of DNA structural motifs. *Annu Rev Biophys Biomol Struct* 33:415-440.\n- SantaLucia J Jr. 1998. A unified view of polymer, dumbbell, and oligonucleotide DNA nearest-neighbor thermodynamics. *PNAS* 95:1460-1465.\n- Koressaar T, Remm M. 2007. Enhancements and modifications of primer design program Primer3. *Bioinformatics* 23:1289-1291.\n- Kwok S, Kellogg DE, McKinney N, et al. 1990. Effects of primer-template mismatches on the polymerase chain reaction: human immunodeficiency virus type 1 model studies. *Nucleic Acids Res* 18:999-1005.\n\n## Related Skills\n\n- primer-basics - Design Tm-matched primer pairs (redesign if validation fails)\n- primer-specificity - Genome-wide off-target \u002F in-silico PCR (a different question)\n- qpcr-primers - Co-design qPCR primers and probes, including probe self-structure\n- sequence-manipulation\u002Fseq-objects - Reverse-complement and assemble tailed oligos to validate\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","python","2026-09-20","primer-design\u002Fprimer-validation\u002FSKILL.md","primer3-py","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fdesign\u002Fbio-primer-design-primer-validation","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-primer-design-primer-validation",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-primer-design-primer-validation",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-primer-design-primer-validation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fdesign\u002Fbio-primer-design-primer-validation\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fvalidate_primers.py","SCRIPT","脚本",2789,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fdesign\u002Fbio-primer-design-primer-validation\u002Fexamples\u002Fvalidate_primers.py",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"usage-guide.md","REFERENCE","参考文档",4481,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fdesign\u002Fbio-primer-design-primer-validation\u002Fusage-guide.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":70},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":70},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":70},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":70},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]