Skip to content

Commit

Permalink
Pass vals as ndarray
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyTLin committed May 21, 2024
1 parent aaa0f09 commit 97f0726
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bicytok/MBmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def cytBindingModel(
"""Runs binding model for a given mutein, valency, dose, and cell type."""
# Check that values are in correct placement, can invert
Kx = getKxStar()
ligandConc = dose / (vals[0] * 1e9)
ligandConc = dose / (vals[0][0] * 1e9)

output = polyc(ligandConc, Kx, recCount, vals, recXaffs)[0]

Expand Down
1 change: 1 addition & 0 deletions bicytok/figures/figure1.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def makeFigure():
targets.append(target)
valencies.append(valency)
naming.append("{} ({})".format(target, valency))
valencies = np.array([valencies])

for _, dose in enumerate(doseVec):
optParams = optimizeDesign(
Expand Down
2 changes: 1 addition & 1 deletion bicytok/figures/figure3.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def makeFigure():
epitopesDF = getSampleAbundances(epitopes, cells)

bindings = get_cell_bindings(
epitopesDF, secondary, ["CD25", epitope], affs, 0.1, [valency, valency, valency]
epitopesDF, secondary, ["CD25", epitope], affs, 0.1, np.ndarray([valency, valency, valency])
)
bindings["Percent Bound of Signal Receptor"] = (
bindings["Receptor Bound"] / bindings[secondary]
Expand Down
4 changes: 2 additions & 2 deletions bicytok/figures/figure4.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ def makeFigure():
if i == j:
targetsBoth = [target1]
optAffs = [8.0, 8.0]
valenciesBoth = [signal[1], valencies[i]]
valenciesBoth = np.array([[signal[1], valencies[i]]])
else:
targetsBoth = [target1, target2]
optAffs = [8.0, 8.0, 8.0]
valenciesBoth = [signal[1], valencies[i], valencies[j]]
valenciesBoth = np.array([[signal[1], valencies[i], valencies[j]]])

optParams = optimizeDesign(
signal[0],
Expand Down
2 changes: 1 addition & 1 deletion bicytok/figures/figure5.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def makeFigure():
for val in valencies:
prevOptAffs = [8.0, 8.0, 8.0]
for targets in allTargets:
vals = [signal_valency, val, val]
vals = np.array([[signal_valency, val, val]])

optParams = optimizeDesign(
signal_receptor,
Expand Down
4 changes: 2 additions & 2 deletions bicytok/selectivityFuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def minSelecFunc(
targRecs: pd.DataFrame,
offTRecs: pd.DataFrame,
dose: float,
vals: list,
vals: np.ndarray,
):
"""Serves as the function which will have its return value minimized to get optimal selectivity
To be used in conjunction with optimizeDesign()
Expand Down Expand Up @@ -95,7 +95,7 @@ def optimizeDesign(
offTCells: list,
selectedDF: pd.DataFrame,
dose: float,
valencies: list,
valencies: np.ndarray,
prevOptAffs: list,
cellCat="CellType2",
):
Expand Down
2 changes: 1 addition & 1 deletion bicytok/test/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ def test_optimize_design():
selectedDF=epitopesDF,
dose=0.1,
valencies=[2, 2],
prevOptAffs=[8.0, 8.0],
prevOptAffs=np.array([[8.0, 8.0]]),
)

0 comments on commit 97f0726

Please sign in to comment.