Skip to content

Commit

Permalink
Add unit test for binding model
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyTLin committed Jun 4, 2024
1 parent af875e1 commit c1c6357
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion bicytok/test/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import numpy as np
import pandas as pd

from bicytok.selectivityFuncs import calcReceptorAbundances, optimizeSelectivityAffs
from bicytok.selectivityFuncs import calcReceptorAbundances, optimizeSelectivityAffs, get_affs
from bicytok.MBmodel import cytBindingModel


def test_optimize_design():
Expand All @@ -27,3 +28,13 @@ def test_optimize_design():
valencies=np.array([[2, 2]]),
prevOptAffs=[8.0, 8.0],
)


def test_binding_model():
assert cytBindingModel(recCount=np.array([4000., 3400.]), recXaffs=get_affs(np.array([8., 8.])),
dose=0.1, vals=np.array([[1, 1]])) == 4.070165414304938e-5
assert cytBindingModel(recCount=np.array([6000., 2100.]), recXaffs=get_affs(np.array([7.6, 8.2])),
dose=1., vals=np.array([[4, 4]])) == 0.0009870173680610606
assert cytBindingModel(recCount=np.array([4000., 3400., 5700., 33800.]),
recXaffs=get_affs(np.array([8.9, 7.0, 8.0, 8.0])), dose=0.1,
vals=np.array([[1, 4, 4, 4]])) == 0.017104443169046135

0 comments on commit c1c6357

Please sign in to comment.