Skip to content

Commit

Permalink
tests for basic melting temperature calculations added
Browse files Browse the repository at this point in the history
  • Loading branch information
AHReccese committed Oct 7, 2024
1 parent 89f44bf commit 58e691a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/test_calculations.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
from opr import Primer
from opr.primer import MeltingTemperatureMode

TEST_CASE_NAME = "Calculations tests"

def test_mwc():
oprimer = Primer("ATCGATCGATCGATCGAT")
assert round(oprimer.molecular_weight, 1) == 5498.7


def test_gc_content_1(): #Reference: https://jamiemcgowan.ie/bioinf/gc_content.html
oprimer = Primer("ATCG")
assert oprimer.gc_content == 0.5


def test_gc_content_2(): #Reference: https://jamiemcgowan.ie/bioinf/gc_content.html
oprimer = Primer("ATTCG")
assert oprimer.gc_content == 0.4

def test_gc_content_3(): #Reference: https://jamiemcgowan.ie/bioinf/gc_content.html
oprimer = Primer("ATTTTTT")
assert oprimer.gc_content == 0

def test_melt_temp_1(): #Reference: http://biotools.nubic.northwestern.edu/OligoCalc.html
oprimer = Primer("ATCGATCGATCGATCGATCG")
assert round(oprimer.melting_temperature[MeltingTemperatureMode.BASIC],1) == 51.8

def test_melt_temp_2(): #Reference: http://biotools.nubic.northwestern.edu/OligoCalc.html
oprimer = Primer("ATCG")
print(oprimer.melting_temperature)
assert round(oprimer.melting_temperature[MeltingTemperatureMode.BASIC],1) == 12

0 comments on commit 58e691a

Please sign in to comment.