Skip to main content

A PrIMEr infereNce TOolkit to facilitate large-scale calling of metabarcoding amplicon sequence variants

Project description

PIMENTO

A PrIMEr infereNce TOolkit to facilitate large-scale calling of metabarcoding amplicon sequence variants.

How PIMENTO works

PIMENTO’s employs a dual primer inference strategy, which are:

  • Standard primer search: based on fuzzy regex search queries to a library of curated standard primer sequences.
  • Primer cutoff prediction: based on the identification of the primer cutoff point from analysis of patterns of base-conservation at the beginning (and end, for single-end libraries) of reads. Consensus sequences are then generated as inferred primers using the predicted cutoff.

PIMENTO also implements an "are there primers?" function to predict the presence of primers in sequencing reads in case no standard primer was found. This method is helpful in cases where it isn't known whether primer sequences are still present in the reads, and checking manually would not be trivial, i.e. for large-scale analysis pipelines.

How to install

PIMENTO is available on PyPi. To install it from PyPi with pip just run:

pip install mi-pimento

PIMENTO is also available on bioconda and can be installed like this with conda/mamba:

conda install -c bioconda mi-pimento

How to run

PrimerInferenceWorkflow

You can run either PIMENTO strategy with a single command. The tool will look for primers on either end, so both strategies will work on paired-end, single-end, or merged paired-end sequencing reads (though you would have to run it twice unmerged paired-end sequencing reads, one for each end).

pimento --help
Usage: pimento [OPTIONS] COMMAND [ARGS]...

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  are_there_primers     Predict whether primers are present in the input reads
  auto                  Perform the primer cutoff strategy for primer
                        inference
  choose_primer_cutoff  Choose the optimal primer cutoff point.
  find_cutoffs          Find potential cutoffs using a BCV output.
  gen_bcv               Generate the base-conservation vector(s) (BCV)
  std                   Perform the standard primer strategy for primer
                        inference

Standard primer matching

To run the standard primer strategy:

pimento std -i <fastq/fastq.gz> -p <primers_dir> -o <output_prefix> --merged

Inputs

-i <fastq/fastq.gz>: the input FASTQ reads file.

-p <primers_dir>: the path to the standard primers library to be used, with the default being PIMENTO's library. You can use your own library, or extend PIMENTO's. If using a different library than the default, make sure the primer FASTA files have this format:

>341F
CCTACGGGNGGCWGCAG
>338F
ACTCCTACGGGAGGCAGCA
>805R
GACTACHVGGGTATCTAATCC
>785R
CTACCAGGGTATCTAATCC

Where forward strand primers have the character F as the final character, and vice versa R for reverse strand primers.

-o <output_prefix>: the prefix to be used on output files.

--merged: this optional flag should be used when dealing with either merged paired-end reads, or single-end reads, so that PIMENTO can correctly identify reverse-orientation primers

-t <threads>: this optional parameter allows you to specify the number of threads to be used for the search. Default of 1.

Outputs

<output_prefix>_std_primers.fasta: FASTA file containing the best found single or pairs of primers. Empty if none were found.

<output_prefix>_std_primer_out.txt: Text file containing the read proportions of the best found primers.

all_standard_primer_proportions.txt: Text file logging all the read proportions for every single searched primer.

Primer cutoff prediction

To run the primer cutoff strategy:

pimento auto -i <fastq/fastq.gz> -st [FR/F/R] -o <output_prefix>

NB: Running pimento auto executes the three subcommands generate_bcv, find_cutoffs, choose_primer_cutoff sequentially. You can therefore run each step of this workflow individually if you wish.

Inputs

-i <fastq/fastq.gz>: the input FASTQ reads file.

-st [FR/F/R]: the selection of strands to perform primer inference for - F for forward, R for reverse, FR for both.

-o <output_prefix>: the prefix to be used on output files.

Outputs

<output_prefix>_auto_primers.fasta: FASTA file containing the inferred primer sequences using the predicted optimal cutoffs.

Are there primers?

To run the "are there primers?" utility:

pimento are_there_primers -i <fastq/fastq.gz> -o <output_prefix>

Inputs

-i <fastq/fastq.gz>: the input FASTQ reads file.

-o <output_prefix>: the prefix to be used on output files.

Outputs

<output_prefix>_general_primer_out.txt: Text file containing a 1 or 0 depending on if a primer was found on the forward strand (first line) and the reverse strand (second line).

Licensing

All of the source code making up PIMENTO in this repository is licensed under the terms of the Apache 2.0 license. The standard primer library files and the unit test data files are licensed under the terms of the CC0 1.0 Universal (CC0 1.0) licence.

Citations

If you use PIMENTO in your work, please cite the Biorxiv pre-print:

PIMENTO: A PrIMEr infereNce TOolkit to facilitate large-scale calling of amplicon sequence variants

Christian Atallah, Lorna Richardson, Martin Beracochea, Robert D. Finn

bioRxiv 2025.07.04.663168; doi: https://doi.org/10.1101/2025.07.04.663168

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mi_pimento-1.0.3.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mi_pimento-1.0.3-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file mi_pimento-1.0.3.tar.gz.

File metadata

  • Download URL: mi_pimento-1.0.3.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mi_pimento-1.0.3.tar.gz
Algorithm Hash digest
SHA256 f8ac3faf1aea7fba5761158d420b8c97812a49da82af1a0f0fb841402855da6b
MD5 3cefd8b01208c0c3e2bf28d34ecfcdca
BLAKE2b-256 155459f71ca59a8d0692a8ade485364bc43bf8c727990df09b15e06eeb0aaf9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mi_pimento-1.0.3.tar.gz:

Publisher: python-publish.yml on EBI-Metagenomics/PIMENTO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mi_pimento-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: mi_pimento-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 33.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mi_pimento-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 537de852d5855b6cc930cecbf6ad25069d241759c5c8612e3388b5d07cce528c
MD5 7b67c60f9794f2a6e349d657cd0c45d8
BLAKE2b-256 c886933fc5d234738f4498af4774dc0b4dff03a03858e2cde9282e6aeb436852

See more details on using hashes here.

Provenance

The following attestation bundles were made for mi_pimento-1.0.3-py3-none-any.whl:

Publisher: python-publish.yml on EBI-Metagenomics/PIMENTO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page