Skip to content

KowalskiBio/Primerool

Repository files navigation

🧬 Primerool

Cloud-based primer design tool for any organism.

Primerool is a local web application that lets you search for genes, visualise their genomic structure, and design PCR primers β€” all from your browser. It fetches data live from Ensembl and NCBI, so no local genome files are needed. Just run it and start designing.


What Can It Do?

1. Gene Search & Sequence Retrieval

Search for any gene by name (e.g. BRCA1, AP1, mcrA) or accession ID (e.g. NM_105581.3). Primerool queries Ensembl or NCBI in real time and returns:

  • All annotated transcripts with exon count and strand info
  • The canonical transcript is auto-selected
  • Genomic DNA (full span with introns) or spliced mRNA (exons only)
  • Optional UTR inclusion
  • Configurable upstream and downstream flanking regions

2. Multi-Organism Support

Primerool is not limited to humans. Pick from 6 kingdoms and 40+ pre-configured species, or enter any Ensembl-compatible species name:

Kingdom Example Species
Animals Human, Mouse, Rat, Zebrafish, Chicken, Pig, Cow, Dog, Cat, Sheep, Rabbit, Macaque, Chimpanzee, Frog, Fruit Fly, C. elegans
Plants Arabidopsis thaliana, Rice, Maize, Wheat, Tomato, Soybean, Grape, Potato, Barley, Tobacco
Bacteria E. coli K-12, B. subtilis 168, S. aureus, P. aeruginosa, M. tuberculosis, S. enterica, S. pneumoniae
Fungi S. cerevisiae, S. pombe, A. nidulans, N. crassa, C. albicans
Protists P. falciparum, T. brucei, L. major, D. discoideum, T. gondii
Viruses SARS-CoV-2

Every kingdom also offers a Custom option where you can type in any Ensembl species identifier.

3. Dual Data Source

Choose between two independent APIs:

  • Ensembl REST API β€” the default, covers all domains of life
  • NCBI E-Utilities β€” robust fallback; especially useful when Ensembl is slow or unreachable (happens way too often)

Both produce the same downstream output (transcripts, exons, sequences, flanking regions).

4. BLAST Integration

If you prefer, you can switch to FASTA mode, paste a sequence (or accession ID), and Primerool runs an NCBI BLAST search. It returns the top hits with:

  • Organism name
  • Gene symbol
  • Accession and identity %
  • A "Use this" button that auto-fills the gene search with the matched organism and gene

5. Interactive Sequence Visualisation

Once a sequence is loaded, Primerool enabels user to use two interactive views:

  • Feature Map β€” a zoomable timeline showing exons, introns, CDS, and UTRs as coloured blocks. Primer binding sites are overlaid when designed.
  • Sequence Map β€” the full nucleotide sequence with colour-coded annotations:
    • Flanking regions (grey)
    • UTRs (yellow)
    • CDS (orange, bold)
    • Introns (italic, truncated to show length only when in truncated mode)
    • Primer binding sites (red highlights)

Click any exon in the Feature Map to jump to it in the Sequence Map.

6. Four Primer Design Modes

WGA (Whole-Genome Amplification)

Designs primer pairs in the flanking regions (upstream + downstream) to amplify the entire gene locus. Uses Primer3 with configurable settings.

Internal (Exon–Exon Junction)

Designs splice-spanning primers that cross exon–exon junctions. Ideal for qRT-PCR β€” ensures that only cDNA (not genomic DNA) is amplified.

Design from Sequence (Manual)

Paste any two sequence regions β€” one for forward, one for reverse β€” and Primer3 picks the best primers from each. Includes a collapsible βš™οΈ Primer Conditions panel to customise:

Parameter Default
Melting Temperature (Tm) 57 / 62 / 67 Β°C (min / opt / max)
Primer Length 18 / 20 / 25 bp (min / opt / max)
GC Content 40 – 60 %
Max Primers to Return 5

Automatic Pairing

All modes return ranked primer pairs with:

  • Per-primer stats (Tm, GC%, length)
  • Hairpin and self-dimer analysis (Ξ”G)
  • Heterodimer analysis for each pair
  • A "Use" button to highlight the binding site on the sequence map

7. Quality Control

Every designed primer is automatically checked for:

  • Hairpin formation β€” structure found? Ξ”G value
  • Self-dimer (homodimer) β€” structure found? Ξ”G value
  • Heterodimer β€” cross-complementarity between forward and reverse primers
  • Tm accuracy β€” calculated using nearest-neighbour thermodynamics (Primer3 engine)

Getting Started

macOS

  1. Navigate to the dist/ folder and double-click the Primerool.app bundle.
  2. It will instantly launch as a native PyInstaller desktop application with a custom dock icon.

Building for macOS (.app / .dmg): To compile the standalone OS X application yourself:

  1. Run the automated packager:
    ./scripts/build_mac.sh
  2. This will generate the Primerool.app bundle and Primerool.dmg installer in the dist/ directory.

Building for Windows (.exe): To generate a standalone Windows executable, you must run the build on a Windows machine:

  1. Run the automated packager:
    scripts\build_win.bat
  2. Note: If Python is not installed, the build script will automatically download and install Python 3.12 for you.
  3. Find the executable output in dist\Primerool.exe.

Windows

  1. Double-click Run_primerool.bat
  2. If Python isn't installed, it's downloaded and installed automatically in the background.
  3. The app installs all dependencies and launches as a native desktop application window.

Development / Manual Setup

# Clone the repo
git clone https://github.com/your-username/Primerool.git
cd Primerool

# Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate        # macOS/Linux
# venv\Scripts\activate         # Windows

# Install dependencies
pip install -r requirements.txt

# Run
python src/app.py

Open http://127.0.0.1:5050 in your browser.


Architecture

Primerool/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app.py                 # Flask application (all routes)
β”‚   β”œβ”€β”€ ensembl_api.py         # Ensembl REST API client
β”‚   β”œβ”€β”€ ncbi_api.py            # NCBI E-Utilities API client
β”‚   β”œβ”€β”€ blast_api.py           # NCBI BLAST integration
β”‚   β”œβ”€β”€ primer_flanking.py     # WGA primer design (flanking regions)
β”‚   β”œβ”€β”€ primer_junction.py     # Exon-exon junction primer design
β”‚   β”œβ”€β”€ primer_internal.py     # Internal primer design
β”‚   β”œβ”€β”€ primer_manual.py       # Manual region primer design
β”‚   β”œβ”€β”€ primer_utils.py        # Shared Primer3 settings & analysis
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   └── index.html         # Single-page frontend (vanilla JS)
β”‚   └── static/
β”‚       └── logo.png           # Primerool mascot
β”œβ”€β”€ Run_primerool.command       # macOS launcher
β”œβ”€β”€ Run_primerool.bat           # Windows launcher
β”œβ”€β”€ requirements.txt
└── LICENSE                     # CC0 1.0 Universal

Dependencies

Package Purpose
flask β‰₯ 3.0 Web framework
primer3-py β‰₯ 2.0 Primer design engine (Primer3 bindings)
requests β‰₯ 2.31 HTTP client for Ensembl & NCBI APIs

No database. No genome files. Everything is fetched on-the-fly.


Typical Workflow

  1. Select organism β€” pick kingdom + species, or enter a custom Ensembl name
  2. Search gene β€” type a gene symbol or accession ID β†’ get transcript list
  3. Configure sequence β€” choose transcript, toggle introns/UTRs, set flanking bp
  4. View sequence β€” explore the feature map and sequence map
  5. Design primers β€” pick a mode (WGA, Junction, or Manual) β†’ get ranked pairs
  6. Use primers β€” click "Use" to highlight binding sites on the map

License

CC0 1.0 Universal β€” public domain. Use freely for any purpose.

About

Primerool is a cloud-based primer design tool for clinical and research labs. It fetches live gene data from Ensembl to design primers for Whole Genome Amplification (WGA), Exon-Exon Junctions (qRT-PCR), and custom regions. Features interactive sequence visualization, automatic hairpin/dimer checks, and exportable results.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors