primer-design/qpcr-primers/SKILL.md
Co-designs qPCR/RT-qPCR primers and hydrolysis (TaqMan) or molecular-beacon probes with primer3-py (PRIMER_PICK_INTERNAL_OLIGO, PRIMER_INTERNAL_* tags), for assays whose deliverable is a quantitative measurement device. Covers why amplification efficiency (90-110%, slope -3.6 to -3.1) and single-product specificity make the 2^-ddCq / Pfaffl math valid, why the short amplicon (70-150 bp), tight Tm, and zero-dimer requirement exist, the coupled probe rules (probe Tm 8-10 C above primers so it is bound when Taq's exonuclease cleaves it; no 5' G as it quenches the reporter; C-rich strand; primer3 has NO no-5'-G tag so enforce PRIMER_INTERNAL_MUST_MATCH_FIVE_PRIME=HNNNN), gDNA exclusion by exon-junction spanning AND why pseudogenes defeat it, SYBR melt-curve QC, and reference-gene validation (geNorm/NormFinder). Use when designing TaqMan/SYBR assays, exon-spanning primers, probes, or matched-efficiency multiplex panels. Genome specificity is primer-specificity; dimers primer-validation; standard PCR primer-basics.
npx skillsauth add GPTomics/bioSkills bio-primer-design-qpcr-primersInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Reference examples tested with: primer3-py 2.3+.
Before using code patterns, verify installed versions match. If versions differ:
pip show primer3-py then help(primer3.design_primers) to check signaturesIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
"Design qPCR primers (and a probe) for this target" -> Co-design a short, single-product, Tm-matched amplicon with an optional internal probe whose constraints are coupled to the primers -- because the assay's job is not to amplify but to MEASURE, and every qPCR-specific rule protects the efficiency the quantification math assumes.
primer3.design_primers(seq_args, global_args) with PRIMER_PICK_INTERNAL_OLIGO=1 and PRIMER_INTERNAL_* for the probe.Scope: co-designing qPCR/RT-qPCR primers and hydrolysis/beacon probes under coupled Tm/size/junction constraints. Genome-wide specificity / pseudogene checking -> primer-specificity. Intramolecular dimers/hairpins of the oligos and probe -> primer-validation. Standard (non-quantitative) PCR -> primer-basics.
(1+E)^-dCq (at ideal E=1, 2^-ddCq). That requires amplification efficiency E ~ 90-110% (standard-curve slope -3.6 to -3.1, R^2 > 0.99) AND a single product. The short amplicon (70-150 bp), tight Tm, and zero-dimer requirement all exist to protect E and specificity. 2^-ddCq is valid ONLY when the target and reference-gene efficiencies are matched and near 100% -- so design for matched ~100% E, or fall back to Pfaffl's efficiency-corrected model.PRIMER_INTERNAL_MUST_MATCH_FIVE_PRIME='HNNNN' (IUPAC H = not G) or a post-hoc filter. This is the hydrolysis (TaqMan) probe path; a molecular beacon needs engineered complementary stem arms (a deliberate hairpin) that primer3's internal-oligo picker does NOT design and would flag as a liability -- design the linear core here, add the stem afterward, and exclude that hairpin from validation.Efficiency from a standard curve: E = 10^(-1/slope) - 1; perfect doubling is slope -3.32 (E = 100%). Relative quantification with matched ~100% efficiency uses 2^-ddCq (Livak & Schmittgen 2001 Methods 25:402); with UNEQUAL efficiencies use the efficiency-corrected ratio E_target^dCq / E_ref^dCq (Pfaffl 2001 Nucleic Acids Res 29:e45). Report per MIQE (Bustin 2009 Clin Chem 55:611): efficiency, slope, R^2, Cq method, NTC and no-RT controls, and validated reference genes. The design objective is therefore "single short amplicon with slope near -3.32," not "two oligos that amplify."
| Tool / method | Citation | Mechanism / role | When |
|---------------|----------|------------------|------|
| primer3-py internal oligo | Untergasser 2012 Nucleic Acids Res 40:e115 | PRIMER_PICK_INTERNAL_OLIGO=1 + PRIMER_INTERNAL_* co-designs the probe with the primers | TaqMan / hydrolysis-probe assays |
| PRIMER_INTERNAL_MUST_MATCH_FIVE_PRIME | Untergasser 2012 Nucleic Acids Res 40:e115 | constrains the probe 5' end (use HNNNN to forbid 5'-G) | enforce the no-5'-G probe rule |
| SEQUENCE_OVERLAP_JUNCTION_LIST | Untergasser 2012 Nucleic Acids Res 40:e115 | forces a primer/probe to straddle a splice junction | cDNA-specific expression assays |
| MIQE reporting | Bustin 2009 Clin Chem 55:611 | the minimum information / efficiency-from-standard-curve standard | every quantitative assay |
| geNorm / NormFinder | Vandesompele 2002 Genome Biol 3:RESEARCH0034; Andersen 2004 Cancer Res 64:5245 | rank reference-gene stability | choosing normalizers, validated per condition |
| In-silico PCR (genome) | (route OUT) | catches pseudogenes / gDNA off-targets | mandatory gDNA/specificity check -> primer-specificity |
| Scenario | Recommended | Why |
|----------|-------------|-----|
| Probe-based (multiplex-capable, second specificity check) | TaqMan: PRIMER_PICK_INTERNAL_OLIGO=1, probe Tm 8-10 C above primers, HNNNN 5' | the probe adds sequence specificity and enables multiplex |
| Single target, cheapest, no probe | SYBR (no internal oligo) + mandatory melt-curve QC | dye reports any dsDNA; melt curve is the specificity readout |
| Expression assay, avoid gDNA | exon-junction-spanning primers (SEQUENCE_OVERLAP_JUNCTION_LIST) | the junction does not exist contiguously in unspliced gDNA |
| Gene has a processed pseudogene | junction-spanning is NOT enough -> primer-specificity (search genome) + no-RT control | the pseudogene carries the junction |
| Single-exon gene (no junction) | DNase + no-RT control; no design-level gDNA exclusion | there is no intron/junction to exploit |
| AT-rich target / allele discrimination | MGB or LNA probe (shorter, higher effective Tm) | raises probe Tm where a standard probe cannot reach |
| Multiplex panel | spectrally distinct fluorophores, matched E, primer-limiting, all-pairs cross-dimer | competition and cross-dimers dominate; primer-limiting = drop the abundant target's primer concentration so it plateaus early and stops starving the rare target of shared reagents |
| Choosing normalizers | rank a candidate panel with geNorm/NormFinder, validate per condition | a single unvalidated reference gene is a classic error |
Default when uncertain: TaqMan primers+probe, amplicon 70-150 bp, primers Tm ~60 C (within 2 C), probe Tm ~68-70 C with HNNNN, exon-junction-spanning for expression, then route the pair to primer-specificity and run a standard curve.
Goal: Produce a short, Tm-matched amplicon with an internal probe whose Tm is 8-10 C above the primers and whose 5' base is not G.
Approach: Turn on internal-oligo picking, set the primer Tm window and a short product range, RAISE the PRIMER_INTERNAL_* Tm window 8-10 C above the primers (the defaults equal the primer Tm), and forbid a 5'-G probe with PRIMER_INTERNAL_MUST_MATCH_FIVE_PRIME='HNNNN'. For an expression assay add SEQUENCE_OVERLAP_JUNCTION_LIST.
import primer3
template = 'ATGC...' # cDNA (mark the junction position if expression-specific)
result = primer3.design_primers(
seq_args={'SEQUENCE_ID': 'assay1', 'SEQUENCE_TEMPLATE': template},
global_args={
'PRIMER_PICK_LEFT_PRIMER': 1, 'PRIMER_PICK_RIGHT_PRIMER': 1,
'PRIMER_PICK_INTERNAL_OLIGO': 1, # design the probe
'PRIMER_PRODUCT_SIZE_RANGE': [[70, 150]], # short amplicon for efficiency
'PRIMER_NUM_RETURN': 3,
'PRIMER_OPT_TM': 60.0, 'PRIMER_MIN_TM': 58.0, 'PRIMER_MAX_TM': 62.0,
'PRIMER_PAIR_MAX_DIFF_TM': 2.0,
'PRIMER_INTERNAL_OPT_TM': 70.0, 'PRIMER_INTERNAL_MIN_TM': 68.0, 'PRIMER_INTERNAL_MAX_TM': 72.0,
'PRIMER_INTERNAL_MUST_MATCH_FIVE_PRIME': 'HNNNN', # IUPAC H = A/C/T = not G at the probe 5' end
# 'SEQUENCE_OVERLAP_JUNCTION_LIST': [junction_pos], # add for cDNA-specific assays
})
for i in range(result['PRIMER_PAIR_NUM_RETURNED']):
probe = result[f'PRIMER_INTERNAL_{i}_SEQUENCE']
print(result[f'PRIMER_LEFT_{i}_SEQUENCE'], result[f'PRIMER_RIGHT_{i}_SEQUENCE'], probe,
'probe5=', probe[0], 'probeTm=', round(result[f'PRIMER_INTERNAL_{i}_TM'], 1),
'size=', result[f'PRIMER_PAIR_{i}_PRODUCT_SIZE'])
For a cDNA-specific assay, place a primer or the probe across a splice junction with SEQUENCE_OVERLAP_JUNCTION_LIST = [pos] plus PRIMER_MIN_3_PRIME_OVERLAP_OF_JUNCTION (default 4) and PRIMER_MIN_5_PRIME_OVERLAP_OF_JUNCTION (default 7); the 3' overlap is the specificity-determining knob because a primer that only overlaps at its 5' end can still prime off gDNA from its 3' anchor. The internal-oligo equivalents (PRIMER_INTERNAL_MIN_3_PRIME_OVERLAP_OF_JUNCTION / _5_PRIME_) constrain the probe. The hard caveat: this does NOT protect against processed pseudogenes, which typically carry the junction in DNA -- so the assay still needs a genome specificity check (-> primer-specificity), DNase treatment, and a no-RT control. Intron-flanking (primers in different exons across a large intron) is the alternative, but fails across tiny introns.
Multiplex is the most failure-prone mode; assemble it in order: (1) design each assay independently (short amplicon, matched Tm, probe offset); (2) check ALL primer+probe oligos pairwise for cross-dimers -- for k assays that is O((2k primers + k probes)^2) checks (a 5-plex = 10 primers + 5 probes = 105 pairwise calls), weighting 3'-end involvement (-> primer-validation); (3) run in-silico PCR over the POOLED primer set so cross-pair amplicons (one assay's forward meeting another's reverse) are caught (-> primer-specificity); (4) assign spectrally distinct fluorophores -- the instrument's optical channels and spectral overlap CAP the plex (most platforms resolve ~4-6 dyes, with color compensation), so the channel count, not the chemistry, usually limits a high-plex; (5) match efficiencies on a multiplex standard curve and primer-limit the abundant targets so they do not starve the rare ones.
Trigger: Applying 2^-ddCq without a standard curve. Mechanism: the method assumes target and reference efficiencies are matched and ~100%; if not, fold-changes are systematically biased. Symptom: numbers that are not measurements; results that do not replicate across instruments. Fix: run a standard curve, report E/slope/R^2 (MIQE), and use Pfaffl if efficiencies differ.
Trigger: Leaving PRIMER_INTERNAL_* Tm at the default (equal to the primers). Mechanism: the probe is not bound when the polymerase extends through it, so the exonuclease never cleaves it. Symptom: weak or no TaqMan signal. Fix: raise the internal Tm window 8-10 C above the primer window.
Trigger: Not forbidding a 5' guanine. Mechanism: a 5'-G quenches the reporter even after cleavage. Symptom: low signal despite good amplification. Fix: PRIMER_INTERNAL_MUST_MATCH_FIVE_PRIME='HNNNN' or filter returned probes; prefer the C-rich strand.
Trigger: Trusting junction-spanning alone. Mechanism: processed pseudogenes carry the spliced junction in genomic DNA. Symptom: a positive no-RT control; a genomic amplicon at the cDNA size. Fix: genome specificity check (primer-specificity), DNase, and a no-RT control.
Trigger: Any extendable cross-dimer with SYBR detection. Mechanism: the dye reports the dimer, which competes with and can swamp a low-copy target. Symptom: a low-Tm shoulder in the melt curve; inflated NTC/low-copy signal. Fix: inspect the melt curve for a single sharp peak; validate dimers at reaction conditions (primer-validation).
Trigger: Normalizing to GAPDH/ACTB by habit. Mechanism: the reference may itself be regulated by the treatment. Symptom: apparent target changes that track a moving normalizer. Fix: rank a candidate panel with geNorm/NormFinder and validate stability in the actual experimental conditions.
| Threshold | Source | Rationale |
|-----------|--------|-----------|
| Efficiency 90-110% (slope -3.6 to -3.1, ideal -3.32), R^2 > 0.99 | Bustin 2009 Clin Chem 55:611 | the acceptance band that keeps 2^-ddCq valid |
| Amplicon 70-150 bp | Bustin 2009 Clin Chem 55:611 | short products denature/re-prime fully each short cycle -> ~100% E |
| Primer Tm ~58-62 C, pair within 2 C | Koressaar & Remm 2007 Bioinformatics 23:1289 | one anneal-extend temperature; matched so neither lags |
| Probe Tm 8-10 C above primer Tm | -- | probe bound before/during extension so the exonuclease can cleave it |
| Probe: no 5'-G, prefer C-rich strand | -- | a 5'-G (and G-richness) quenches the reporter; the standard rule for 5'-reporter hydrolysis probes (reporter/quencher-chemistry dependent) |
| Standard curve: 5-6 points, 10-fold, triplicate | Bustin 2009 Clin Chem 55:611 | defines E, R^2, dynamic range, LOD |
| Reference genes: >=2 validated | Vandesompele 2002 Genome Biol 3:RESEARCH0034 | geometric mean of stable references beats one gene |
| Error / symptom | Cause | Solution |
|-----------------|-------|----------|
| Weak/no TaqMan signal | probe Tm too low, or 5'-G | raise PRIMER_INTERNAL_* Tm 8-10 C; HNNNN; C-rich strand |
| No probe returned (0 pairs) | internal Tm window unreachable on this template | widen/lower internal Tm or product range; check with PRIMER_EXPLAIN_FLAG=1 |
| Positive no-RT control | gDNA / pseudogene amplification | junction-span + genome check (primer-specificity) + DNase |
| Poor efficiency (slope steep/shallow) | amplicon too long, dimers, off-target, or template inhibitors/degraded standard | shorten amplicon, fix dimers (primer-validation), check specificity, clean up template |
| Low-Tm melt peak (SYBR) | primer-dimer | redesign to remove 3'-end cross-dimers (primer-validation) |
| Fold-changes do not replicate | unmatched efficiency, unvalidated reference | match E or use Pfaffl; validate references with geNorm/NormFinder |
tools
End-to-end CLIP-seq pipeline from FASTQ to ENCODE-compliant binding sites, single-nucleotide crosslink maps, annotation, motifs, and (optionally) differential binding. Use when running the full Yeo lab eCLIP / iCLIP / iCLIP2 / iCLIP3 / irCLIP / PAR-CLIP analysis with SMInput control, protocol-specific UMI extraction, ENCODE STAR parameters, CLIPper or Skipper peak calling with stringent log2 FC and -log10 p thresholds, IDR rescue and self-consistency QC, and downstream motif registration with mCross or PEKA.
development
Detect, date, and contextualize whole-genome duplication (WGD / paleopolyploidy) events using wgd v2 (Chen et al 2024), KsRates (Sensalari 2022 substitution-rate-corrected Ks dating), DupGen_finder (Qiao 2019), MAPS (Li 2018 phylogenomic), POInT (Conant 2008 ordered-block), SLEDGe (2024 ML-based), Whale.jl (Bayesian DL+WGD), and synteny-anchored paranome construction. Use when identifying ancient polyploidy from Ks distributions and synteny block analysis, positioning WGD events relative to speciation, distinguishing tandem from segmental from WGD duplications, dating the 2R/3R vertebrate / fish / salmonid WGDs, building paranome and Ks-age mixture models, applying KsRates substitution-rate correction across lineages, or testing alternative biased-fractionation / dosage-balance models post-WGD.
tools
Build whole-genome alignments using Progressive Cactus (Armstrong 2020 reference-free clade-level WGA), Minigraph-Cactus (Hickey 2024 pangenome-aware), LASTZ chain/net (UCSC pipeline), MUMmer4 (Marçais 2018 pairwise), minimap2 -x asm5/10/20 (Li 2018 fast pairwise), AnchorWave (Song 2022 WGD-aware), and Mauve / progressiveMauve (bacterial). Operates the HAL toolkit (Hickey 2013) for downstream extraction including halSynteny, halLiftover, halBranchMutations, and hal2maf. Use when constructing multi-species alignments for comparative-annotation projection (TOGA), synteny detection, conservation analyses (phyloP / PhastCons), or pangenome graph construction; selecting between reference-free (Cactus) and reference-anchored (LASTZ chains/nets) approaches; tuning sensitivity for closely vs distantly related genomes; or producing HAL files for genome-wide downstream tools.
development
Detect syntenic blocks and structural rearrangements between genomes using MCScanX (Wang 2012), JCVI/MCScan (Tang 2008 Python), GENESPACE (Lovell 2022) for orthology-anchored riparian visualization, SyRI for structural variation, AnchorWave for sequence-level synteny, i-ADHoRe 3.0 for highly diverged species, SynNet for synteny networks, and ntSynt for multi-genome macrosynteny. Use when identifying collinear gene blocks across species, distinguishing macrosynteny from microsynteny, detecting inversions/translocations/duplications, anchoring orthology in WGD lineages, producing publication riparian plots, computing synteny block age via Ks (cross-references whole-genome-duplication), or running synteny-aware ortholog inference in polyploids.