Skip to main content
Off-target primer specificity check using BLAST+ or Biopython fallback.

Quick Start

# Basic usage with comma-separated primers
primerlab blast -p "ATGACCATGATTACG,GCAACTGTTGGGAAG" -d genome.fasta

# Using primer file (FASTA or JSON)
primerlab blast -p primers.fasta -d database.fasta

# With target filtering
primerlab blast -p primers.json -d genome.fasta --target my_gene

Arguments

ArgumentShortDescription
--primers-pPrimer input (JSON, FASTA, or comma-separated) required
--database-dPath to FASTA or BLAST database required
--target-tExpected target sequence ID
--output-oOutput directory (default: blast_output)
--jsonOutput JSON only
--modeAlignment mode: auto, blast, biopython

Input Formats

Comma-separated

primerlab blast -p "ATGACCATGATTACG,GCAACTGTTGGGAAG" -d db.fasta

JSON File

{
  "forward": "ATGACCATGATTACG",
  "reverse": "GCAACTGTTGGGAAG"
}

FASTA File

>forward_primer
ATGACCATGATTACG
>reverse_primer
GCAACTGTTGGGAAG

Output

Console

🔬 Off-target Check (v0.3.0)
   Database: genome.fasta
   Forward:  ATGACCATGATTACG
   Reverse:  GCAACTGTTGGGAAG

✅ Specificity Score: 95.0 (Grade: A)
   Forward: 2 off-targets
   Reverse: 1 off-target

✅ Primers are specific!

📁 Output: blast_output
   • blast_result.json
   • specificity_report.md

JSON Output (blast_result.json)

{
  "forward": {
    "offtargets": 2,
    "score": 92.5
  },
  "reverse": {
    "offtargets": 1,
    "score": 97.5
  },
  "combined_score": 95.0,
  "grade": "A",
  "is_specific": true
}

Scoring

GradeScoreInterpretation
A90-100Excellent specificity
B80-89Good specificity
C70-79Acceptable
D60-69Low specificity
F<60Poor specificity

Alignment Modes

  • auto (default): Uses BLAST+ if installed, otherwise Biopython
  • blast: Force BLAST+ (requires installation)
  • biopython: Force Biopython pairwise aligner

Integration with Design

Use --blast flag after primer design:
# Design and check in one command (if config has offtarget enabled)
primerlab run --config my_config.yaml --blast --blast-db genome.fasta
Or enable in config:
offtarget:
  enabled: true
  database: /path/to/genome.fasta
  mode: auto

See Also