Skip to main content
Check primer specificity with BLAST.

Prerequisites

Install BLAST

# Ubuntu/Debian
sudo apt install ncbi-blast+

# macOS
brew install blast

# Verify
blastn -version

Create database

# From genome FASTA
makeblastdb -in genome.fasta -dbtype nucl -out genome_db

# Pre-built databases available at NCBI
# https://ftp.ncbi.nlm.nih.gov/blast/db/

Method 1: Integrated with Design

Run off-target check during primer design:
primerlab run pcr \
  --config my_config.yaml \
  --blast \
  --blast-db /path/to/genome_db
Output includes specificity grades:
Primer Pair 1:
  Forward: A (100% specific)
  Reverse: B (1 off-target, low identity)
  Overall: A

Method 2: Standalone Check

Check existing primers:
primerlab blast \
  -f "ATGAGTAAAGGAGAAGAACT" \
  -r "GCCGTGATGTATACATTGTG" \
  -d /path/to/genome_db
Or from result file:
primerlab blast \
  -p output_pcr/result.json \
  -d /path/to/genome_db

Understanding Results

Grades

GradeOff-targetsAction
A0✅ Safe to use
B1-2 low identity✅ Safe to use
C3-5⚠️ Verify experimentally
D6-10⚠️ Consider alternatives
F>10❌ Do not use

Score calculation

Score = 100 - (off_targets × penalty)

Penalty based on:
- Identity (higher = worse)
- 3' match (critical)
- Alignment length

Output Files

blast_results/
├── blast_report.json     # Full BLAST results
├── specificity_report.md # Human-readable summary
└── off_targets.fasta     # Off-target sequences

Configuration Options

In YAML config:
offtarget:
  enabled: true
  database: "/path/to/genome_db"
  mode: auto  # auto, blast, biopython
  max_targets: 100
  evalue: 10
  threads: 4

Troubleshooting

IssueSolution
Database not foundCheck path, run makeblastdb
BLAST not installedInstall ncbi-blast+
Too many off-targetsTry different primer pair
Slow performanceUse —threads option

Next Steps