Metadata-Version: 2.4
Name: xynergy
Version: 0.0.6
Summary: Drug synergy from minimum drug combination data
Author-email: KaziLab <xynergy@kazilab.se>
License-Expression: MIT
License-File: LICENSE
Keywords: bioinformatics,drug combinations,drug synergy,high-throughput screening,matrix factorization
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.13
Requires-Dist: altair>=5.5.0
Requires-Dist: cvxpy>=1.6.5
Requires-Dist: lmfit>=1.3.3
Requires-Dist: matplotlib>=3.9.0
Requires-Dist: nimfa>=1.4.0
Requires-Dist: numpy-typing>=1.1.1
Requires-Dist: numpy>=2.2.4
Requires-Dist: openpyxl>=3.1.5
Requires-Dist: optuna>=4.3.0
Requires-Dist: pandas>=2.2.0
Requires-Dist: plotly>=6.0.0
Requires-Dist: polars>=1.26.0
Requires-Dist: pyarrow>=20.0.0
Requires-Dist: scikit-learn>=1.6.1
Requires-Dist: scipy>=1.14.0
Requires-Dist: streamlit>=1.40.0
Requires-Dist: xgboost>=3.0.0
Description-Content-Type: text/markdown

# xynergy

Fast and high throughput Drug Synergy Prediction from Minimal Combination Data via Radial Basis Function Surface Interpolation combined with NMF and XGBoost

## Workflow

A typical workflow will involve calling several functions in sequence:

1. `tidy()` - Coaxes your data into a format suitable for downstream analysis
2. `pre_impute()` - Fills in missing experimental points, largely to give full matrices for the next step to factorize
3. `matrix_factorize()` - Approximate the imputed matrix via various matrix factorization algorithms
4. `post_impute()` - Create a final imputed dataframe using matrix factorization results
5. `add_synergy()` - Add columns calculating the synergy at each point under various assumptions (Bliss, Loewe, HSA, and/or ZIP)

xynergy enforces relatively few constraints on the form of your data and in theory allows you to shim in your own data transformations between any of these steps (whether that is a good idea or not is not for me to decide).

An example workflow looks something like this:

``` python
import xynergy as xyn
import xynergy.example as ex

data = ex.load_example_data()

# Normalizes column names so we can use default arguments for downstream functions
clean_data = xyn.tidy(
    data,
    dose_cols=["dose_a", "dose_b"],
    response_col="response",
    experiment_cols=["experiment_source_id", "line", "drug_a", "drug_b", "pair_index"],
)
imputed = xyn.pre_impute(clean_data, method="XGBR")
factored = xyn.matrix_factorize(imputed, method=["SVD", "NMF"])
final = xyn.post_impute(factored)
with_synergy = xyn.add_synergy(final, method=["bliss", "zip"])

```

The bundled workbook lives at `xynergy/example_data/data.xlsx` and is loaded by
`xynergy.example.load_example_data()`. See the tutorial "Using Xynergy" in the
Sphinx documentation for a fuller walkthrough.

## Acknowledgments

This work stands on the shoulders of so many things. In addition to the software packages explicitly and implicitly used in this repo, some code/equations came from other places: 
- The cNMF-like algorithm that came from DECREASE (DOI: 10.1038/s42256-019-0122-4)
- The Venter-mode code that came from the R {modeest} package (DOI: 10.32614/CRAN.package.modeest)
- The closed-form Loewe additivity algorithm from 10.3389/fphar.2018.00031
