Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .binder/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ mv docs/build/html/jupyter_notebooks .
shopt -s extglob
rm -rf .[!.]*
rm -rf !(jupyter_notebooks|docs)
(cd docs && rm -rf !(src))
(cd docs && rm -rf !(src))
2 changes: 1 addition & 1 deletion .binder/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-r ../requirements.txt
-r ../requirements.txt
2 changes: 1 addition & 1 deletion .binder/runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.9
python-3.9
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A clear and concise description of what the bug is.
*NB:* for questions about pydeseq2 that are not related to a bug, please open a topic on the [scverse ecosystem Discourse forum](https://discourse.scverse.org/c/ecosystem/38).

**To Reproduce**
Provide snippets of code and steps on how to reproduce the behavior.
Provide snippets of code and steps on how to reproduce the behavior.
Please also specify the version you are using.

**Expected behavior**
Expand Down
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ https://github.com/blog/1506-closing-issues-via-pull-requests


#### What does your PR implement? Be specific.

37 changes: 26 additions & 11 deletions .github/workflows/pr_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: pr-validation

# Controls when the workflow will run
on:
workflow_dispatch:
push:
branches:
- '**'
Expand All @@ -18,31 +19,41 @@ jobs:
matrix:
include:
- os: ubuntu-latest
python: "3.10"
python: "3.11"
- os: ubuntu-latest
python: "3.10"
pip-flags: "--pre"
python: "3.12"
- os: ubuntu-latest
python: "3.11"
python: "3.13"
- os: ubuntu-latest
python: "3.11"
python: "3.13"
pip-flags: "--pre"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ."[dev]"
pip install -r docs/requirements.txt
uv sync --extra doc --extra dev
- name: Lint with ruff
run: |
uv run ruff check --fix --exit-non-zero-on-fix pydeseq2
- name: Format with ruff
run: |
uv run ruff format --check pydeseq2
- name: Type check with mypy
run: |
uv run mypy -p pydeseq2
- name: Test with pytest
run: |
coverage run -m pytest
uv run coverage run -m pytest
- name: Generate code coverage report
run: |
coverage html
uv run coverage html
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -51,5 +62,9 @@ jobs:
retention-days: 20
- name: Compile docs
run: |
uv pip freeze > requirements.txt
cd docs
make clean html
uv run make clean html
- name: Build package
run: |
uv build
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
.ruff_cache/

# Translations
*.mo
Expand Down Expand Up @@ -133,3 +134,12 @@ dmypy.json

# IDEs
.vscode

# Docs files
output_files/
docs/source/auto_examples/
docs/source/sg_execution_times.rst

# Requirement files
uv.lock
requirements.txt
43 changes: 30 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
fail_fast: false
default_language_version:
python: python3
default_stages:
- pre-commit
- pre-push
minimum_pre_commit_version: 2.16.0
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.9.0
hooks:
- id: black
additional_dependencies: ['click==8.0.4']
args: # arguments to configure black
- --line-length=89
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.0
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: detect-private-key
- id: check-ast
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: check-added-large-files
stages: [pre-commit]
args: ["--maxkb=50000"]
- id: trailing-whitespace
- id: check-case-conflict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.0
hooks:
- id: ruff-check
types_or: [python, pyi, jupyter]
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
exclude: ^(tests/|docs/source/conf.py)
pass_filenames: false
args: [-p, pydeseq2, --ignore-missing-imports]
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Code of Conduct
---------------

`PyDeseq2` follows the code of conduct defined by
the Python Software Foundation: https://www.python.org/psf/codeofconduct/.
the Python Software Foundation: https://www.python.org/psf/codeofconduct/.
47 changes: 29 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
[![condaDownloads](https://img.shields.io/conda/dn/bioconda/pydeseq2?logo=Anaconda)](https://anaconda.org/bioconda/pydeseq2)
[![license](https://img.shields.io/pypi/l/pydeseq2)](LICENSE)

PyDESeq2 is a python implementation of the [DESeq2](https://bioconductor.org/packages/release/bioc/html/DESeq2.html)
PyDESeq2 is a python implementation of the [DESeq2](https://bioconductor.org/packages/release/bioc/html/DESeq2.html)
method [1] for differential expression analysis (DEA) with bulk RNA-seq data, originally in R.
It aims to facilitate DEA experiments for python users.

As PyDESeq2 is a re-implementation of [DESeq2](https://bioconductor.org/packages/release/bioc/html/DESeq2.html) from
As PyDESeq2 is a re-implementation of [DESeq2](https://bioconductor.org/packages/release/bioc/html/DESeq2.html) from
scratch, you may experience some differences in terms of retrieved values or available features.

Currently, available features broadly correspond to the default settings of DESeq2 (v1.34.0) for single-factor and
Currently, available features broadly correspond to the default settings of DESeq2 (v1.34.0) for single-factor and
multi-factor analysis (with categorical or continuous factors) using Wald tests.
We plan to implement more in the future.
In case there is a feature you would particularly like to be implemented, feel free to open an issue.
Expand All @@ -40,17 +40,25 @@ In case there is a feature you would particularly like to be implemented, feel f

`PyDESeq2` can be installed from PyPI using `pip`:

`pip install pydeseq2`
```bash
pip install pydeseq2
```

We recommend installing within a conda environment:

```
```bash
conda create -n pydeseq2
conda activate pydeseq2
conda install pip
pip install pydeseq2
```

You can also add it to your projects through `uv`:

```bash
uv add pydeseq2
```

### Bioconda

`PyDESeq2` can also be installed from Bioconda with `conda`:
Expand All @@ -61,16 +69,20 @@ If you're interested in contributing or want access to the development version,

### Requirements

The list of package version requirements is available in `setup.py`.
The list of package version requirements is available in `pyproject.toml`.

For reference, the code is being tested in a github workflow (CI) with python
3.10 to 3.11 and the following package versions:
3.11 to 3.13 and the latest versions of the following packages:

```
- anndata 0.8.0
- numpy 1.23.0
- pandas 1.4.3
- scikit-learn 1.1.1
- scipy 1.11.0
- anndata
- formulaic
- numpy
- pandas
- scikit-learn
- scipy
- formulaic-contrasts
- matplotlib
```

Please don't hesitate to open an issue in case you encounter any issue due to possible deprecations.
Expand All @@ -84,7 +96,7 @@ contains downloadable examples on how to use PyDESeq2.

### Documentation

The documentation is hosted [here on ReadTheDocs](https://pydeseq2.readthedocs.io/en/latest/).
The documentation is hosted [here on ReadTheDocs](https://pydeseq2.readthedocs.io/en/latest/).
If you want to have the latest version of the documentation, you can build it from source.
Please go to the dedicated [README.md](https://github.com/owkin/PyDESeq2/blob/main/docs/README.md) for information on how to do so.

Expand All @@ -105,12 +117,12 @@ documentation to see how you can contribute to PyDESeq2.

`git clone https://github.com/owkin/PyDESeq2.git`

### 2 - Create a conda environment
### 2 - Create a uv environment

Run `conda create -n pydeseq2 python=3.10` (or higher python version) to create the `pydeseq2` environment and then activate it:
`conda activate pydeseq2`.
Run `uv venv --python 3.13` (or higher python version) to create the `pydeseq2` environment and then activate it:
`source .venv/bin/activate`.

`cd` to the root of the repo and run `pip install -e ."[dev]"` to install in developer mode.
`cd` to the root of the repo and run `uv sync --extra dev --extra doc` to install in developer mode.

Then, run `pre-commit install`.

Expand Down Expand Up @@ -145,4 +157,3 @@ PyDESeq2 is a living project and any contributions are welcome! Feel free to ope
## License

PyDESeq2 is released under an [MIT license](https://github.com/owkin/PyDESeq2/blob/main/LICENSE).

8 changes: 4 additions & 4 deletions datasets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
This directory stores example data which can be retrieved using the `load_example_data` function from
`pydeseq2.utils`. Only synthetic data is provided for now, but new datasets might be available in the future.

The `tests_clinical.csv` and `test_counts.csv` files were generated using a custom modification of the
`makeExampleDESeqDataSet` method of [DESeq2](https://bioconductor.org/packages/release/bioc/html/DESeq2.html),
to handle several factors.
The `tests_clinical.csv` and `test_counts.csv` files were generated using a custom modification of the
`makeExampleDESeqDataSet` method of [DESeq2](https://bioconductor.org/packages/release/bioc/html/DESeq2.html),
to handle several factors.


## Folder organisation
Expand All @@ -15,7 +15,7 @@ PyDESeq2
└───datasets
└───synthetic
└───synthetic
│ test_clinical.csv
│ test_counts.csv
```
1 change: 0 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ help:

livehtml:
sphinx-autobuild -b html $(SOURCEDIR) $(BUILDDIR)/html

20 changes: 8 additions & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
# Documentation

The documentation of PyDESeq2 is generated using Sphinx and hosted on ReadTheDoc.
The documentation of PyDESeq2 is generated using Sphinx and hosted on ReadTheDocs.
If you want to build the documentation from source, start by cloning the repository, if you have not done it yet.

```bash
git clone https://github.com/owkin/PyDESeq2.git
cd PyDESeq2
```

We recommend installing within a conda environment, using the `environment.yaml` provided with the sources.:
We recommend installing with `uv`:

```bash
conda env create -f environment.yml
conda activate pydeseq2
uv venv
source .venv/bin/activate
uv sync --extra dev --extra doc
uv pip freeze > requirements.txt # Required for Binder to work
```

Now go to the doc folder, and install the extraneeded dependencies.
You can now go to the doc folder and trigger the build using `make` command line.

```bash
cd docs
pip install -r requirements.txt
```

You can now trigger the build using `make` command line.

```bash
make clean html
```
```
Loading