Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T20:54:08.887Z
Answers.Text: shouldnt be drug1+drug2 ?
Answers.UserDisplayName: pippo1980
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T21:04:48.157Z
Answers.Text: Better written as Expected and Observed but it is entirely hypothetical to demonstrate matplotlib.
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-06T12:47:51.410Z
Answers.LastActivityDate: 2022-04-06T14:34:58.360Z
Answers.LastEditDate: 2022-04-06T14:34:58.360Z
Answers.UserDisplayName: M__
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-06T12:27:54.083Z
Comments.Text: 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
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-07T20:50:06.247Z
Comments.Text: for which one of the 2025 combinations ?
Comments.UserDisplayName: pippo1980
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-07T21:18:26.303Z
Comments.Text: https://www.nature.com/articles/s41586-022-04437-2/figures/5 should help ?? To me its just a faith thing
Comments.UserDisplayName: pippo1980
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-07T22:10:08.287Z
Comments.Text: 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.
Comments.UserDisplayName: pippo1980
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-07T23:43:04.960Z
Comments.Text: This is a separate question.
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-09T12:32:23.680Z
Comments.Text: @pippo1980 as per understanding between the delta IC50 and Emax of 108,259 combi_id's present in the file shared with figshare
Comments.UserDisplayName: Riya
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-09T16:10:53.313Z
Comments.Text: 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
Comments.UserDisplayName: pippo1980
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-09T16:57:03.063Z
Comments.Text: 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
Comments.UserDisplayName: pippo1980
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-09T17:08:17.747Z
Comments.Text: @pippo1980 same here :)
Comments.UserDisplayName: Riya
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-09T17:56:08.480Z
Comments.Text: 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.
Comments.UserDisplayName: pippo1980
Tags: <python><drugs>
Title: How to create drug synergy plot?
ThreadText: # 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**: @username_2 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**: @username_2 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()
  
  ```
  
  [![enter image description here](https://i.sstatic.net/MHoue.png)](https://i.sstatic.net/MHoue.png)
  
  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.  
  
  ---
  
  