<p>To get you started. Complex editing in matplotlib isn't intuitive.</p>
<pre><code>#!/usr/bin/env python3

from numpy import linspace, sin
# you don't need math its just to get the value of pi for this data
import math 
import matplotlib.pyplot as plt


xaxis = linspace(1,1.75*math.pi,10)
drug2 = linspace(1,1.45*math.pi,10)

drug1 = sin(xaxis)
drug2b = sin(drug2)
plt.plot(xaxis, drug1, xaxis, drug2b)
plt.legend(['Drug 1', 'Drug 2'])
plt.show()
</code></pre>
<p><a href="https://i.sstatic.net/MHoue.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MHoue.png" alt="enter image description here" /></a></p>
<p>The authors look to have curve fitted and for that you would use <code>import scipy.optimize as opt</code></p>

CC BY-SA 4.0
2022-04-07T20:54:08.887Z
shouldnt be drug1+drug2 ?
pippo1980
CC BY-SA 4.0
2022-04-07T21:04:48.157Z
Better written as Expected and Observed but it is entirely hypothetical to demonstrate matplotlib.
M__
CC BY-SA 4.0
2022-04-06T12:47:51.410Z
2022-04-06T14:34:58.360Z
2022-04-06T14:34:58.360Z
M__
<p>I want to replicate the synergy drug response curve with the Python library given in the following paper.
Could you kindly advice on:</p>
<ul>
<li>Suitable graphics libraries for Python</li>
<li>Code or pseudo code</li>
</ul>
<p>Apologies because I don't currently have a test code.</p>
<p>I would really appreciate if anyone could guide me in this.
Thank you in advance.</p>
<p>Fig 1a</p>
<p><a href="https://www.nature.com/articles/s41586-022-04437-2/figures/1" rel="nofollow noreferrer">https://www.nature.com/articles/s41586-022-04437-2/figures/1</a></p>
<p><a href="https://i.sstatic.net/OTRxc.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/OTRxc.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2022-04-06T12:27:54.083Z
The two major graphics packages in Python are matplotlib and seaborn. The very best graphics package (in my opinion - hence its a comment) is R's ggplot2. To do this in Python you usually use either a pandas Dataframe or Numpy. This example looks like curve fitting
M__
CC BY-SA 4.0
2022-04-07T20:50:06.247Z
for which one of the 2025 combinations ?
pippo1980
CC BY-SA 4.0
2022-04-07T21:18:26.303Z
https://www.nature.com/articles/s41586-022-04437-2/figures/5 should help ?? To me its just a faith thing
pippo1980
CC BY-SA 4.0
2022-04-07T22:10:08.287Z
https://pypi.org/project/synergy/  A python package to calculate, analyze, and visualize drug combination synergy and antagonism. Currently supports multiple models of synergy, including MuSyC, Bliss, Loewe, Combination Index, ZIP, Zimmer, BRAID, Schindler, and HSA.
pippo1980
CC BY-SA 4.0
2022-04-07T23:43:04.960Z
This is a separate question.
M__
CC BY-SA 4.0
2022-04-09T12:32:23.680Z
@pippo1980 as per understanding between the delta IC50 and Emax of 108,259 combi_id's present in the file shared with figshare
Riya
CC BY-SA 4.0
2022-04-09T16:10:53.313Z
Not sure there is one one way to obtain a Bliss curve (https://www.frontiersin.org/articles/10.3389/fphar.2017.00158/full) wasnt able to find the equation/bliss model they used but I did a superfast speed read of the article
pippo1980
CC BY-SA 4.0
2022-04-09T16:57:03.063Z
Mmmmh Think I should start from scratch (Ic50 Ec50 single agent ).. then try tonunderstand synergy... this pic through me off https://els-jbs-prod-cdn.jbs.elsevierhealth.com/cms/attachment/43469fda-2391-474f-a97f-4a7307fa6f99/gr1.jpg
pippo1980
CC BY-SA 4.0
2022-04-09T17:08:17.747Z
@pippo1980 same here :)
Riya
CC BY-SA 4.0
2022-04-09T17:56:08.480Z
here found something in methods:  Conceptually, every point on the Bliss dose response curve is defined as the product between the anchor viability and the corresponding point on the library dose response curve. Shifts in potency (∆IC50) and in efficacy (∆Emax) were calculated as the difference between the observed combination response and expected Bliss (∆IC50 = Bliss IC50 − combination IC50, and ∆Emax = Bliss Emax − combination Emax). ∆IC50 is reported on a log2 scale.
pippo1980
<python><drugs>
How to create drug synergy plot?
# How to create drug synergy plot?

(Asked by: username_0 on 2022-04-06)

I want to replicate the synergy drug response curve with the Python library given in the following paper.
Could you kindly advice on:

* Suitable graphics libraries for Python
* Code or pseudo code

Apologies because I don't currently have a test code.

I would really appreciate if anyone could guide me in this.
Thank you in advance.

Fig 1a

<https://www.nature.com/articles/s41586-022-04437-2/figures/1>

[![enter image description here](https://i.sstatic.net/OTRxc.png)](https://i.sstatic.net/OTRxc.png)

**Tags:** python, drugs
> **Comments:**
> **username_1**: The two major graphics packages in Python are matplotlib and seaborn. The very best graphics package (in my opinion - hence its a comment) is R's ggplot2. To do this in Python you usually use either a pandas Dataframe or Numpy. This example looks like curve fitting  
> **username_2**: for which one of the 2025 combinations ?  
> **username_2**: https://www.nature.com/articles/s41586-022-04437-2/figures/5 should help ?? To me its just a faith thing  
> **username_2**: https://pypi.org/project/synergy/  A python package to calculate, analyze, and visualize drug combination synergy and antagonism. Currently supports multiple models of synergy, including MuSyC, Bliss, Loewe, Combination Index, ZIP, Zimmer, BRAID, Schindler, and HSA.  
> **username_1**: This is a separate question.  
> **username_0**: @pippo1980 as per understanding between the delta IC50 and Emax of 108,259 combi_id's present in the file shared with figshare  
> **username_2**: Not sure there is one one way to obtain a Bliss curve (https://www.frontiersin.org/articles/10.3389/fphar.2017.00158/full) wasnt able to find the equation/bliss model they used but I did a superfast speed read of the article  
> **username_2**: Mmmmh Think I should start from scratch (Ic50 Ec50 single agent ).. then try tonunderstand synergy... this pic through me off https://els-jbs-prod-cdn.jbs.elsevierhealth.com/cms/attachment/43469fda-2391-474f-a97f-4a7307fa6f99/gr1.jpg  
> **username_0**: @pippo1980 same here :)  
> **username_2**: here found something in methods:  Conceptually, every point on the Bliss dose response curve is defined as the product between the anchor viability and the corresponding point on the library dose response curve. Shifts in potency (∆IC50) and in efficacy (∆Emax) were calculated as the difference between the observed combination response and expected Bliss (∆IC50 = Bliss IC50 − combination IC50, and ∆Emax = Bliss Emax − combination Emax). ∆IC50 is reported on a log2 scale.  

---

## 1 answers

### Answer by username_1 on 2022-04-06. Score: 1 | Accepted answer

To get you started. Complex editing in matplotlib isn't intuitive.
#!/usr/bin/env python3

from numpy import linspace, sin
# you don't need math its just to get the value of pi for this data
import math 
import matplotlib.pyplot as plt


xaxis = linspace(1,1.75*math.pi,10)
drug2 = linspace(1,1.45*math.pi,10)

drug1 = sin(xaxis)
drug2b = sin(drug2)
plt.plot(xaxis, drug1, xaxis, drug2b)
plt.legend(['Drug 1', 'Drug 2'])
plt.show()


The authors look to have curve fitted and for that you would use import scipy.optimize as opt

> **Comments:**
> **username_2**: shouldnt be drug1+drug2 ?  
> **username_1**: Better written as Expected and Observed but it is entirely hypothetical to demonstrate matplotlib.  

---

