From b8a4e4af2684b0b6d167962c0a64f31c13e054c7 Mon Sep 17 00:00:00 2001 From: WardDeb Date: Wed, 25 Sep 2024 08:46:04 +0200 Subject: [PATCH 01/13] np NANs -> np.nan, np minimal version 2.0 --- deeptools/computeMatrixOperations.py | 2 +- deeptools/heatmapper.py | 2 +- deeptools/plotFingerprint.py | 10 +++++----- pyproject.toml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/deeptools/computeMatrixOperations.py b/deeptools/computeMatrixOperations.py index 6b3272d4..0224f00a 100755 --- a/deeptools/computeMatrixOperations.py +++ b/deeptools/computeMatrixOperations.py @@ -546,7 +546,7 @@ def cbindMatrices(hm, args): # Add on additional NA initialized columns ncol = hm.matrix.matrix.shape[1] hm.matrix.matrix = np.hstack((hm.matrix.matrix, np.empty(hm2.matrix.matrix.shape))) - hm.matrix.matrix[:, ncol:] = np.NAN + hm.matrix.matrix[:, ncol:] = np.nan # Update the values for idx2, group in enumerate(hm2.parameters["group_labels"]): diff --git a/deeptools/heatmapper.py b/deeptools/heatmapper.py index f67afaf4..f86b85e2 100644 --- a/deeptools/heatmapper.py +++ b/deeptools/heatmapper.py @@ -376,7 +376,7 @@ def compute_sub_matrix_worker(self, chrom, start, end, score_file_list, paramete # create an empty matrix to store the values sub_matrix = np.zeros((len(regions), matrix_cols)) - sub_matrix[:] = np.NAN + sub_matrix[:] = np.nan j = 0 sub_regions = [] diff --git a/deeptools/plotFingerprint.py b/deeptools/plotFingerprint.py index 3adce87a..a5a46880 100755 --- a/deeptools/plotFingerprint.py +++ b/deeptools/plotFingerprint.py @@ -203,10 +203,10 @@ def getCHANCE(args, idx, mat): """ # Get the index of the reference sample if args.JSDsample not in args.bamfiles: - return [np.NAN, np.NAN, np.NAN] + return [np.nan, np.nan, np.nan] refIdx = args.bamfiles.index(args.JSDsample) if refIdx == idx: - return [np.NAN, np.NAN, np.NAN] + return [np.nan, np.nan, np.nan] subMatrix = np.copy(mat[:, [idx, refIdx]]) subMatrix[np.isnan(subMatrix)] = 0 @@ -272,10 +272,10 @@ def getJSD(args, idx, mat): # Get the index of the reference sample if args.JSDsample not in args.bamfiles: - return np.NAN + return np.nan refIdx = args.bamfiles.index(args.JSDsample) if refIdx == idx: - return np.NAN + return np.nan # These will hold the coverage histograms chip = np.zeros(MAXLEN, dtype=int) @@ -339,7 +339,7 @@ def signalAndBinDist(x): if abs(sum(PMFinput) - 1) > 0.01 or abs(sum(PMFchip) - 1) > 0.01: sys.stderr.write("Warning: At least one PMF integral is significantly different from 1! The JSD will not be returned") - return np.NAN + return np.nan # Compute the JSD from the PMFs M = (PMFinput + PMFchip) / 2.0 diff --git a/pyproject.toml b/pyproject.toml index 84f14f48..1fe8eeba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ authors = [ ] requires-python = ">=3.8" dependencies = [ - "numpy >= 1.9.0", + "numpy >= 2.0.0", "scipy >= 0.17.0", "matplotlib >= 3.5.0", "pysam >= 0.14.0", From 154ec522ecd4fe17f49f611095e6b5dedcb5ba5e Mon Sep 17 00:00:00 2001 From: WardDeb Date: Wed, 25 Sep 2024 10:43:50 +0200 Subject: [PATCH 02/13] bump version deeptools --- galaxy/wrapper/deepTools_macros.xml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/galaxy/wrapper/deepTools_macros.xml b/galaxy/wrapper/deepTools_macros.xml index 62dd96ee..e02855c5 100755 --- a/galaxy/wrapper/deepTools_macros.xml +++ b/galaxy/wrapper/deepTools_macros.xml @@ -1,7 +1,7 @@ --numberOfProcessors "\${GALAXY_SLOTS:-4}" - 3.5.6 + 3.5.7 22.05 diff --git a/pyproject.toml b/pyproject.toml index 1fe8eeba..3b566fa1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ requires = [ [project] name = "deepTools" -version = "3.5.6" +version = "3.5.7" authors = [ {name="Fidel Ramirez"}, {name="Devon P Ryan"}, From 61fa749d833d0cb6f2255e66459919da982255bf Mon Sep 17 00:00:00 2001 From: WardDeb Date: Wed, 25 Sep 2024 10:44:06 +0200 Subject: [PATCH 03/13] bump galaxy version in planemo tests --- .github/workflows/planemo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/planemo.yml b/.github/workflows/planemo.yml index 067a303c..ff21f209 100644 --- a/.github/workflows/planemo.yml +++ b/.github/workflows/planemo.yml @@ -2,7 +2,7 @@ name: Planemo on: [push, pull_request] env: - GALAXY_BRANCH: release_23.1 + GALAXY_BRANCH: release_24.1 defaults: run: From 6f3c7f5384d3d4862869e9182aa286e71447947a Mon Sep 17 00:00:00 2001 From: WardDeb Date: Wed, 25 Sep 2024 12:05:20 +0200 Subject: [PATCH 04/13] try pure python solution in planemo test --- .github/workflows/planemo.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/planemo.yml b/.github/workflows/planemo.yml index ff21f209..fec500f6 100644 --- a/.github/workflows/planemo.yml +++ b/.github/workflows/planemo.yml @@ -20,24 +20,15 @@ jobs: matrix: chunk: [1, 2, 3] steps: - - uses: actions/checkout@v3 - - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - miniconda-version: "latest" - auto-activate-base: true - - name: setup env - run: | - conda env list - conda install -n base conda-libmamba-solver - conda config --set solver libmamba - conda env create -f .github/test_and_build.yml -n test_and_build + python-version: '3.12' - name: pip install run: | - conda activate test_and_build pip install . - name: planemo run: | - conda activate test_and_build ./.planemo.sh ${{ matrix.chunk }} ${{ env.GALAXY_BRANCH }} - uses: actions/upload-artifact@v3 with: @@ -54,7 +45,7 @@ jobs: - uses: actions/download-artifact@v3 with: path: artifacts - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Cache .cache/pip @@ -69,7 +60,7 @@ jobs: with: mode: combine html-report: true - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: 'All tool test results' path: upload From 28dae775366e4d76d852acaa989c11721cbd9b78 Mon Sep 17 00:00:00 2001 From: WardDeb Date: Wed, 25 Sep 2024 12:07:35 +0200 Subject: [PATCH 05/13] include actions requirements in toml --- pyproject.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3b566fa1..ec38bb39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,14 @@ classifiers = [ "Topic :: Scientific/Engineering :: Bio-Informatics" ] readme = "README.rst" - +[project.optional-dependencies] +actions = [ + "flake8", + "pytest", + "twine", + "build" + "planemo" +] [project.urls] homepage = "https://pypi.python.org/pypi/deepTools/" documentation = "https://deeptools.readthedocs.io/en/latest/" From 28b86576ee6b783e34534d5ffb4f8295da76a9bf Mon Sep 17 00:00:00 2001 From: WardDeb Date: Wed, 25 Sep 2024 12:08:19 +0200 Subject: [PATCH 06/13] planemo action reqs --- .github/workflows/planemo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/planemo.yml b/.github/workflows/planemo.yml index fec500f6..231da895 100644 --- a/.github/workflows/planemo.yml +++ b/.github/workflows/planemo.yml @@ -26,7 +26,7 @@ jobs: python-version: '3.12' - name: pip install run: | - pip install . + pip install .[actions] - name: planemo run: | ./.planemo.sh ${{ matrix.chunk }} ${{ env.GALAXY_BRANCH }} From 5afe3bf601d8335924377b578337d56f91581354 Mon Sep 17 00:00:00 2001 From: WardDeb Date: Wed, 25 Sep 2024 12:13:26 +0200 Subject: [PATCH 07/13] malformatted action deps --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ec38bb39..27448e50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ actions = [ "flake8", "pytest", "twine", - "build" + "build", "planemo" ] [project.urls] From cf8daaad6b4a2c8e6f2dd5098144da461bf28ad2 Mon Sep 17 00:00:00 2001 From: WardDeb Date: Wed, 25 Sep 2024 13:13:09 +0200 Subject: [PATCH 08/13] planemo still requires samtools --- .github/workflows/planemo.yml | 41 ++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/planemo.yml b/.github/workflows/planemo.yml index 231da895..32895cdd 100644 --- a/.github/workflows/planemo.yml +++ b/.github/workflows/planemo.yml @@ -8,10 +8,6 @@ defaults: run: shell: bash -l {0} -# setup micromamba doesn't work as galaxy setup by planemo requires conda. -# installing conda over into micromamba built env screws up the PATH -# setup-miniconda + changing over to libmamba to solve is the easiest workaround - jobs: planemo_test: name: Planemo test @@ -21,16 +17,21 @@ jobs: chunk: [1, 2, 3] steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: conda-incubator/setup-miniconda@v3 with: - python-version: '3.12' + miniconda-version: "latest" + auto-activate-base: true + python-version: "3.12" + - name: get samtools + run: | + conda install -c bioconda samtools - name: pip install run: | pip install .[actions] - name: planemo run: | ./.planemo.sh ${{ matrix.chunk }} ${{ env.GALAXY_BRANCH }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: 'Tool test output ${{ matrix.chunk }}' path: upload @@ -38,22 +39,22 @@ jobs: name: Combine chunked test results needs: planemo_test runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.8', '3.11'] + # strategy: + # matrix: + # python-version: ['3.8', '3.11'] steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: path: artifacts - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Cache .cache/pip - uses: actions/cache@v3 - id: cache-pip - with: - path: ~/.cache/pip - key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ env.GALAXY_BRANCH }} + # - uses: actions/setup-python@v5 + # with: + # python-version: ${{ matrix.python-version }} + # - name: Cache .cache/pip + # uses: actions/cache@v3 + # id: cache-pip + # with: + # path: ~/.cache/pip + # key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ env.GALAXY_BRANCH }} - name: Combine outputs uses: galaxyproject/planemo-ci-action@v1 id: combine From ee2f908e061e8739b055309922a1cabbec1c1bb1 Mon Sep 17 00:00:00 2001 From: WardDeb Date: Wed, 25 Sep 2024 13:20:19 +0200 Subject: [PATCH 09/13] samtools via conda-forge, bioconda --- .github/workflows/planemo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/planemo.yml b/.github/workflows/planemo.yml index 32895cdd..72a7bfe0 100644 --- a/.github/workflows/planemo.yml +++ b/.github/workflows/planemo.yml @@ -24,7 +24,7 @@ jobs: python-version: "3.12" - name: get samtools run: | - conda install -c bioconda samtools + conda install -c conda-forge -c bioconda samtools - name: pip install run: | pip install .[actions] From 3cb08d756a416d8897adebe0b402eb52533ba504 Mon Sep 17 00:00:00 2001 From: WardDeb Date: Wed, 25 Sep 2024 13:42:24 +0200 Subject: [PATCH 10/13] tests via pip, drop conda --- .github/test_and_build.yml | 20 ------------------- .github/workflows/planemo.yml | 12 ------------ .github/workflows/test.yml | 37 ++++++++++++++--------------------- 3 files changed, 15 insertions(+), 54 deletions(-) delete mode 100644 .github/test_and_build.yml diff --git a/.github/test_and_build.yml b/.github/test_and_build.yml deleted file mode 100644 index 0d1c77b2..00000000 --- a/.github/test_and_build.yml +++ /dev/null @@ -1,20 +0,0 @@ -channels: - - conda-forge - - bioconda -dependencies: - - python > 3.7 - - numpy - - scipy - - flake8 - - pysam - - deeptoolsintervals - - pytest - - samtools - - py2bit - - pyBigWig - - twine - - pip - - tomli # remove dependency when lowest supported version is py 3.11 - - pip: - - build - - planemo \ No newline at end of file diff --git a/.github/workflows/planemo.yml b/.github/workflows/planemo.yml index 72a7bfe0..40d09cb5 100644 --- a/.github/workflows/planemo.yml +++ b/.github/workflows/planemo.yml @@ -39,22 +39,10 @@ jobs: name: Combine chunked test results needs: planemo_test runs-on: ubuntu-latest - # strategy: - # matrix: - # python-version: ['3.8', '3.11'] steps: - uses: actions/download-artifact@v4 with: path: artifacts - # - uses: actions/setup-python@v5 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Cache .cache/pip - # uses: actions/cache@v3 - # id: cache-pip - # with: - # path: ~/.cache/pip - # key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ env.GALAXY_BRANCH }} - name: Combine outputs uses: galaxyproject/planemo-ci-action@v1 id: combine diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 07ffd664..ff6687c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest if: github.base_ref == 'master' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check path run: find /home/runner/work/deepTools/deepTools -name "pyproject.toml" - name: Get Version of Deeptools @@ -40,30 +40,26 @@ jobs: name: Test on Linux runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: mamba-org/setup-micromamba@main + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - environment-file: .github/test_and_build.yml - cache-downloads: true - environment-name: test_and_build + python-version: '3.12' + cache: 'pip' - name: pip install run: | - micromamba activate test_and_build - pip install . + pip install .[actions] - name: PEP8 run: | micromamba activate test_and_build flake8 . --exclude=.venv,.build,build --ignore=E501,F403,E402,F999,F405,E722,W504,W605 - name: Test deepTools run: | - micromamba activate test_and_build pytest -v - name: make an artifact run: | - micromamba activate test_and_build rm -f dist/* python -m build - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: "distfiles" path: "dist" @@ -75,12 +71,12 @@ jobs: matrix: python-version: ['3.8','3.9','3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: "distfiles" path: ~/dist/ - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: 'pip' @@ -96,17 +92,14 @@ jobs: name: Test on OSX runs-on: macOS-latest steps: - - uses: actions/checkout@v3 - - uses: mamba-org/setup-micromamba@main + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - environment-file: .github/test_and_build.yml - cache-downloads: true - environment-name: test_and_build + python-version: '3.12' + cache: 'pip' - name: pip install run: | - micromamba activate test_and_build - pip install . + pip install .[actions] - name: Test deepTools run: | - micromamba activate test_and_build pytest -v From ee5eb0da2d474e3054a52a6176b6dfd164b86686 Mon Sep 17 00:00:00 2001 From: WardDeb Date: Wed, 25 Sep 2024 14:22:38 +0200 Subject: [PATCH 11/13] minimal supported python version 3.9 (numpy 2) --- .github/workflows/test.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff6687c4..201633d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,7 +69,7 @@ jobs: needs: build-linux strategy: matrix: - python-version: ['3.8','3.9','3.10', '3.11', '3.12'] + python-version: ['3.9','3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 diff --git a/pyproject.toml b/pyproject.toml index 27448e50..7fe4ea0b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ authors = [ {name="Thomas Manke"}, {email="bioinfo-core@ie-freiburg.mpg.de"} ] -requires-python = ">=3.8" +requires-python = "> 3.8" dependencies = [ "numpy >= 2.0.0", "scipy >= 0.17.0", From fd8f721f2dc85d672f3ae061e0eb2b40e79ea884 Mon Sep 17 00:00:00 2001 From: WardDeb Date: Wed, 25 Sep 2024 14:25:19 +0200 Subject: [PATCH 12/13] v3.5.6 suffices for now --- galaxy/wrapper/deepTools_macros.xml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/galaxy/wrapper/deepTools_macros.xml b/galaxy/wrapper/deepTools_macros.xml index e02855c5..62dd96ee 100755 --- a/galaxy/wrapper/deepTools_macros.xml +++ b/galaxy/wrapper/deepTools_macros.xml @@ -1,7 +1,7 @@ --numberOfProcessors "\${GALAXY_SLOTS:-4}" - 3.5.7 + 3.5.6 22.05 diff --git a/pyproject.toml b/pyproject.toml index 7fe4ea0b..2072ec1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ requires = [ [project] name = "deepTools" -version = "3.5.7" +version = "3.5.6" authors = [ {name="Fidel Ramirez"}, {name="Devon P Ryan"}, From 60bec9a2ef9c05f435f6f291cda6ad6274d2f6b4 Mon Sep 17 00:00:00 2001 From: WardDeb Date: Wed, 25 Sep 2024 15:00:19 +0200 Subject: [PATCH 13/13] drop conda usage from pypi action --- .github/workflows/pypi.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index a04d98c2..a7f63162 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -15,15 +15,14 @@ jobs: name: upload to pypi runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: mamba-org/setup-micromamba@main + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - environment-file: .github/test_and_build.yml - cache-downloads: true - environment-name: test_and_build + python-version: '3.12' + cache: 'pip' - name: build run: | - micromamba activate test_and_build + pip install .[actions] rm -f dist/* python -m build - name: upload @@ -31,5 +30,4 @@ jobs: TWINE_USERNAME: "__token__" TWINE_PASSWORD: ${{ secrets.pypi_password }} run: | - micromamba activate test_and_build twine upload dist/*