OPR: Optimized Primer
Project description
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 |
Installation
PyPI
- Check Python Packaging User Guide
- Run
pip install opr==0.6
Source code
- Download Version 0.6 or Latest Source
- Run
pip install .
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
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 ;-) .
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_formulaproperty
Changed
README.mdupdated- Test system modified
Python 3.14added totest.yml
0.5 - 2025-06-27
Added
delta_hpropertydelta_sproperty- Thermodynamic constants (ΔH, ΔS) calculation
- Nearest neighbor melting temperature calculation
to_proteinmethodprotein_seq_calcfunction
Changed
- Python typing features added to all modules
- Test system modified
Python 3.6support droppedREADME.mdupdated
0.4 - 2025-03-18
Added
- Salt-adjusted melting temperature calculation
__contains__overload_computedinternal cache flag attributeis_computedmethodto_rnamethodE260property
Changed
- Cache structure in
Primerclass updated - Error tests updated
- Cache Test system modified
Primerclass__eq__method bug fixedREADME.mdupdated
0.3 - 2025-02-06
Added
__iter__overloaddouble_runspropertyrepeatsmethodnameproperty
Changed
single_runsproperty updated- Test system modified
Removed
single_run_lengthfunction
0.2 - 2025-01-09
Added
__eq__overload__str__overloadgc_clamppropertysingle_runsproperty
Changed
- Test system modified
SECURITY.mdupdatedCONTRIBUTING.mdupdatedREADME.mdupdated
Removed
propertydeleter & setter
0.1 - 2024-11-27
Added
MeltingTemperatureenum- Basic melting temperature calculation
additionandmultipicationoperators overloadlenmagic overloadPrimerclass- Molecular weight calculation
- GC content calculation
- Sequence validation
- Unit tests
complementmethodreversemethod
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46159e6734e6e02be1b20281e01e37b1c42bf0ac99d228903a965e2f44c2693d
|
|
| MD5 |
43cd7a4a128dfb35904d6d2694438fa0
|
|
| BLAKE2b-256 |
61718c032fede88f623541f337b3e9389b38293f7962d077a6c852616f89bd5d
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3983f2986a8a6e33abb4544ebce2ef312231c7aea9e9d6c4c4e779c9e3a624c
|
|
| MD5 |
9437887c938facc620db7f83f59d364f
|
|
| BLAKE2b-256 |
3c6e437daa7fad4348d93aaa81dcc80c8d70a5d173eeaa51791abf261d2ff97e
|