Skip to main content

OPR: Optimized Primer

Project description

OPR: Optimized Primer


Codecov PyPI version built with Python3 GitHub repo size Discord Channel

Overview

OPR is an open-source Python package designed to simplify and streamline primer design and analysis for biologists and bioinformaticians. OPR enables users to design, validate, and optimize primers with ease, catering to a wide range of applications such as PCR, qPCR, and sequencing. With a focus on user-friendliness and efficiency, OPR aims to bridge the gap between biological research and computational tools, making primer-related workflows faster and more reliable.

PyPI Counter
Github Stars
Branch main dev
CI
Code Quality CodeFactor

Installation

PyPI

Source code

Usage

Load

>>> from opr import Primer, MeltingTemperature
>>> primer1 = Primer(sequence="CTGGAGGACGGAAGAGGAAGTAA", salt=50)
>>> primer1.sequence
'CTGGAGGACGGAAGAGGAAGTAA'

Properties

Molecular weight

>>> primer1.molecular_weight
7235.79

GC content

>>> primer1.gc_content
0.5217391304347826

GC clamp

>>> primer1.gc_clamp
1

Single run length

>>> primer1.single_runs
{'A': 2, 'T': 1, 'C': 1, 'G': 2}

Double run length

>>> primer1.double_runs
{'TA': 1, 'TC': 0, 'TG': 1, 'AT': 0, 'AC': 1, 'AG': 2, 'CT': 1, 'CA': 0, 'CG': 1, 'GT': 1, 'GA': 1, 'GC': 0}

Repeats

>>> primer1.repeats(sequence="GG", consecutive=False)
4
>>> primer1.repeats(sequence="GG", consecutive=True)
1

Melting temperature

Basic
>>> primer1.melting_temperature()
57.056521739130446
>>> primer1.melting_temperature(MeltingTemperature.BASIC)
57.056521739130446
Salt-adjusted
>>> primer1.melting_temperature(MeltingTemperature.SALT_ADJUSTED)
64.64203250676053
Nearest neighbor
>>> primer1.melting_temperature(MeltingTemperature.NEAREST_NEIGHBOR)
66.42693710590595

Thermodynamic Constants

Enthalpy change (ΔH)
>>> primer1.delta_h
-174.99999999999997
Entropy change (ΔS)
>>> primer1.delta_s
-0.44210000000000005

Extinction Coefficient at 260 nm (E260)

>>> primer1.E260
248.40000000000006

Molecular Formula

>>> primer1.molecular_formula
'C228 H279 N105 O129 P22'

Operations

Reverse

>>> primer1_reversed = primer1.reverse()
>>> primer1_reversed.sequence
'AATGAAGGAGAAGGCAGGAGGTC'

Complement

>>> primer1_complemented = primer1.complement()
>>> primer1_complemented.sequence
'GACCTCCTGCCTTCTCCTTCATT'

To RNA

>>> oprimer_rna = oprimer.to_rna()
>>> oprimer_rna
'CUGGAGGACGGAAGAGGAAGUAA'

To protein

>>> oprimer_protein = oprimer.to_protein(frame=3)
>>> oprimer_protein
'GGRKRK*'
>>> oprimer_protein_aa3 = oprimer.to_protein(frame=3, multi_letter=True)
>>> oprimer_protein_aa3
'Gly-Gly-Arg-Lys-Arg-Lys-Stop'

ℹ️ When the frame=3 it starts from the third nucleotide. The list of codons is then [GGA(G), GGA(G), CGG(R), AAG(K), AGG(R), AAG(K), TAA(STOP)]

ℹ️ Stop signal is marked as * in OPR

Issues & bug reports

Just fill an issue and describe it. We'll check it ASAP! or send an email to opr@openscilab.com.

  • Please complete the issue template

You can also join our discord server

Discord Channel

References

1- Oligo Calc: Oligonucleotide Properties Calculator
2- Marmur, Julius, and Paul Doty. "Determination of the base composition of deoxyribonucleic acid from its thermal denaturation temperature." Journal of molecular biology 5.1 (1962): 109-118.
3- Wallace, R. Bruce, et al. "Hybridization of synthetic oligodeoxyribonucleotides to Φ X 174 DNA: the effect of single base pair mismatch." Nucleic acids research 6.11 (1979): 3543-3558.
4- Panjkovich, Alejandro, and Francisco Melo. "Comparison of different melting temperature calculation methods for short DNA sequences." Bioinformatics 21.6 (2005): 711-722.
5- ATDBio - Oligo Calculator

Show your support

Star this repo

Give a ⭐️ if this project helped you!

Donate to our project

If you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .

OPR Donation

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

0.6 - 2025-11-02

Added

  • molecular_formula property

Changed

  • README.md updated
  • Test system modified
  • Python 3.14 added to test.yml

0.5 - 2025-06-27

Added

  • delta_h property
  • delta_s property
  • Thermodynamic constants (ΔH, ΔS) calculation
  • Nearest neighbor melting temperature calculation
  • to_protein method
  • protein_seq_calc function

Changed

  • Python typing features added to all modules
  • Test system modified
  • Python 3.6 support dropped
  • README.md updated

0.4 - 2025-03-18

Added

  • Salt-adjusted melting temperature calculation
  • __contains__ overload
  • _computed internal cache flag attribute
  • is_computed method
  • to_rna method
  • E260 property

Changed

  • Cache structure in Primer class updated
  • Error tests updated
  • Cache Test system modified
  • Primer class __eq__ method bug fixed
  • README.md updated

0.3 - 2025-02-06

Added

  • __iter__ overload
  • double_runs property
  • repeats method
  • name property

Changed

  • single_runs property updated
  • Test system modified

Removed

  • single_run_length function

0.2 - 2025-01-09

Added

  • __eq__ overload
  • __str__ overload
  • gc_clamp property
  • single_runs property

Changed

  • Test system modified
  • SECURITY.md updated
  • CONTRIBUTING.md updated
  • README.md updated

Removed

  • property deleter & setter

0.1 - 2024-11-27

Added

  • MeltingTemperature enum
  • Basic melting temperature calculation
  • addition and multipication operators overload
  • len magic overload
  • Primer class
  • Molecular weight calculation
  • GC content calculation
  • Sequence validation
  • Unit tests
  • complement method
  • reverse method

Download files

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

Source Distribution

opr-0.6.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

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

opr-0.6-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file opr-0.6.tar.gz.

File metadata

  • Download URL: opr-0.6.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for opr-0.6.tar.gz
Algorithm Hash digest
SHA256 46159e6734e6e02be1b20281e01e37b1c42bf0ac99d228903a965e2f44c2693d
MD5 43cd7a4a128dfb35904d6d2694438fa0
BLAKE2b-256 61718c032fede88f623541f337b3e9389b38293f7962d077a6c852616f89bd5d

See more details on using hashes here.

File details

Details for the file opr-0.6-py3-none-any.whl.

File metadata

  • Download URL: opr-0.6-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for opr-0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d3983f2986a8a6e33abb4544ebce2ef312231c7aea9e9d6c4c4e779c9e3a624c
MD5 9437887c938facc620db7f83f59d364f
BLAKE2b-256 3c6e437daa7fad4348d93aaa81dcc80c8d70a5d173eeaa51791abf261d2ff97e

See more details on using hashes here.

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