I know this is an old question, but since it had no replies and shows up in google, I wanted to answer.

I created a Python package for calculating synergy using many models on pypi and github. It implements Loewe, Bliss, HSA, MuSyC, BRAID, ZIP, Schindler's multidimensional Hill, Zimmer's effective dose model, and combination index.

Some models are parametric, while the others are dose-dependent. Here is an example of basic usage for both kinds (using MuSyC (a parametric model) and Bliss (a dose-dependent model) as examples). The data is assumed to be in a .csv spreadsheet with columns for "drug1.conc", "drug2.conc", and "effect"

```
import pandas as pd
from synergy.combination import MuSyC
from synergy.combination import Bliss
# Other models are available too
# Read the data
df = pd.read_csv("dataset.csv")
d1 = df['drug1.conc']
d2 = df['drug2.conc']
E = df['effect']
# Instantiate synergy model(s)
model_musyc = MuSyC()
model_bliss = Bliss()
# Calculate synergy
model_musyc.fit(d1, d2, E)
model_bliss.fit(d1, d2, E)
# Get results
print(model_musyc.get_parameters()) # MuSyC is a parametric model, so synergy is encoded in its parameters
print(model_bliss.synergy) # Bliss is dose-dependent, so synergy is an array the same size as d1, d2, or E
# Make plots
# Surface plots require plotly
model_musyc.plot_surface_plotly(d1, d2, scatter_points=df, fname="MuSyC_surface.html")
model_bliss.plot_surface_plotly(fname="Bliss_surface.pdf")
# Heatmaps require matplotlib
model_musyc.plot_heatmap(d1, d2, fname="MuSyC_heatmap.pdf")
model_bliss.plot_heatmap(fname="Bliss_heatmap.pdf")
```

Notes:

- Most models expect drugs to cause "effect" to decrease, such as
is the case with proliferation or viability assays
- Assays measuring percents should be on a 0 to 1 scale, not 0 to 100
- Doses should be raw (e.g., not log-transformed), though they will be
log-transformed in the plots. This can be overridden by passing the
argument
`logscale=False`

in `plot_heatmap()`

or `plot_surface()`

Combos of three of more drugs are supported for most models. Usage is similar, except for the following points

- Models should be imported as
`from synergy.higher import MuSyC # etc...`

- Doses are not separated as
`d1`

and `d2`

, but should be in a single M x N array (M is the number of samples, N is the number of drugs). So to calculate synergy you use `model.fit(d, E)`

Isosurface plots are supported if you have plotly installed, as `model.plotly_isosurfaces()`

. For parametric models, you have to pass `d`

as an argument, for dose-dependent models, `d`

is remembered from `model.fit(d,E)`

.

.

•

link
modified 8 weeks ago
•
written
9 weeks ago by
dwooten • **10**