BLAST-based tool to extract amplicon sequences from complete genomes using primer pairs. Designed to generate synthetic positive controls for PCR-based diagnostics of zoonotic pathogens in non-model systems.
Developed to replace in silico PCR tools (e.g. MEGA) that crash or time out on complete bacterial and parasite genomes. Handles multiple primer pairs in a single run and outputs FASTA sequences ready for commercial synthesis.
Validated on Toxoplasma gondii, Mycobacterium tuberculosis, M. bovis, and Brucella spp.
System:
- BLAST+ (
blastn,makeblastdb) — install via conda or apt
# conda (recommended)
conda install -c bioconda blast
# Ubuntu/Debian
sudo apt install ncbi-blast+Python packages:
pip install -r requirements.txtpython simple_amplicon.py <forward_primer> <reverse_primer> <genome.fasta> <output_name>Example:
python simple_amplicon.py \
"GGAACTGCATCCGTTCAT" \
"TCTTTAAAGCGTTCGTGGTC" \
toxoplasma_genome.fasta \
toxoplasma_B1Output: toxoplasma_B1_control.fasta
python extract_synthetic_controls.py -p primers.fasta -g genome.fasta -o output_dirOptions:
-p, --primers FASTA file with primer pairs (required)
-g, --genome FASTA file with genome (required)
-o, --output Output directory (required)
--extra-bp Extra bases flanking the amplicon (default: 10)
--min-identity Minimum BLAST identity % (default: 80)
--min-coverage Minimum primer coverage % (default: 80)
--word-size BLAST word size for short sequences (default: 7)
Example:
python extract_synthetic_controls.py \
-p examples/ejemplo_primers.fasta \
-g pathogen_genome.fasta \
-o results \
--min-identity 85 \
--min-coverage 90>B1_F
GGAACTGCATCCGTTCAT
>B1_R
TCTTTAAAGCGTTCGTGGTC
>REP529_F
CCGCCTGAGGAGAAACAAA
>REP529_R
CCGAACCCGAAATGGAAAT
Rules: use _F / _R suffixes. Prefix must match within each pair.
See examples/ejemplo_primers.fasta for a complete example with markers for
Toxoplasma gondii, M. tuberculosis, Brucella spp., and universal targets
(18S, COI, 16S).
>B1_toxoplasma_scaffold1_12345_12567
ATCGATCGATC...CGTAGCTAG
>REP529_toxoplasma_scaffold2_45678_45890
GGAACTGCAT...TCTTTAAAGC
Each header contains: primer pair name, contig ID, start position, end position.
python test_system.pyChecks BLAST+ installation, Python dependencies, and runs a test extraction on synthetic data.
No hits found:
- Reduce stringency:
--min-identity 70 --min-coverage 75 --word-size 6 - Check primer sequences for spaces or invalid characters
blastn not found:
export PATH=$PATH:/path/to/blast/binsynthetic-amplicon-extractor/
├── extract_synthetic_controls.py # Multi-primer extraction
├── simple_amplicon.py # Single primer pair, quick use
├── test_system.py # Installation verification
├── requirements.txt
├── examples/
│ └── ejemplo_primers.fasta # Example primers for zoonotic pathogens
└── LICENSE
If you use this tool, please cite this repository:
Ojeda A (2026). Synthetic Amplicon Extractor.
GitHub: https://github.com/AngelOjedaBioinfo/synthetic-amplicon-extractor
Ángel Andrés Ojeda Montesdeoca ORCID 0009-0008-7799-9525 | GitHub @AngelOjedaBioinfo Laboratorio de Biología Molecular de Docencia (LBMD), Universidad Regional Amazónica Ikiam, Tena, Ecuador.
Developed as part of the zoonotic disease surveillance project at Ikiam (Reserva Colonso Chalupas, 2025-2026).