diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6ae0b46 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.github +.ruff_cache/ +.venv/ +data/ +dist/ +docs/ +example/ +oncodrivefml.egg-info/ diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..27258dc --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,207 @@ +name: Build and Publish + +on: + push: + tags: + - "**" + branches: + - "**" + +permissions: + contents: read + +env: + TERM: xterm + +jobs: + packages-build: + name: Build packages + runs-on: ubuntu-latest + env: + RUFF_FORMAT: github + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: "3.8" + + - name: Prepare virtual environment + run: make create-env + + - name: Check format + run: | + make check-format || true + BOLDRED=$(tput bold && tput setaf 1) + RESET=$(tput sgr0) + echo "${BOLDRED}==> We won't fail on formatting errors for the time being, but we will in the future.${RESET}" + + - name: Check lint + run: | + make check-lint || true + BOLDRED=$(tput bold && tput setaf 1) + RESET=$(tput sgr0) + echo "${BOLDRED}==> We won't fail on lint errors for the time being, but we will in the future.${RESET}" + + - name: Build packages + run: make build-dist + + - name: Upload packages + uses: actions/upload-artifact@v4 + with: + name: python-packages + path: dist + + docker-build: + name: Build Docker image + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: "3.8" + + - name: Prepare virtual environment + run: make create-env + + - name: Check Dockerfile + run: make check-docker + + - name: Build Docker image + run: make build-image + + # TODO: Enable this when we figure out how to run it without having to download several Gigabytes of data. + # - name: Test Docker image + # run: make run-example + + docs-build: + name: Build documentation + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: "3.8" + + - name: Prepare virtual environment + run: make create-env + + - name: Check version matching the tag + shell: bash + run: make docs + + - name: Upload documentation + uses: actions/upload-artifact@v4 + with: + name: documentation + path: docs/build + + check-version: + name: Check version + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + needs: + - packages-build + - docker-build + - docs-build + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: "3.8" + + - name: Prepare virtual environment + run: make create-env + + - name: Check version matching the tag + run: make check-version + + packages-publish: + name: Publish packages + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + env: + PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} + needs: + - check-version + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: "3.8" + + - name: Prepare virtual environment + run: make create-env + + - name: Download packages + uses: actions/download-artifact@v4 + with: + name: python-packages + + - name: Publish to PyPI + if: ${{ env.PYPI_USERNAME != '' }} + env: + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: make publish-dist + + docker-push: + name: Push Docker image + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + needs: + - check-version + + steps: + - if: ${{ env.DOCKER_USERNAME != '' }} + uses: actions/checkout@v3 + + - name: Login to DockerHub + if: ${{ env.DOCKER_USERNAME != '' }} + run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin + + - name: Push Docker image + if: ${{ env.DOCKER_USERNAME != '' }} + run: make push-image + + docs-publish: + name: Publish documentation + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + env: + RTD_USERNAME: ${{ secrets.RTD_USERNAME }} + needs: + - check-version + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: "3.8" + + - name: Prepare virtual environment + run: make create-env + + - name: Download documentation + uses: actions/download-artifact@v4 + with: + name: documentation + + # TODO: Add a step to publish the docs to ReadTheDocs \ No newline at end of file diff --git a/.gitignore b/.gitignore index 538546e..1983ed2 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,8 @@ example/cdsOriginal docs/build # External users tests -external_checks \ No newline at end of file +external_checks + +.ruff_cache/ +.venv +data/ diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000..bc1caf0 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,2 @@ +ignored: + - DL3003 \ No newline at end of file diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..cc1923a --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.8 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..51b4f51 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM python:3.8-slim + +# hadolint ignore=DL3013 +RUN pip install --no-cache-dir --upgrade pip + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install -y --no-install-recommends --no-install-suggests \ + build-essential=12.9 \ + zlib1g-dev=1:1.2.13.dfsg-1 && \ + rm -rf /var/lib/apt/lists/* + +# hadolint ignore=DL3042 +RUN --mount=type=cache,target=/root/.cache/pip \ + --mount=type=bind,target=/project,rw \ + cd /project && \ + pip install . + +ENTRYPOINT [ "/usr/local/bin/oncodrivefml" ] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fb911f3 --- /dev/null +++ b/Makefile @@ -0,0 +1,150 @@ +ROOT_DIR := $(shell echo $(dir $(lastword $(MAKEFILE_LIST))) | sed 's|/*$$||') + +SHELL := /bin/bash + +DOCS_DIR := $(ROOT_DIR)/docs +VENV_DIR := $(ROOT_DIR)/.venv + +VERSION ?= $(shell $(VENV_DIR)/bin/python -c 'from oncodrivefml import __version__; print(f"{__version__}")') + +GIT_TAG_OR_SHA = $(shell git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD) + +IMAGE_TAG ?= $(VERSION) +IMAGE := bbglab/oncodrivefml:$(IMAGE_TAG) + +BOLDRED := $(shell tput bold && tput setaf 1) +BOLDGREEN := $(shell tput bold && tput setaf 2) +BOLDYELLOW := $(shell tput bold && tput setaf 3) +WHITE := $(shell tput sgr0 && tput setaf 7) +RESET := $(shell tput sgr0) + + +.PHONY: help +help: + @echo "$(BOLDYELLOW)Available targets:$(RESET)" + @echo + @echo "$(BOLDGREEN) checks $(WHITE)-> Run all the checks (format and lint)" + @echo "$(BOLDGREEN) check-format $(WHITE)-> Check for formatting errors" + @echo "$(BOLDGREEN) check-lint $(WHITE)-> Check for lint errors" + @echo "$(BOLDGREEN) check-docker $(WHITE)-> Check the Dockerfile" + @echo "$(BOLDGREEN) format $(WHITE)-> Format source code" + @echo "$(BOLDGREEN) build-dist $(WHITE)-> Build source and wheel distribution files" + @echo "$(BOLDGREEN) install $(WHITE)-> Install the packages in editable mode" + @echo "$(BOLDGREEN) create-env $(WHITE)-> Create a virtual environment" + @echo "$(BOLDGREEN) remove-env $(WHITE)-> Remove the virtual environment" + @echo "$(BOLDGREEN) build-image $(WHITE)-> Build the Docker image" + @echo "$(BOLDGREEN) push-image $(WHITE)-> Push the Docker image into DockerHub" + @echo "$(BOLDGREEN) docs $(WHITE)-> Generate the documentation" + @echo "$(BOLDGREEN) run-example $(WHITE)-> Run the included example using the Docker image" + @echo "$(BOLDGREEN) clean $(WHITE)-> Clean the working directory (build files, virtual environments, caches)" + @echo "$(RESET)" + +$(VENV_DIR): + @echo "$(BOLDYELLOW)Preparing virtual environment ...$(RESET)" + python -m venv $(VENV_DIR) + $(VENV_DIR)/bin/pip install -U pip ruff setuptools wheel build twine + @echo "$(BOLDGREEN)==> Success!$(RESET)" + +.PHONY: checks +checks: check-format check-lint check-docker + +.PHONY: check-format +check-format: $(VENV_DIR) + @echo "$(BOLDGREEN)Checking code format ...$(RESET)" + $(VENV_DIR)/bin/ruff format --check + @echo "$(BOLDGREEN)==> Success!$(RESET)" + +.PHONY: check-lint +check-lint: $(VENV_DIR) + @echo "$(BOLDGREEN)Checking lint ...$(RESET)" + $(VENV_DIR)/bin/ruff check + @echo "$(BOLDGREEN)==> Success!$(RESET)" + +.PHONY: check-docker +check-docker: + @echo "$(BOLDGREEN)Checking Dockerfile ...$(RESET)" + docker run --rm -i \ + -v $$(pwd):/project \ + hadolint/hadolint hadolint \ + --config /project/.hadolint.yaml \ + /project/Dockerfile + @echo "$(BOLDGREEN)==> Success!$(RESET)" + +.PHONY: check-version +check-version: $(VENV_DIR) + @echo "$(BOLDGREEN)Checking that the version matches the tag ...$(RESET)" + @if [ "$(VERSION)" != "$(GIT_TAG_OR_SHA)" ]; then \ + echo "$(BOLDRED)==> Version $(BOLDYELLOW)$(VERSION)$(BOLDRED) doesn't match the git tag $(BOLDYELLOW)$(GIT_TAG_OR_SHA)$(BOLDRED) !!!$(RESET)"; \ + echo "$(BOLDRED)==> Please update the $(BOLDYELLOW)__version__$(BOLDRED) in $(BOLDYELLOW)oncodrivefml/__init__.py$(BOLDRED) and re-create the tag.$(RESET)"; \ + exit 1; \ + fi + @echo "$(BOLDGREEN)==> Success!$(RESET)" + +.PHONY: format +format: $(VENV_DIR) + @echo "$(BOLDGREEN)Formatting code ...$(RESET)" + $(VENV_DIR)/bin/ruff format + +.PHONY: build-dist +build-dist: $(VENV_DIR) + @echo "$(BOLDGREEN)Building packages ...$(RESET)" + $(VENV_DIR)/bin/python -m build + +.PHONY: publish-dist +publish-dist: $(VENV_DIR) + @echo "$(BOLDGREEN)Publishing OncodriveFML $(BOLDYELLOW)$(VERSION)$(BOLDGREEN) to PyPI ...$(RESET)" + @[[ -z "$(PYPI_USERNAME)" || -z "$(PYPI_PASSWORD)" ]] && (echo "$(BOLDRED)==> Missing PyPI credentials !!!$(RESET)"; exit 1) + $(VENV_DIR)/bin/twine upload \ + --username $(PYPI_USERNAME) \ + --password $(PYPI_PASSWORD) \ + dist/* + +.PHONY: install +install: $(VENV_DIR) + pip install -e . + +.PHONY: create-env +create-env: $(VENV_DIR) + +.PHONY: remove-env +remove-env: + @echo "$(BOLDGREEN)Removing virtual environment ...$(RESET)" + rm -rf $(VENV_DIR) + +.PHONY: build-image +build-image: + @echo "$(BOLDGREEN)Building Docker image $(BOLDYELLOW)$(IMAGE)$(BOLDGREEN) ...$(RESET)" + docker build --progress=plain -t $(IMAGE) . + @echo "$(BOLDGREEN)==> Success!$(RESET)" + +.PHONY: build-image +push-image: + @echo "$(BOLDGREEN)Pushing the Docker image into the DockerHub ...$(RESET)" + docker push $(IMAGE) + @echo "$(BOLDGREEN)==> Success!$(RESET)" + +.PHONY: docs +docs: $(VENV_DIR) + @if ! which $(VENV_DIR)/bin/sphinx-build > /dev/null; then \ + $(VENV_DIR)/bin/pip install -r optional-requirements.txt; \ + fi + (source $(VENV_DIR)/bin/activate; make -C $(DOCS_DIR) html) + +.PHONY: run-example +run-example: + @echo "$(BOLDGREEN)Running example ...$(RESET)" + docker run --rm -i \ + --workdir /example \ + -e BGDATA_LOCAL=/data \ + -v $$(pwd)/data:/data \ + -v $$(pwd)/example:/example \ + oncodrivefml:latest \ + -i paad.txt.gz -e cds.tsv.gz --signature-correction wx --seed 123 --force + @echo "$(BOLDGREEN)==> Success!$(RESET)" + +.PHONY: clean +clean: + @echo "$(BOLDGREEN)Cleaning the repository ...$(RESET)" + rm -rf ./oncodrivefml.egg-info ./dist $(VENV_DIR) ./.ruff_cache ./.eggs $(DOCS_DIR)/build + find oncodrivefml \( -name '*.c' -o -name '*.so' \) -type f -exec rm {} + + find . -name "__pycache__" -type d -exec rm -r {} + diff --git a/README.md b/README.md new file mode 100644 index 0000000..73df3f6 --- /dev/null +++ b/README.md @@ -0,0 +1,156 @@ +# OncodriveFML + +Recent years saw the development of methods to detect signals of positive +selection in the pattern of somatic mutations in genes across cohorts of tumors, +and the discovery of hundreds of driver genes. The next major challenge in tumor +genomics is the identification of non-coding regions which may also drive +tumorigenesis. We present OncodriveFML, a method that estimates the accumulated +functional impact bias of somatic mutations in any genomic region of interest +based on a local simulation of the mutational process affecting it. It may be +applied to all genomic elements to detect likely drivers amongst them. +OncodriveFML can discover signals of positive selection when only a small +fraction of the genome, like a panel of genes, has been sequenced. + +## License + +OncodriveFML is made available to the general public subject to certain +conditions described in its [LICENSE](LICENSE). For the avoidance of doubt, +you may use the software and any data accessed through UPF software for +academic, non-commercial and personal use only, and you may not copy, +distribute, transmit, duplicate, reduce or alter in any way for commercial +purposes, or for the purpose of redistribution, without a license from the +Universitat Pompeu Fabra (UPF). Requests for information regarding a license for +commercial use or redistribution of OncodriveFML may be sent via e-mail to +innovacio@upf.edu. + +## Usage + +OncodriveFML is meant to be used through the command line. + +By default, OncodriveFML is prepared to analyse mutations using HG19 reference +genome. For other genomes, update the [configuration] accordingly. + +[configuration]: https://oncodrivefml.readthedocs.io/en/latest/configuration.html + +### Running it without installation + +You can run OncodriveFML without having to install anything in your machine as +far as you have Docker. + +This is how you would run the example included in this repository: + +```shell +docker run --rm -i \ + -v $(pwd)/data:/data \ + -v $(pwd)/example:/example \ + -e BGDATA_LOCAL=/data \ + --workdir /example \ + oncodrivefml:2.5.0 \ + -i paad.txt.gz -e cds.tsv.gz --signature-correction wx --seed 123 --force +``` + +`-v $(pwd)/data:/data` will allow the docker container to see the contents of +your local `./data` folder as `/data`. + +`-v $(pwd)/example:/example` will make the `./example` folder available to the +container as `/example`. + +`-e BGDATA_LOCAL=/data` will tell the oncodrivefml command to download data to +that folder. + +`--workdir /example` will set the working directory to that of the examples. + +The results will be saved in a folder named `cds` under the `./example` folder. + +### Installation + +OncodriveFML depends on **Python 3.8** and some external libraries. The easiest +way to install all this software stack is using the well known [Anaconda Python +distribution](http://continuum.io/downloads>) + +```shell +conda install -c bbglab oncodrivefml +``` + +OncodriveFML can also be installed using `pip`: + +```shell +pip install oncodrivefml +``` + +Finally, you can get the latest code from the repository and install with `pip`: + +```shell +git clone git@bitbucket.org:bbglab/oncodrivefml.git +cd oncodrivefml +make install +source .venv/bin/activate +oncodrivefml --help +``` + +The first time that you run OncodriveFML it will download the genome reference +from our servers. By default the downloaded datasets go to `~/.bgdata`, but if +you want to move these datasets to another folder you have to define the system +environment variable `BGDATA_LOCAL` with an export command. + +The following command will show you the help: + +```shell +oncodrivefml --help +``` + +#### Running the example + +Download and extract the example files (if you cloned the repository skip this step):: + +```shell +wget https://bitbucket.org/bbglab/oncodrivefml/downloads/oncodrivefml-examples_v2.2.tar.gz +tar xvzf oncodrivefml-examples_v2.2.tar.gz +``` + +To run this example OncodriveFML needs all the precomputed *CADD* scores, that +is a **17Gb file**, that will be downloaded automatically, together with the +reference genome. + +> [!WARNING] +> CADD scores are originally from http://cadd.gs.washington.edu/ and are freely +> available for all non-commercial applications. If you are planning on using +> them in a commercial application, please contact them at +> http://cadd.gs.washington.edu/contact. + +To run the example, we have included a bash script (`run.sh`) +that will execute OncodriveFML. The script should be executed in +the folder where the files have been extracted: + +```bash +./run.sh +``` + +The results will be saved in a folder named `cds`. + +Alternatively you can run it with Docker with just this command: + +```bash +make run-example +``` + +### Configuring OncodriveFML + +Although OncodriveFML includes a predefined configuration file, it is highly +recommended to create one yourself. In fact, if you are interested in using a +reference genome other than HG19, or a score other than CADD 1.0, it is +mandatory. See the documentation for the [configuration] for more details. + + +### Documentation + +Find OncodriveFML documentation in +[ReadTheDocs](http://oncodrivefml.readthedocs.io/en/latest/). + +You can also compile the documentation yourself using +[Sphinx](http://www.sphinx-doc.org/en/stable/), if you have cloned the +repository. To do so, run the following command: + +```bash +make docs +``` \ No newline at end of file diff --git a/README.rst b/README.rst deleted file mode 100644 index 10f4da7..0000000 --- a/README.rst +++ /dev/null @@ -1,110 +0,0 @@ -.. _readme: - -OncodriveFML -============ - -Recent years saw the development of methods to detect signals of positive selection in the pattern of somatic mutations in genes across cohorts of tumors, and the discovery of hundreds of driver genes. The next major challenge in tumor genomics is the identification of non-coding regions which may also drive tumorigenesis. We present OncodriveFML, a method that estimates the accumulated functional impact bias of somatic mutations in any genomic region of interest based on a local simulation of the mutational process affecting it. It may be applied to all genomic elements to detect likely drivers amongst them. OncodriveFML can discover signals of positive selection when only a small fraction of the genome, like a panel of genes, has been sequenced. - - -.. _readme license: - -License -------- -OncodriveFML is made available to the general public subject to certain conditions described in its `LICENSE `_. For the avoidance of doubt, you may use the software and any data accessed through UPF software for academic, non-commercial and personal use only, and you may not copy, distribute, transmit, duplicate, reduce or alter in any way for commercial purposes, or for the purpose of redistribution, without a license from the Universitat Pompeu Fabra (UPF). Requests for information regarding a license for commercial use or redistribution of OncodriveFML may be sent via e-mail to innovacio@upf.edu. - -Usage ------ - -OncodriveFML is meant to be used through the command line. - -By default, OncodriveFML is prepared to analyse mutations -using HG19 reference genome. For other genomes, -update the `configuration `_ -accordingly. - -.. _readme install: - -Installation ------------- - -OncodriveFML depends on Python 3.6 and some external libraries. -The easiest way to install all this software stack is using the well known `Anaconda Python distribution `_:: - - $ conda install -c bbglab oncodrivefml - -OncodriveFML can also be installed using ``pip``:: - - pip install oncodrivefml - -Finally, you can get the latest code from the repository and install with ``pip``:: - - $ git clone git@bitbucket.org:bbglab/oncodrivefml.git - $ cd oncodrivefml - $ pip install . - -.. note:: - - OncodriveFML has a set up dependency with `Cython `_, - which is required to compile the ``*.pyx`` files. - - -The first time that you run OncodriveFML it will download the genome reference from our servers. -By default the downloaded datasets go to ``~/.bgdata`` if you want to move these datasets to another folder you have to define the system environment variable BGDATA_LOCAL with an export command. - -The following command will show you the help:: - - $ oncodrivefml --help - -.. _readme example: - -Run the example ---------------- - -Download and extract the example files (if you cloned the repository skip this step):: - - $ wget https://bitbucket.org/bbglab/oncodrivefml/downloads/oncodrivefml-examples_v2.2.tar.gz - $ tar xvzf oncodrivefml-examples_v2.2.tar.gz - -To run this example OncodriveFML needs all the precomputed CADD scores, that is a 17Gb file, -that will be downloaded automatically, together with the reference genome. - -.. warning:: - - CADD scores are originally from ``_ and are freely available for all non-commercial applications. - If you are planning on using them in a commercial application, please contact them at ``_. - -To run the example, we have included a bash script (``run.sh``) -than will execute OncodriveFML. The script should be executed in -the folder where the files have been extracted:: - - $ ./run.sh - -The results will be saved in a folder named ``cds``. - - -Run OncodriveFML ----------------- - -Although OncodriveFML includes a predefined configuration file, -it is highly recommended to create one yourself. -In fact, if you are interested in using a reference genome other than -HG19, or a score other than CADD 1.0, -it is mandatory. -See `the documentation `_ -for more details. - - -.. _readme docs: - -Documentation -------------- - -Find OncodriveFML documentation in `ReadTheDocs `_. - -You can also compile the documentation yourself using `Sphinx `_, -if you have cloned the repository. -To do so, install the optional packages in ``optional-requirements.txt`` and build the -documentation in the docs folder:: - - $ cd docs - $ make html diff --git a/docs/source/conf.py b/docs/source/conf.py index 9fdb298..b71a073 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -84,7 +84,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff --git a/docs/source/environment.yml b/docs/source/environment.yml index a918ca5..84372b4 100644 --- a/docs/source/environment.yml +++ b/docs/source/environment.yml @@ -7,4 +7,4 @@ channels: - r dependencies: - pycurl=7.43.0.5 -- python=3.6.* \ No newline at end of file +- python=3.8.* \ No newline at end of file diff --git a/docs/source/includes.rst b/docs/source/includes.rst index 03145ed..9b8dd8b 100644 --- a/docs/source/includes.rst +++ b/docs/source/includes.rst @@ -1,10 +1,3 @@ -Readme -====== - -.. include:: ../../README.rst - ----- - .. _license f: License diff --git a/oncodrivefml/__init__.py b/oncodrivefml/__init__.py index 2e3b1a5..c5090b3 100644 --- a/oncodrivefml/__init__.py +++ b/oncodrivefml/__init__.py @@ -1,2 +1,2 @@ __logger_name__ = 'oncodrivefml' -__version__ = "2.4.0" \ No newline at end of file +__version__ = "2.5.0" \ No newline at end of file diff --git a/optional-requirements.txt b/optional-requirements.txt index 881bdd5..2d2b5f0 100644 --- a/optional-requirements.txt +++ b/optional-requirements.txt @@ -1,3 +1,3 @@ # This packages are required to build the documentation -sphinx>=1.5.1 -sphinx_rtd_theme>=0.1.9 \ No newline at end of file +sphinx==6.1.3 +sphinx_rtd_theme==1.2.0 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e74c90b..7de4e58 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,28 +1,19 @@ -# Python 3.6 ago==0.0.93 bgcache==0.1 -bgconfig -bgdata>=2.0.3 +bgconfig==0.10 +bgdata==2.0.4 bglogs==0.6 bgparsers==0.10 bgreference==0.6 bgsignature==0.2 -bokeh>=1.4.0,<2 -click>=7.0 -cython==0.29.15 -intervaltree>=3.0.2 -matplotlib>=3.1 -numpy>=1.18.1 -pandas>=1.0.1 -pytabix==0.0.2 -scipy>=1.4.1 -statsmodels==0.11.0 - - - - - - - - - +bokeh==1.4.0 +click==8.0.4 +Cython==0.29.37 +intervaltree==3.1.0 +Jinja2==3.0.3 +numpy==1.24.4 +matplotlib==3.6.3 +pandas==1.5.3 +pytabix==0.1 +scipy==1.10.1 +statsmodels==0.14.0 diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..b84802c --- /dev/null +++ b/ruff.toml @@ -0,0 +1,35 @@ +line-length = 120 + +include = [ + "extra/**/*.py", + "oncodrivefml/**/*.py" +] + +[format] +docstring-code-format = true +docstring-code-line-length = 80 + +[lint] + +[lint.per-file-ignores] +"**/scripts/*" = [ + "INP001", + "T201", +] +"**/tests/**/*" = [ + "PLC1901", + "PLR2004", + "PLR6301", + "S", + "TID252", +] + +[lint.flake8-tidy-imports] +ban-relative-imports = "all" + +[lint.isort] +known-first-party = ["oncodrivefml"] + +[lint.flake8-pytest-style] +fixture-parentheses = false +mark-parentheses = false