AmplifyP is a modern, high-performance Python rewrite of William Engels's classic Amplify4 tool for simulating Polymerase Chain Reaction (PCR), with a web version available on GitHub Pages. It allows molecular biologists and researchers to predict DNA amplification products (amplicons) from a template sequence and primer set, accurately factoring in primability, stability, and melting properties of primer binding sites.
- PCR Simulation: Predict potential amplicons, product sequences, and lengths using rigorous primer-template binding models. Supports both linear and circular DNA templates.
- Cross-Platform GUI: Built with Flet (a modern Flutter-based UI framework) providing a beautiful, fully responsive app for desktop and web browsers.
- Scoring Engine: Calculates primability and stability scores using highly customisable length-wise and pairwise weight tables.
- State Serialisation: Save and load templates, primers, cutoffs, and replication configurations seamlessly using YAML files.
- Programmatic Python API: A developer-friendly, fully typed API to run simulations, dimer analyses, or thermodynamic melting calculations within your pipelines.
- Primer Dimer Analysis: Detect and score primer-dimer formation risks between primer pairs, including self-dimers and cross-dimers.
- Melting Temperature Calculations: Compute thermodynamic melting properties of primer-template and primer-primer hybrids using nearest-neighbor models.
AmplifyP requires Python 3.12 or higher.
First, clone the repository and set up your Python virtual environment under
.venv at the root of the repository:
git clone https://github.com/fangfufu/AmplifyP.git
cd AmplifyP
# Set up and activate virtual environment
python -m venv .venv
source .venv/bin/activateInstall the package and its runtime dependencies:
pip install .For developer setup and running tests, please refer to the Development Guide.
Run AmplifyP entirely in your browser without any local installation! Visit the live static web app: https://fangfufu.github.io/AmplifyP/
To build and test the static web app locally, or to run the application with hot-reload for development, see the Development Guide.
You can run AmplifyP locally either by downloading a pre-built standalone binary or by running it from source.
Standalone binaries for macOS (.dmg), Linux (.tar.gz), and Windows (.zip)
are automatically generated by the CI build job for each stable build. You can
download the latest version from the
GitHub Releases page.
[!NOTE] The macOS build is untested because the author does not have a Mac.
You can launch the Flet GUI application locally using Python.
- Desktop Application (via Python):
python src/main.py
The GUI offers intuitive workflows to:
- Input template DNA sequences and configure linear/circular topologies.
- Manage multiple primers with individual sequences and custom names.
- Customise thresholds for primability and stability cutoffs.
- Simulate PCR to visualise products, lanes, and details of binding sites.
- Analyze primer dimers to identify potential primer-dimer formation risks.
- Save/Load projects to resume work easily via YAML configuration files.
Integrate AmplifyP into your custom bioinformatics workflows using the Python API.
from amplifyp.dna import DNA, Primer, DNAType
from amplifyp.repliconf import Repliconf
from amplifyp.amplicon import AmpliconGenerator
from amplifyp.settings import GLOBAL_REPLICATION_SETTINGS
# 1. Define your DNA template and primers
template_seq = "AGCT..." # Replace with your actual sequence
template = DNA(template_seq, DNAType.LINEAR, name="MyTemplate")
primer_fwd = Primer("AGCT...", name="FwdPrimer")
primer_rev = Primer("TCGA...", name="RevPrimer")
# 2. Initialise the Amplicon Generator
generator = AmpliconGenerator(template)
# 3. Create Replication Configurations for each primer
# This step calculates potential binding sites on the template
conf_fwd = Repliconf(template, primer_fwd, GLOBAL_REPLICATION_SETTINGS)
conf_rev = Repliconf(template, primer_rev, GLOBAL_REPLICATION_SETTINGS)
# 4. Search for origins (binding sites)
conf_fwd.search()
conf_rev.search()
# 5. Add configurations to the generator
generator.add(conf_fwd)
generator.add(conf_rev)
# 6. Generate amplicons
amplicons = generator.get_amplicons()
for amp in amplicons:
print(f"Product: {amp.product.name}")
print(f"Sequence: {amp.product.seq}")
print(f"Length: {len(amp.product)}")
print(f"Quality Score: {amp.q_score}")
print("-" * 20)from amplifyp.dna import DNA, Primer, DNAType
from amplifyp.repliconf import Repliconf
from amplifyp.dimer import DimerGenerator
from amplifyp.settings import GLOBAL_REPLICATION_SETTINGS
template = DNA("AGCT...", DNAType.LINEAR, name="Template")
primer_a = Primer("AGCT...", name="PrimerA")
primer_b = Primer("TCGA...", name="PrimerB")
# Create replication configurations
conf_a = Repliconf(template, primer_a, GLOBAL_REPLICATION_SETTINGS)
conf_b = Repliconf(template, primer_b, GLOBAL_REPLICATION_SETTINGS)
conf_a.search()
conf_b.search()
# Generate dimer analysis
dimer_gen = DimerGenerator()
dimer_gen.add(conf_a)
dimer_gen.add(conf_b)
dimers = dimer_gen.get_dimers()
for dimer in dimers:
print(f"Dimer: {dimer.primer1.name}-{dimer.primer2.name}")
print(f"Score: {dimer.score}")
print(f"Product: {dimer.product.seq}")from amplifyp.dna import DNA, Primer
from amplifyp.melting import MeltingCalculator
primer = Primer("AGCTTCGAA", name="TestPrimer")
template = DNA("TTTCTAGCTTCGAAAGGG", name="Template")
calculator = MeltingCalculator()
# Calculate melting temperature of primer-template hybrid
tm = calculator.calculate_tm(primer, template)
print(f"Melting Temperature: {tm:.2f}°C")AmplifyP/
├── pyproject.toml # Package configuration and dependencies
├── README.md # This file
├── src/
│ ├── main.py # GUI application entry point
│ ├── amplifyp/ # Core package
│ │ ├── amplicon.py # Amplicon generation logic
│ │ ├── dimer.py # Primer dimer analysis
│ │ ├── dna.py # DNA/Primer sequence classes
│ │ ├── errors.py # Custom exception types
│ │ ├── gui/ # Flet-based GUI components
│ │ ├── melting.py # Thermodynamic melting calculations
│ │ ├── origin.py # Primer binding site detection
│ │ ├── pcr.py # PCR simulation engine
│ │ ├── repliconf.py # Replication configuration
│ │ └── settings.py # Global replication settings
│ └── README.md # Development guide
├── tests/ # Unit and integration tests
└── scripts/ # Utility scripts
For development setup, running the app with hot-reload, building the static web version, and running tests, see the Development Guide.
- Amplify4: This project is based on the original Amplify4 software by William Engels.
- Roboto Mono Font: Licenced under the SIL Open Font License, Version 1.1. Copyright 2015 The Roboto Mono Project Authors.
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.