Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
f4e0d05
installing ps for nextflow
JudithBernett Nov 21, 2024
ff560a1
removing virtual environment in Dockerfile, seems to confuse Nextflow
JudithBernett Nov 21, 2024
a16921a
bug in parser: randomization mode SVCD was not valid because of typo.
JudithBernett Nov 25, 2024
b72e6a1
documenting dreval thoroughly
JudithBernett Nov 26, 2024
09a999e
Documenting how to run DrEvalPy. Also fixed some typos in the help me…
JudithBernett Nov 27, 2024
998782c
Modified section headers to avoid duplicate headlines, modified build…
JudithBernett Nov 27, 2024
4c54d24
Merge branch 'development' into docs
picciama Nov 29, 2024
f1d6c16
Merge branch 'docs' of github.com:daisybio/drevalpy into docs
JudithBernett Nov 29, 2024
21fbada
added curvecurator to dataset documentation, changed contributing gui…
JudithBernett Nov 29, 2024
7059e48
added custom datasets info and updated options
picciama Nov 29, 2024
041cb38
Merge branch 'docs' of github.com:daisybio/drevalpy into docs
picciama Nov 29, 2024
f0620e4
Merge branch 'docs' of github.com:daisybio/drevalpy into docs
JudithBernett Nov 29, 2024
c59376d
There was a bug. The MOLIR model failed when the validation dataset c…
JudithBernett Nov 29, 2024
93ff453
mistake in python-package.yml, still old python versions
JudithBernett Nov 29, 2024
381a670
run python-package.yml action also when pushed to pull request, remov…
JudithBernett Nov 29, 2024
30bef46
make toml required, remove run_test from python-package.yml action
JudithBernett Nov 29, 2024
81548bb
forgot to update poetry.lock
JudithBernett Nov 29, 2024
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: 1 addition & 1 deletion .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: "3.11"

- name: Install pip
run: |
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Python package

on:
pull_request:
types: [opened, reopened]
branches: [main, development]
release:
types: [published]

Expand All @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.11", "3.12"]

steps:
- name: Check out the repository
Expand Down Expand Up @@ -44,6 +44,3 @@ jobs:
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore W503,D212
- name: Test with pytest
run: |
poetry run pytest
2 changes: 2 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ formats: all
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ FROM python:3.10-buster as builder

RUN pip install poetry==1.8.4

# POETRY_VIRTUALENVS_CREATE=1: Makes sure that environment will be as isolated as possible and above all that
# installation will not mess up with the system Python or, even worse, with Poetry itself.
# POETRY_CACHE_DIR: When removing the cache folder, make sure this is done in the same RUN command. If it’s done in a
# separate RUN command, the cache will still be part of the previous Docker layer (the one containing poetry install )
# effectively rendering your optimization useless.

ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache

WORKDIR /root
Expand All @@ -34,10 +30,9 @@ FROM python:3.10-slim-buster as runtime
LABEL image.author.name="Judith Bernett"
LABEL image.author.email="judith.bernett@tum.de"

ENV VIRTUAL_ENV=/root/.venv \
PATH="/root/.venv/bin:$PATH"

COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
# Copy installed dependencies from the builder image
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin

# Copy all relevant code

Expand All @@ -51,3 +46,6 @@ COPY poetry.lock ./

# Install drevalpy
RUN pip install .

# Nextflow needs the command ps to be available
RUN apt-get update && apt-get install -y procps && rm -rf /var/lib/apt/lists/*
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# DrEvalPy: Python Cancer Cell Line Drug Response Prediction Suite

[![PyPI version](https://img.shields.io/pypi/v/drevalpy.svg)](https://pypi.org/project/drevalpy/)
![Python versions](https://img.shields.io/pypi/pyversions/drevalpy)
[![License](https://img.shields.io/github/license/daisybio/drevalpy)](https://opensource.org/licenses/GPL3)
[![Read the Docs](https://img.shields.io/readthedocs/drevalpy/latest.svg?label=Read%20the%20Docs)](https://drevalpy.readthedocs.io/)
[![Test status](https://github.com/daisybio/drevalpy/actions/workflows/run_tests.yml/badge.svg)](https://github.com/daisybio/drevalpy/actions?workflow=Tests)
[![Precommit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

Focus on Innovating Your Models — DrEval Handles the Rest!

- DrEval is a toolkit that ensures drug response prediction evaluations are statistically sound, biologically meaningful, and reproducible.
Expand All @@ -8,7 +16,7 @@ Focus on Innovating Your Models — DrEval Handles the Rest!

By contributing your model to the DrEval catalog, you can increase your work's exposure, reusability, and transferability.

![DrEval](https://github.com/daisybio/drevalpy/blob/main/assets/dreval.png)
![DrEval](assets/dreval.png)

Use DrEval to Build Drug Response Models That Have an Impact

Expand Down Expand Up @@ -39,22 +47,32 @@ Using pip:
pip install drevalpy
```

From Source:
Using docker:

```bash
docker pull ghcr.io/daisybio/drevalpy:main
```

From source:

```bash
conda env create -f models/SimpleNeuralNetwork/env.yml
pip install .
git clone https://github.com/daisybio/drevalpy.git
cd drevalpy
pip install poetry
poetry install
```

## Quickstart

To run models from the catalog, you can run:

```bash
python run_suite.py --run_id my_first_run --models ElasticNet SimpleNeuralNetwork --dataset GDSC1 --test_mode LCO
python run_suite.py --run_id my_first_run --models ElasticNet SimpleNeuralNetwork --dataset GDSC2 --test_mode LCO
```

This will train and tune a neural network and an elastic net model on a subset of gene expression features and drug fingerprint features to predict IC50 values of the GDSC1 database. It will evaluate in "LCO" which is the leave-cell-line-out splitting strategy using 5 fold cross validation.
This will train and tune a neural network and an elastic net model on gene expression features and drug fingerprint
features to predict IC50 values of the GDSC2 database. It will evaluate in "LCO" which is the leave-cell-line-out
splitting strategy using 5 fold cross validation.
The results will be stored in

```bash
Expand Down
59 changes: 59 additions & 0 deletions docs/API.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
API
===

Import DrEvalPy using

.. code-block:: python

import drevalpy as dep

Subpackages
-----------

DrEvalPy consists of three major subpackages:

* Datasets
* Models
* Visualization

.. toctree::
:maxdepth: 3

drevalpy.datasets
drevalpy.models
drevalpy.visualization

Other functions
---------------

Major functions for running the experiment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: drevalpy.experiment
:members:
:undoc-members:
:show-inheritance:

Evaluation functions
~~~~~~~~~~~~~~~~~~~~

.. automodule:: drevalpy.evaluation
:members:
:undoc-members:
:show-inheritance:

Utility functions
~~~~~~~~~~~~~~~~~

.. automodule:: drevalpy.utils
:members:
:undoc-members:
:show-inheritance:

Pipeline function decorator
~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: drevalpy.pipeline_function
:members:
:undoc-members:
:show-inheritance:
12 changes: 6 additions & 6 deletions docs/_key_contributors.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. sidebar:: Key Contributors

* `Judith Bernett <https://github.com/JudithBernett>`_: developer, maintainer
* `Pascal Iversen <https://github.com/PascalIversen>`_: developer, maintainer
* `Mario Picciani <https://github.com/picciama>`_: developer
* `Markus List <https://github.com/mlist>`_: advisor and PI of daisybio
* `Katharina Baum <https://github.com/kathbaum>`_: advisor and PI of DILiS
* `Mathias Wilhelm <https://github.com/mwilhelm42>`_: advisor and PI of wilhelmlab
* `Judith Bernett <https://github.com/JudithBernett>`_: Developer, Maintainer
* `Pascal Iversen <https://github.com/PascalIversen>`_: Developer, Maintainer
* `Mario Picciani <https://github.com/picciama>`_: Developer
* `Markus List <https://github.com/mlist>`_: Advisor and PI of Data Science in Systems Biology, TUM
* `Katharina Baum <https://github.com/kathbaum>`_: Advisor and PI of Data Integration in the Life Sciences, FU Berlin
* `Mathias Wilhelm <https://github.com/mwilhelm42>`_: Advisor and PI of Computational Mass Spectrometry, TUM
4 changes: 4 additions & 0 deletions docs/_static/custom_cookietemple.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ table.align-default {
.date {
font-size: 50%;
}

a:visited {
color: #a63a85;
}
7 changes: 4 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# General information about the project.
project = "DrEvalPy"
author = "DrEvalpy development team"
copyright = f"{datetime.now():%Y}, daisybio at Technical University of Munich"
copyright = f"{datetime.now():%Y}, DaiSyBio at Technical University of Munich"

# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
Expand Down Expand Up @@ -100,7 +100,7 @@
# documentation.
#
html_theme_options = dict(
navigation_depth=4,
navigation_depth=6,
logo_only=True,
)
html_logo = "_static/img/drevalpy.png"
Expand Down Expand Up @@ -166,7 +166,8 @@
autodoc_typehints = "description"


autodoc_mock_imports = ["numpy", "sklearn", "pandas", "networkx", "yaml", "pytorch_lightning", "torch", "scipy"]
# autodoc_mock_imports = ["numpy", "sklearn", "pandas", "networkx", "yaml", "pytorch_lightning", "torch", "scipy",
# "copy", "os", "abc", "pathlib", "typing"]


# -- Options for Texinfo output ----------------------------------------
Expand Down
38 changes: 8 additions & 30 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Contributor Guide
=================

Thank you for your interest in improving this project.
This project is open-source under the `MIT license`_ and
This project is open-source under the `GPL-3 license`_ and
highly welcomes contributions in the form of bug reports, feature requests, and pull requests.

Here is a list of important resources for contributors:
Expand All @@ -11,7 +11,7 @@ Here is a list of important resources for contributors:
- `Documentation`_
- `Issue Tracker`_

.. _MIT license: https://opensource.org/licenses/MIT
.. _GPL-3 license: https://opensource.org/license/gpl-3-0
.. _Source Code: https://github.com/daisybio/drevalpy
.. _Documentation: https://drevalpy.readthedocs.io/
.. _Issue Tracker: https://github.com/daisybio/drevalpy/issues
Expand All @@ -31,39 +31,19 @@ Request features on the `Issue Tracker`_.
How to set up your development environment
------------------------------------------

You need Python 3.9+ and the following tools:
You need Python 3.10+ and Poetry_ to set up your development environment.

- Poetry_
- Nox_
- nox-poetry_

You can install them with:

.. code:: console

$ pip install poetry nox nox-poetry

Install the package with development requirements:
.. _Poetry: https://python-poetry.org/

.. code:: console

$ make install
How to test the project
-----------------------

You can now run an interactive Python session,
or the command-line interface:
For this, you need to install nox and nox-poetry:

.. code:: console

$ poetry run python
$ poetry run drevalpy

.. _Poetry: https://python-poetry.org/
.. _Nox: https://nox.thea.codes/
.. _nox-poetry: https://nox-poetry.readthedocs.io/


How to test the project
-----------------------
$ pip install nox nox-poetry

Run the full test suite:

Expand Down Expand Up @@ -93,7 +73,6 @@ How to build and view the documentation
---------------------------------------

This project uses Sphinx_ together with several extensions to build the documentation.
It further requires Pandoc_ to translate various formats.

To install all required dependencies for the documentation run:

Expand All @@ -111,7 +90,6 @@ from inside the docs folder. The generated static HTML files can be found in the
Simply open them with your favorite browser.

.. _sphinx: https://www.sphinx-doc.org/en/master/
.. _pandoc: https://pandoc.org/

How to submit changes
---------------------
Expand Down
35 changes: 35 additions & 0 deletions docs/drevalpy.datasets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Datasets
=========================

Dataset module
--------------

.. automodule:: drevalpy.datasets.dataset
:members:
:undoc-members:
:show-inheritance:

Loaders
-------

.. automodule:: drevalpy.datasets.loader
:members:
:undoc-members:
:show-inheritance:

CurveCurator
------------

.. automodule:: drevalpy.datasets.curvecurator
:members:
:undoc-members:
:show-inheritance:

Utility functions
-----------------

.. automodule:: drevalpy.datasets.utils
:members:
:undoc-members:
:show-inheritance:

Loading
Loading