Computing Synergy#
- xynergy.synergy.add_synergy(df, dose_cols: list[str] = ['dose_a', 'dose_b'], response_col: str = 'response', experiment_cols: list[str] | str | None = 'experiment_id', method: list[str] | str = ['bliss', 'hsa', 'loewe', 'zip'], include_ci: bool = False, log: str = 'all')#
Add columns containing the synergy score for a given method.
Parameters#
- df: polars.DataFrame
Usually the output from
tidyor one of its downstream functions- dose_cols: list, default [“dose_a”, “dose_b”]
A list of exactly two columns names that contain untransformed numeric values of agent dose
- response_col: string, default “response”
The name of the column containing responses
- experiment_cols: list[str], string, or None, default “experiment_id”
The names of columns that should be used to distinguish one dose pair’s response from another. If none are supplied, two rows with the same doses will be considered replicates.
- method: list[str] or str, default [“bliss”, “hsa”, “loewe”, “zip”]
The method used for calculating synergy.
- include_ci: bool, default False
If True and “loewe” is in method, also compute the Loewe Combination Index (CI) and add it as a
loewe_cicolumn. CI < 1 indicates synergy, CI = 1 additivity, CI > 1 antagonism.- log: string, default “all”
Verbosity of function. Options include “all”, “warn”, and “none”.
If “all”, will emit notes and warnings.
If “warn”, will emit only warnings.
If “none”, will not emit anything (except errors)
Returns#
- polars.DataFrame
Input with
[method]_syncolumns appended. These columns contain the synergy score, where positive numbers indicate synergy and negative numbers indicate antagonism
Notes#
This function currently implements four models of synergy: Bliss independence, Highest Single Agent (HSA), Loewe additivity, and Zero Interaction Potency (ZIP). A very short description of each is provided below.
Bliss: [1]
The Bliss independence reference model assumes that responses, when reported as fraction survived, can be used like probabilities, and that the expected probability (and thus response) of any given combination is simply
resp_axresp_bat their single-drug (that is, alone, uncombined) response values.Advantages of this model include its interpretability and the fact that it can be calculated from any two single-drug response values without needing any additional information (note that these advantages are not necessarily exclusive to the Bliss model).
HSA:
Highest Single Agent (HSA) predicts that the combined response is the higher of the two’s single agent response.
Advantages of this model is that it is dead simple to calculate and reason with. Like Bliss, it only requires two single-agent doses to calculate the expected combined dose (that is, it does not require you to know the whole fit of the single agent). A glaring disadvantage is that it does not distinguish ‘additivity’ from ‘synergy’, so even the sham case (a drug mixed with itself) will be considered to be synergy in this model. Thus, this model tends to only be useful in instances where one or both agent have no effect by themselves.
Loewe additivity assumes that the combined effect of two drugs will be equal to the response acheived by drug A at (dose A) + (the dose of drug A required to achieve the response of drug B). See below for a more concrete example.
It’s a rather popular measure of synergy, in part because it returns a synergy of 0 in the sham case (drug A combined with drug A).
Loewe additivity has a disadvantage in that it is poorly defined at the edge cases. If drug B achieves a response beyond the maximum effect of drug A, it is nonsensical to talk about the dose of A required to achieve the same effect.
Under this model, the predicted response for 4nM drug B and 10nM drug A is (for example) calculated roughly as follows:
Fit both drugs with a four parameter logistic fit
Determine the response of drug B at 4nM (let’s say it’s 20% inhibition)
Using the fit of drug A, determine what dose gives 20% inhibition (to do this, we use the inverse four-parameter logistic function). Let’s say drug A achieved a 20% inhibition at 50nM.
Add the original dose of drug A (10nM) to the drug B response in terms of drug A dose (50nM) to get the final dose (60nM)
Find the response for drug A at 60nM
Repeat this again, but convert drug A to drug B terms instead
Take the average of the two responses
ZIP: [4]
Zero Interaction Potency is somewhat different from the traditional synergy methods, in that it does not simply subtract the reference from the observed values. Rather, it calculates a synergy score by subtracting a reference model from a ZIP score, both of which will be described below. Due to the fact that it fits observed values before comparing them to a reference, it has a ‘smoothing’ effect.
The reference model for ZIP is very similar to Bliss, except it uses fitted (to a four parameter logisitic fit) values for the single agent dose-responses rather than the raw observed values. This has a tendency to smooth irregularities.
The ZIP score is calculated by fitting each row and column with a three-parameter logistic fit, with the fourth parameter - the minimum effect - fixed to be that row or columns ‘0 drug’ condition (Put another way, if we took a column that had increasing ‘Drug A’, the minimum effect would be where ‘Drug A’ was 0, meaning the minimum effect would be whatever response ‘Drug B’ had at that particular column’s concentration). Each value of the matrix is now described by two equations - the row fit and the column fit. We can get a ZIP score for every point on the matrix by taking the average of the row fit and column fit at each point.
References#