Skip to main content

primer-finder

CI Coverage Latest release Bioconda PyPI Python 3.10+ License: MIT Documentation DOI

primer-finder finds the sequences that tell one group of genomes from another, so that a selective (q)PCR assay can be designed on them. Give it two folders of assembled genomes — the ones the assay should amplify (inclusion) and the ones it must not (exclusion) — and it reports the regions that every inclusion genome carries, that no exclusion genome carries, and whose differences are close enough together to sit in one primer or probe.

inclusion/ ──┐                                                        ┌─► final_kmers.fasta
             ├─► kmers ─► subtract ─► assemble ─► map ─────► blast ───┤   the candidate regions
exclusion/ ──┘   (KMC)     (KMC)     (SKESA,     (minimap2)  (every   │
                                      SPAdes or              genome)  └─► primer-finder design
                                      unitig)
                                                                          Primer3 + in silico PCR
                                                                          ─► assays.tsv

Quick start

conda create -n primer-finder -c conda-forge -c bioconda primer-finder
conda activate primer-finder

primer-finder -i inclusion/ -e exclusion/ -o results/

The bioconda package is awaiting review (bioconda-recipes#70034). Until it is merged, use pip install primer-finder in an environment that already holds KMC, SKESA or SPAdes, minimap2 and BLAST (-a unitig needs no assembler), or install from the source code with environment.yml, which brings them.

inclusion/ and exclusion/ hold one assembled genome per file (.fasta, .fna, .fa, gzipped or not; subfolders and symbolic links are followed). The answer is results/final_kmers.fasta: one record per candidate region, the specific bases in lower case and their positions in the header, the most promising first. results/run_info.json records the parameters, the genomes and the version of every program used.

To turn those regions into assays, with Primer3 and a check of what would actually make each one selective:

primer-finder design results/ -o assays/ --insilico-pcr /path/to/insilicoPCR-linux-x64

--insilico-pcr is optional and points at insilicoPCR, a separate program: given it, the designed assays are amplified in silico against both groups and each one is marked with whether it amplifies every inclusion genome and no exclusion genome.

Every oligo proposed satisfies Primer3's length, melting temperature and GC limits and folds or dimerises — with itself and with its partner — below 47 °C; and unless the request pinned a 3' end on a differing base, each primer carries a G or a C at that end. All of it is predicted for an ordinary TaqMan reaction whose salt, dNTP and oligo concentrations are options. So an oligo outside those limits is never proposed. Whether one inside them works is a question for the bench: two of the four published Brucella assays in the validation suite are over the hairpin limit and are validated on 427 strains. See Designing assays.

To install from the source code instead, see Installation.

Given the genomes of five Xylella fastidiosa subspecies, it reports the regions that four independently published subspecies-specific qPCR assays were designed on, three of them in the top five candidates — see Validation.

primer-finder only keeps perfect matches: a kmer must be in all the inclusion genomes with no mismatch, and in none of the exclusion genomes (-p/--min-inclusion relaxes the first half when some of the inclusion genomes are incomplete). It is therefore very sensitive to the quality of the assemblies and to how the genomes were assigned to the two groups. Curate the input genomes; genome_comparator helps with that.

To check an installation, run the bundled example (simulated genomes with a known answer, a few seconds). It is in the repository, not in the conda package:

curl -sL https://github.com/duceppemo/primer-finder/archive/refs/tags/v1.8.0.tar.gz | tar -xz --strip-components=1 primer-finder-1.8.0/example
bash example/run_example.sh

Ordering the assays

Once an assay has been designed from a candidate region and ordered, primer-finder idt turns the IDT order sheet into a fasta file of oligos, one record per primer and probe:

primer-finder idt order.xlsx assays.fasta my_target

Documentation

Everything else is in the wiki, whose sources are maintained in docs/wiki:

Page Contents
Installation conda, bioconda, from source, checking the installation
Usage inputs, every option, choosing the two groups, performance
Designing assays Primer3 on the regions, how assays are scored, in silico PCR
Methods what each step does, the filtering rules, limits
Outputs every file and field
Example the simulated dataset and its expected result
Validation finding published qPCR assays in public genomes: four Xylella subspecies, nine Listeria clonal complexes, four Brucella assays
FAQ troubleshooting, "no contig passed"
Development tests, continuous integration, releases

Citation

If primer-finder helped your work, please cite it — doi:10.5281/zenodo.23226411, which always resolves to the latest version (see CITATION.cff) — together with the programs it runs: KMC, SKESA or SPAdes, minimap2, BLAST and, for the design step, Primer3 and insilicoPCR.

License

MIT

Metadata

Release files for primer-finder 1.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for primer-finder 1.8.0
File Size Uploaded
primer_finder-1.8.0.tar.gz 185.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for primer-finder 1.8.0
File Interpreter ABI Platform
primer_finder-1.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 267.9 kB

Release files / primer_finder-1.8.0.tar.gz

Download URL primer_finder-1.8.0.tar.gz
Size 185.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b5fe1bd9f82f356e6a62ae578bbe6dd077ad00451bef20cccf0e8fc9b7d6a58e
BLAKE2b-256 checksum
How to use checksums
2efcdcaa89f1c9c63ec311e1ee53909c3b514c34d70f16c6b26600efb702f264
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / primer_finder-1.8.0-py3-none-any.whl

Download URL primer_finder-1.8.0-py3-none-any.whl
Size 82.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8bea081e596b946883e14b386a5dcc6fba7e5d9a51364c0e4f2d1af1b5ce37f7
BLAKE2b-256 checksum
How to use checksums
1318055f5b62a3c8b0f44f6a6a58a342ddc70cbc79d6b4fd9af7322d7d6d523d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

1.8.1

2 release files

This release

1.8.0 This release

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page