Skip to content
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d941da5
Merge pull request #113 from daisybio/development
JudithBernett Jan 30, 2025
9fd758b
Merge pull request #114 from daisybio/development
PascalIversen Jan 30, 2025
431d252
Merge pull request #124 from daisybio/development
PascalIversen Feb 12, 2025
7680579
Merge pull request #132 from daisybio/development
JudithBernett Feb 21, 2025
b440b81
Merge pull request #133 from daisybio/development
PascalIversen Feb 21, 2025
a0a5140
Merge pull request #138 from daisybio/development
PascalIversen Feb 25, 2025
327a1ac
Merge pull request #140 from daisybio/development
JudithBernett Feb 28, 2025
20dd7f6
Merge pull request #143 from daisybio/development
JudithBernett Mar 2, 2025
5d4876a
Merge pull request #157 from daisybio/development
JudithBernett Mar 6, 2025
5b1ce9e
Merge pull request #160 from daisybio/development
JudithBernett Mar 7, 2025
89f399b
Merge pull request #171 from daisybio/development
JudithBernett Mar 21, 2025
7c18391
Merge pull request #182 from daisybio/development
PascalIversen Apr 4, 2025
fdd45e6
Merge pull request #207 from daisybio/development
JudithBernett May 1, 2025
4fe8bd1
Merge pull request #211 from daisybio/development
JudithBernett May 9, 2025
3618669
Merge pull request #226 from daisybio/development
JudithBernett Jun 16, 2025
842d063
Merge branch 'main' of github.com:daisybio/drevalpy
JudithBernett Jun 16, 2025
c033812
Merge branch 'development'
JudithBernett Jun 16, 2025
1d26871
Merge pull request #227 from daisybio/development
JudithBernett Jun 16, 2025
27ca39b
Merge pull request #238 from daisybio/development
JudithBernett Jun 23, 2025
975afa6
CLI first commit (drevalpy --help and drevalpy-report --help
PascalIversen Jun 25, 2025
499ccba
mypy
PascalIversen Jun 25, 2025
51f9670
Rename tests/test_run_suite.py to tests/test_main.py
PascalIversen Jun 25, 2025
c16e947
test update
PascalIversen Jun 25, 2025
08a7090
fixing typeguard
JudithBernett Jun 26, 2025
7107066
updating which functions are used in the pipeline
JudithBernett Jun 26, 2025
a3ed0e5
updated quickstart
PascalIversen Jun 26, 2025
14073d9
fixing mypy
JudithBernett Jun 26, 2025
2c8a654
Merge remote-tracking branch 'origin/cli' into cli
JudithBernett Jun 26, 2025
0d25b9e
fix nn for small datasets
PascalIversen Jun 26, 2025
4f9afb0
merge
PascalIversen Jun 26, 2025
8697fa1
merge
PascalIversen Jun 26, 2025
4e11049
docu
PascalIversen Jun 26, 2025
455b775
docu2
PascalIversen Jun 26, 2025
8027903
update docker.
PascalIversen Jun 26, 2025
83962fc
colab
PascalIversen Jun 26, 2025
7ca9d4e
test demo
PascalIversen Jun 26, 2025
8e61ac1
peotry LOCK
PascalIversen Jun 26, 2025
e4351f3
fixes, more error handling
PascalIversen Jun 26, 2025
17e1279
NME baseline ALWAYS
PascalIversen Jun 26, 2025
612c8dd
dont need it doubled
PascalIversen Jun 26, 2025
8120f99
delete output
PascalIversen Jun 26, 2025
dfa04e6
testing notebooks is annoying
PascalIversen Jun 26, 2025
b1e2fe5
clean demo
PascalIversen Jun 26, 2025
6a74a7d
mypy
PascalIversen Jun 26, 2025
44c101f
type
PascalIversen Jun 27, 2025
8d04b4d
rm nbformat. not needed anymore
PascalIversen Jun 27, 2025
399ece2
harmonize curve curator args with pipeline
PascalIversen Jun 27, 2025
db29632
curve curatingggggg
PascalIversen Jun 27, 2025
fd01238
fix test
PascalIversen Jun 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ COPY --from=builder /usr/local/bin /usr/local/bin
# Copy all relevant code

COPY drevalpy ./drevalpy
COPY create_report.py ./
COPY README.md ./
COPY run_suite.py ./
COPY pyproject.toml ./
COPY poetry.lock ./

Expand Down
78 changes: 33 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,21 @@ pip install poetry-plugin-export
poetry install
```

Check your installation by running in your console:

```bash
drevalpy --help
```

## Quickstart

To run models from the catalog, you can run:

```bash
python run_suite.py --run_id my_first_run --models NaiveTissueMeanPredictor NaiveDrugMeanPredictor --baselines NaiveMeanEffectsPredictor --dataset TOYv1 --test_mode LCO
drevalpy --run_id my_first_run --models NaiveTissueMeanPredictor NaiveDrugMeanPredictor --dataset TOYv1 --test_mode LCO
```

This will train our baseline models which just predict the drug or tissue means or the mean drug and cell line effects.
This will download a small toy drug response dataset, train our baseline models which just predict the drug or tissue means or the mean drug and cell line effects.
It will evaluate in "LCO" which is the leave-cell-line-out splitting strategy using 7 fold cross validation.
The results will be stored in

Expand All @@ -91,10 +97,10 @@ results/my_first_run/TOYv1/LCO
You can visualize them using

```bash
python create_report.py --run_id my_first_run --dataset TOYv1
drevalpy-report --run_id my_first_run --dataset TOYv1
```

This will create an index.html file which you can open in your web browser.
This will create an index.html file in the results directory which you can open in your web browser.

You can also run a drug response experiment using Python:

Expand All @@ -103,56 +109,38 @@ from drevalpy.experiment import drug_response_experiment
from drevalpy.models import MODEL_FACTORY
from drevalpy.datasets import AVAILABLE_DATASETS

naive_mean = MODEL_FACTORY["NaiveMeanEffectsPredictor"]
rf = MODEL_FACTORY["RandomForest"]
simple_nn = MODEL_FACTORY["SimpleNeuralNetwork"]
from drevalpy.experiment import drug_response_experiment

naive_mean = MODEL_FACTORY["NaivePredictor"] # a naive model that just predicts the training mean
enet = MODEL_FACTORY["ElasticNet"] # An Elastic Net based on drug fingerprints and gene expression of 1000 landmark genes
simple_nn = MODEL_FACTORY["SimpleNeuralNetwork"] # A neural network based on drug fingerprints and gene expression of 1000 landmark genes

toyv2 = AVAILABLE_DATASETS["TOYv2"](path_data="data", measure="LN_IC50_curvecurator")
toyv1 = AVAILABLE_DATASETS["TOYv1"](path_data="data")

drug_response_experiment(
models=[rf, simple_nn],
baselines=[naive_mean],
response_data=toyv2,
metric="RMSE",
n_cv_splits=7,
test_mode="LCO",
run_id="my_second_run",
path_data="data",
hyperparameter_tuning=False,
)
models=[enet, simple_nn],
baselines=[naive_mean], # Ablation studies and robustness tests are not run for baselines.
response_data=toyv1,
n_cv_splits=2, # the number of cross validation splits. Should be higher in practice :)
test_mode="LCO", # LCO means Leave-Cell-Line out. This means that the test and validation splits only contain unseed cell lines.
run_id="my_first_run",
path_data="data", # where the downloaded drug response and feature data is stored
path_out="results", # results are stored here :)
hyperparameter_tuning=False) # if True (default), hyperparameters of the models and baselines are tuned.
```

This will run the Random Forest and Simple Neural Network models on the CTRPv2 dataset, using the Naive Mean Effects Predictor as a baseline. The results will be stored in `results/my_second_run/CTRPv2/LCO`.
To obtain evaluation metrics, you can use:

```python
from drevalpy.visualization.utils import parse_results, prep_results, write_results
import pathlib

# load data, evaluate per CV run
(
evaluation_results,
evaluation_results_per_drug,
evaluation_results_per_cell_line,
true_vs_pred,
) = parse_results(path_to_results="results/my_second_run", dataset='TOYv2')
# reformat, calculate normalized metrics
(
evaluation_results,
evaluation_results_per_drug,
evaluation_results_per_cell_line,
true_vs_pred,
) = prep_results(
evaluation_results, evaluation_results_per_drug, evaluation_results_per_cell_line, true_vs_pred, pathlib.Path("data")
)

write_results(
path_out="results/my_second_run",
eval_results=evaluation_results,
eval_results_per_drug=evaluation_results_per_drug,
eval_results_per_cl=evaluation_results_per_cell_line,
t_vs_p=true_vs_pred,
)
from drevalpy.visualization.create_report import create_report

create_report(
run_id="my_first_run",
dataset=toyv1.dataset_name,
path_data= "data",
result_path="results",
)
```

We recommend the use of our Nextflow pipeline for computational demanding runs and for improved reproducibility.
Expand Down
115 changes: 0 additions & 115 deletions create_report.py

This file was deleted.

4 changes: 2 additions & 2 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ How to set up your development environment

.. code:: console

$ python run_suite.py --run_id my_first_run --models NaiveDrugMeanPredictor ElasticNet --dataset TOYv1 --test_mode LCO
$ drevalpy --run_id my_first_run --models NaiveDrugMeanPredictor ElasticNet --dataset TOYv1 --test_mode LCO

6. Visualize the results by running the following command:

.. code:: console

$ python create_report.py --run_id my_first_run --dataset TOYv1
$ drevalpy-report --run_id my_first_run --dataset TOYv1

How to test the project
-----------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ To install DrEvalPy from source, clone the repository and install the package us
pip install poetry-plugin-export
poetry install

Now, you can test the functionality by referring to the `Quickstart <./quickstart.html>`_ documentation.
Now, you can test the functionality quickly via `drevalpy --help`. Or take a look at the `Quickstart <./quickstart.html>`_ documentation.
5 changes: 3 additions & 2 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dataset with the LCO test mode.

.. code-block:: bash

python run_suite.py --run_id my_first_run --models NaiveTissueMeanPredictor NaiveDrugMeanPredictor --baselines NaiveMeanEffectsPredictor --dataset TOYv1 --test_mode LCO
drevalpy --run_id my_first_run --models NaiveTissueMeanPredictor NaiveDrugMeanPredictor --baselines NaiveMeanEffectsPredictor --dataset TOYv1 --test_mode LCO

This will train the three baseline models to predict LN_IC50 values of our Toy dataset which is a subset of CTRPv2.
It will evaluate in "LCO" which is the leave-cell-line-out splitting strategy
Expand All @@ -23,14 +23,15 @@ You can visualize them using

.. code-block:: bash

python create_report.py --run_id my_first_run --dataset TOYv1
drevalpy-report --run_id my_first_run --dataset TOYv1

This creates an index.html file which you can open in your browser to see the results of your run.

We recommend the use of our nextflow pipeline for computational demanding runs and for improved reproducibility. No
knowledge of nextflow is required to run it. The nextflow pipeline is available on the `nf-core GitHub
<https://github.com/nf-core/drugresponseeval.git>`_, the documentation can be found `here <https://nf-co.re/drugresponseeval/dev/>`_.

- Want to test if your own model outperforms the baselines? See `Run Your Model <./runyourmodel.html>`_.
- Discuss usage, development and issues on `GitHub <https://github.com/daisybio/drevalpy>`_.
- Check the `Contributor Guide <./contributing.html>`_ if you want to participate in developing.
- If you use drevalpy for your work, `please cite us <./reference.html>`_.
Expand Down
4 changes: 2 additions & 2 deletions docs/runyourmodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Update the ``MULTI_DRUG_MODEL_FACTORY`` if your model is a global model for mult
Now you can run your model using the DrEvalPy pipeline. cd to the drevalpy root directory and run the following command:

.. code-block:: shell
python -m run_suite.py --model YourModel --dataset CTRPv2 --data_path data
drevalpy --model YourModel --dataset CTRPv2 --data_path data


To contribute the model, so that the community can build on it, please also write appropriate tests in ``tests/models`` and documentation in ``docs/``
Expand Down Expand Up @@ -543,4 +543,4 @@ Now you can run the model using the DrEvalPy pipeline.
To run the model, navigate to the DrEvalPy root directory and execute the following command:
.. code-block:: shell

python -m run_suite.py --model ProteomicsRandomForest --dataset CTRPv2 --data_path data
drevalpy --model ProteomicsRandomForest --dataset CTRPv2 --data_path data
Loading
Loading