Skip to content

Amplicon Calling

duceppemo edited this page Nov 3, 2026 · 5 revisions

Amplicon Calling

This page explains exactly when insilicoPCR reports an amplicon, and how to tune the rules. The same engine is used by the GUI and the CLI.

Overview

BLAST+ (blastn-short) finds every place a primer matches a sample sequence. Raw BLAST hits are then passed through two stages:

  1. Hit filtering — is this primer binding good enough to prime extension?
  2. Amplicon calling — do an accepted forward hit and an accepted reverse hit form a product that would actually amplify?

Only pairs that pass both stages appear in the consolidated report.

Stage 1: hit filtering

For every primer hit, insilicoPCR checks:

Total mismatch budget (-m, --mismatches, default 0)

BLAST mismatches + insertions/deletions + primer bases BLAST left unaligned at the 3' end must not exceed the budget. Unaligned 3' bases count because BLAST trims terminal mismatches from local alignments — a primer whose last base does not pair shows up as a shortened alignment, not as a reported mismatch.

Unaligned bases at the harmless 5' end are tolerated without consuming the budget, up to --5p-truncation (default 5). BLAST trims terminal mismatches from local alignments, so a single SNP near a primer's 5' end shows up as several unaligned 5' bases — and 5'-proximal mismatches barely affect priming in a real reaction, so the allowance is generous. See the tutorial for a real-data example.

Weighted 3'-end check (--3p-window, --3p-penalty)

DNA polymerase extends from the primer 3' end, so mismatches there matter far more than at the 5' end — and breaking a strong G/C pair near the terminus is worse than breaking an A/T pair. Within the last --3p-window bases (default 5), every imperfection is scored:

Imperfection Penalty
Mismatch (or unaligned base) on the terminal 3' base 3
Mismatch 1–2 bases from the terminus 2
Mismatch 3 or more bases from the terminus 1
The broken pair involves a primer G or C within the last 3 bases +1
Insertion or deletion +1

The sum must not exceed --3p-penalty (default 0: a perfect 3' window is required).

Worked examples (with a window of 5):

Situation Penalty Passes default (0)?
Perfect match over the whole window 0 yes
A/T mismatch 4 bases from the terminus 1 no — needs --3p-penalty 1
A/T mismatch on the terminal base 3 no — needs --3p-penalty 3
G/C mismatch on the terminal base 4 no — needs --3p-penalty 4
1-base deletion 2 bases from the terminus (A/T) 3 no — needs --3p-penalty 3

Remember that any tolerated 3' imperfection also consumes the total budget, so rescuing a terminal mismatch needs both, e.g. -m 1 --3p-penalty 4.

Probes are different

Hydrolysis probes (-P) report by 5'→3' exonuclease cleavage while hybridized, not by extension, so the primer 3' rules do not apply to them (their 3' end is blocked anyway). Probes are also typically longer and designed ~8–10 °C hotter than the primers, which makes them more resilient: a single mismatch that would kill a primer's 3' end usually only delays Cq. Mismatch position still matters — central mismatches destabilize the duplex most, the 5' end (the flap Taq cleaves) is the most tolerant — but insilicoPCR models this with a simple separate budget:

  • --probe-mismatches <n>: mismatches + indels allowed per probe (default: same as -m). For inclusivity screens, a probe budget of -m + 1 is a reasonable reflection of the higher melting temperature, e.g. -m 1 --probe-mismatches 2.
  • The alignment must cover nearly the whole probe (at most 2 unaligned bases across both ends — intentionally independent of the primer --5p-truncation setting).
  • An accepted probe hit must lie entirely within the amplicon.

Stage 2: amplicon calling

An accepted forward hit and an accepted reverse hit are reported as an amplicon only when all of these hold:

  1. Same contig. Both primers hit the same input sequence.
  2. Opposite strands, convergent. One primer anneals to the plus strand and extends rightward; the other anneals to the minus strand and extends leftward — and they must face each other. Divergent (back-to-back) and same-strand pairs never amplify and are rejected. The assay may legitimately sit on either strand of your genome: Strand in the report shows + when the forward primer matched the plus strand, - when the assay matched the reverse strand.
  3. Product size limits. The product (5' end of one primer to the 5' end of the other, inclusive) must be at least --min-length (default 0) and at most --max-length (default 5000 bp). This suppresses "phantom" products from primer sites that are tens of kilobases — or megabases — apart, which would never amplify in a real reaction. Set -l 0 to disable the cap (e.g., for long-range PCR assessments).
  4. Probe assays only: probe inside the product. For an assay that defines a -P probe, a row is reported only if an accepted probe hit lies entirely within the amplicon. Probe-less assays in the same primer file are reported on their primer pair alone (per-assay decision; mixing both kinds in one run is supported since 0.8.0).

Typical settings

Goal Suggested options
Strict assay validation (default) -m 0
Tolerate one internal mismatch, perfect 3' end -m 1
Also tolerate one distal (positions 4–5) 3'-window mismatch -m 1 --3p-penalty 1
Inclusivity screening across divergent genomes -m 2 --3p-penalty 3
Long-range PCR -l 20000 (or -l 0 for no limit)
qPCR amplicon size sanity check -l 300 --min-length 50

Degenerate primers

IUPAC degenerate bases are expanded into every explicit combination before BLAST (e.g. ...R...Y... becomes 4 primers, suffixed _0, _1, ...). Mismatch counting and the 3' check are applied against each expanded variant, so a degenerate position never counts as a mismatch.

Clone this wiki locally