Skip to content

Repository files navigation

Synthetic Amplicon Extractor

License: MIT DOI

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.


Requirements

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.txt

Usage

Single primer pair (simple_amplicon.py)

python simple_amplicon.py <forward_primer> <reverse_primer> <genome.fasta> <output_name>

Example:

python simple_amplicon.py \
  "GGAACTGCATCCGTTCAT" \
  "TCTTTAAAGCGTTCGTGGTC" \
  toxoplasma_genome.fasta \
  toxoplasma_B1

Output: toxoplasma_B1_control.fasta

Multiple primer pairs (extract_synthetic_controls.py)

python extract_synthetic_controls.py -p primers.fasta -g genome.fasta -o output_dir

Options:

-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

Primer file format

>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).


Output

>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.


Verify installation

python test_system.py

Checks BLAST+ installation, Python dependencies, and runs a test extraction on synthetic data.


Troubleshooting

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/bin

Repository structure

synthetic-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

Citation

If you use this tool, please cite this repository:

Ojeda A (2026). Synthetic Amplicon Extractor.
GitHub: https://github.com/AngelOjedaBioinfo/synthetic-amplicon-extractor

Author

Á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).

About

BLAST-based tool to extract amplicon sequences for synthetic positive controls in PCR-based diagnostics

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages