From f09fcc4a6e9262c2362db12d25b328b62ad8e0ba Mon Sep 17 00:00:00 2001 From: jscgh Date: Fri, 10 Jan 2025 13:09:21 +1100 Subject: [PATCH 1/4] Updated AF2 Dockerfile --- ...ile_nfcore-proteinfold_alphafold2_standard | 62 +++++++++++-------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/dockerfiles/Dockerfile_nfcore-proteinfold_alphafold2_standard b/dockerfiles/Dockerfile_nfcore-proteinfold_alphafold2_standard index 774d89f6..84e52c2c 100644 --- a/dockerfiles/Dockerfile_nfcore-proteinfold_alphafold2_standard +++ b/dockerfiles/Dockerfile_nfcore-proteinfold_alphafold2_standard @@ -1,22 +1,26 @@ -FROM nvidia/cuda:11.4.3-cudnn8-runtime-ubuntu18.04 +ARG CUDA=12.2.2 +FROM nvidia/cuda:${CUDA}-cudnn8-runtime-ubuntu20.04 +# FROM directive resets ARGS, so we specify again (the value is retained if +# previously set). +ARG CUDA LABEL authors="Athanasios Baltzis, Jose Espinosa-Carrasco, Leila Mansouri" \ title="nfcore/proteinfold_alphafold2_standard" \ - Version="1.1.0" \ + Version="dev" \ description="Docker image containing all software requirements to run the RUN_ALPHAFOLD2 module using the nf-core/proteinfold pipeline" # Use bash to support string substitution. SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Add env variables -ENV LD_LIBRARY_PATH="/conda/lib:/usr/local/cuda-11.4/lib64:$LD_LIBRARY_PATH" -ENV PATH="/conda/bin:$PATH" +ENV LD_LIBRARY_PATH="/usr/local/cuda-12.2/lib64:$LD_LIBRARY_PATH" RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ +RUN apt-get update --quiet \ + && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y --quiet \ build-essential \ cmake \ - cuda-command-line-tools-11-4 \ + cuda-command-line-tools-$(cut -f1,2 -d- <<< ${CUDA//./-}) \ git \ hmmer \ kalign \ @@ -33,27 +37,26 @@ RUN git clone https://github.com/deepmind/alphafold.git /app/alphafold && \ cd - # Compile HHsuite from source -RUN git clone --branch v3.3.0 https://github.com/soedinglab/hh-suite.git /tmp/hh-suite \ +RUN git clone --branch v3.3.0 --single-branch https://github.com/soedinglab/hh-suite.git /tmp/hh-suite \ && mkdir /tmp/hh-suite/build \ - && cd /tmp/hh-suite/build \ - && cmake -DCMAKE_INSTALL_PREFIX=/opt/hhsuite -DHAVE_AVX2=1 .. \ + && cd /tmp/hh-suite/build \ + && cmake -DCMAKE_INSTALL_PREFIX=/opt/hhsuite .. \ && make -j 4 && make install \ && ln -s /opt/hhsuite/bin/* /usr/bin \ && cd - && rm -rf /tmp/hh-suite -# Install Miniconda package manager +# Install Miniforge package manager RUN wget -q -P /tmp \ - https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - && bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /conda \ - && rm /tmp/Miniconda3-latest-Linux-x86_64.sh + "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" \ + && bash /tmp/Miniforge3-$(uname)-$(uname -m).sh -b -p /opt/conda \ + && rm /tmp/Miniforge3-$(uname)-$(uname -m).sh -# Install conda packages -RUN /conda/bin/conda install -y -c conda-forge \ - openmm=7.7.0 \ - cudatoolkit==11.1.1 \ - pdbfixer \ - pip \ - python=3.10 \ +# Install Conda packages. +ENV PATH="/opt/conda/bin:$PATH" +ENV LD_LIBRARY_PATH="/opt/conda/lib:$LD_LIBRARY_PATH" +RUN conda install --quiet --yes conda==24.11.1 pip python=3.11 \ + && conda install --quiet --yes --channel nvidia cuda=${CUDA_VERSION} \ + && conda install --quiet --yes --channel conda-forge openmm=8.0.0 pdbfixer \ && conda clean --all --force-pkgs-dirs --yes RUN wget -q -P /app/alphafold/alphafold/common/ \ @@ -63,17 +66,26 @@ RUN wget -q -P /app/alphafold/alphafold/common/ \ RUN pip3 install --upgrade pip --no-cache-dir \ && pip3 install -r /app/alphafold/requirements.txt --no-cache-dir \ && pip3 install --upgrade --no-cache-dir \ - jax==0.3.25 \ - jaxlib==0.3.25+cuda11.cudnn805 \ - -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html + jax==0.4.26 \ + jaxlib==0.4.26+cuda12.cudnn89 \ + -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html RUN sed -i "s|alphafold/common/stereo_chemical_props.txt|/app/alphafold/alphafold/common/stereo_chemical_props.txt|g" /app/alphafold/alphafold/common/residue_constants.py # Add SETUID bit to the ldconfig binary so that non-root users can run it. RUN chmod u+s /sbin/ldconfig.real +# Currently needed to avoid undefined_symbol error. +RUN ln -sf /usr/lib/x86_64-linux-gnu/libffi.so.7 /opt/conda/lib/libffi.so.7 + # We need to run `ldconfig` first to ensure GPUs are visible, due to some quirk # with Debian. See https://github.com/NVIDIA/nvidia-docker/issues/1399 for # details. -RUN cd /app/alphafold -RUN ldconfig +# ENTRYPOINT does not support easily running multiple commands, so instead we +# write a shell script to wrap them up. +WORKDIR /app/alphafold +RUN echo $'#!/bin/bash\n\ +ldconfig\n\ +python /app/alphafold/run_alphafold.py "$@"' > /app/run_alphafold.sh \ + && chmod +x /app/run_alphafold.sh +ENTRYPOINT ["/app/run_alphafold.sh"] From 8cb90ad58d1ec965dc0af3b6b9a12c969c433437 Mon Sep 17 00:00:00 2001 From: jscgh Date: Fri, 10 Jan 2025 14:00:16 +1100 Subject: [PATCH 2/4] Prettier --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + .github/workflows/branch.yml | 18 ++++++++---------- .github/workflows/linting_comment.yml | 2 +- .pre-commit-config.yaml | 2 +- LICENSE | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index dd3ef7a9..257da826 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -9,6 +9,7 @@ body: - [nf-core website: troubleshooting](https://nf-co.re/usage/troubleshooting) - [nf-core/proteinfold pipeline documentation](https://nf-co.re/proteinfold/usage) + - type: textarea id: description attributes: diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index d1c7e5f4..cabcdbdd 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -1,17 +1,15 @@ name: nf-core branch protection -# This workflow is triggered on PRs to `main`/`master` branch on the repository -# It fails when someone tries to make a PR against the nf-core `main`/`master` branch instead of `dev` +# This workflow is triggered on PRs to master branch on the repository +# It fails when someone tries to make a PR against the nf-core `master` branch instead of `dev` on: pull_request_target: - branches: - - main - - master + branches: [master] jobs: test: runs-on: ubuntu-latest steps: - # PRs to the nf-core repo main/master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches + # PRs to the nf-core repo master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches - name: Check PRs if: github.repository == 'nf-core/proteinfold' run: | @@ -24,7 +22,7 @@ jobs: uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 with: message: | - ## This PR is against the `${{github.event.pull_request.base.ref}}` branch :x: + ## This PR is against the `master` branch :x: * Do not close this PR * Click _Edit_ and change the `base` to `dev` @@ -34,9 +32,9 @@ jobs: Hi @${{ github.event.pull_request.user.login }}, - It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) ${{github.event.pull_request.base.ref}} branch. - The ${{github.event.pull_request.base.ref}} branch on nf-core repositories should always contain code from the latest release. - Because of this, PRs to ${{github.event.pull_request.base.ref}} are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. + It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `master` branch. + The `master` branch on nf-core repositories should always contain code from the latest release. + Because of this, PRs to `master` are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page. Note that even after this, the test will continue to show as failing until you push a new commit. diff --git a/.github/workflows/linting_comment.yml b/.github/workflows/linting_comment.yml index 0bed96d3..42e519bf 100644 --- a/.github/workflows/linting_comment.yml +++ b/.github/workflows/linting_comment.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Download lint results - uses: dawidd6/action-download-artifact@80620a5d27ce0ae443b965134db88467fc607b43 # v7 + uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 with: workflow: linting.yml workflow_conclusion: completed diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9e9f0e1c..12cb85b7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v3.1.0" + rev: "v4.0.0-alpha.8" hooks: - id: prettier additional_dependencies: diff --git a/LICENSE b/LICENSE index 7f0ffbad..93555944 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) The nf-core/proteinfold team +Copyright (c) Athanasios Baltzis, Jose Espinosa-Carrasco, Harshil Patel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 53c5d71b2fc61ca2d61d3b0f060b5f93c9c0b5cd Mon Sep 17 00:00:00 2001 From: jscgh Date: Fri, 10 Jan 2025 14:05:06 +1100 Subject: [PATCH 3/4] Updated CHANGELOG.md --- CHANGELOG.md | 3 ++- .../Dockerfile_nfcore-proteinfold_alphafold2_standard | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc14ad8d..bce4fda1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,12 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [[#177](https://github.com/nf-core/proteinfold/issues/177)] - Fix typo in some instances of model preset `alphafold2_ptm`. - [[PR #178](https://github.com/nf-core/proteinfold/pull/178)] - Enable running multiple modes in parallel. - [[#179](https://github.com/nf-core/proteinfold/issues/179)] - Produce an interactive html report for the predicted structures. -- [[#180](https://github.com/nf-core/proteinfold/issues/180)] - Implement Fooldseek. +- [[#180](https://github.com/nf-core/proteinfold/issues/180)] - Implement Foldseek. - [[#188](https://github.com/nf-core/proteinfold/issues/188)] - Fix colabfold image to run in gpus. - [[PR ##205](https://github.com/nf-core/proteinfold/pull/205)] - Change input schema from `sequence,fasta` to `id,fasta`. - [[PR #210](https://github.com/nf-core/proteinfold/pull/210)] - Moving post-processing logic to a subworkflow, change wave images pointing to oras to point to https and refactor module to match nf-core folder structure. - [[#214](https://github.com/nf-core/proteinfold/issues/214)] - Fix colabfold image to run in cpus after [#188](https://github.com/nf-core/proteinfold/issues/188) fix. - [[#235](https://github.com/nf-core/proteinfold/issues/235)] - Update samplesheet to new version (switch from `sequence` column to `id`). +- [[#239](https://github.com/nf-core/proteinfold/issues/239)] - Update alphafold2 standard mode Dockerfile. ## [[1.1.1](https://github.com/nf-core/proteinfold/releases/tag/1.1.1)] - 2025-07-30 diff --git a/dockerfiles/Dockerfile_nfcore-proteinfold_alphafold2_standard b/dockerfiles/Dockerfile_nfcore-proteinfold_alphafold2_standard index 84e52c2c..128ac8ac 100644 --- a/dockerfiles/Dockerfile_nfcore-proteinfold_alphafold2_standard +++ b/dockerfiles/Dockerfile_nfcore-proteinfold_alphafold2_standard @@ -66,9 +66,9 @@ RUN wget -q -P /app/alphafold/alphafold/common/ \ RUN pip3 install --upgrade pip --no-cache-dir \ && pip3 install -r /app/alphafold/requirements.txt --no-cache-dir \ && pip3 install --upgrade --no-cache-dir \ - jax==0.4.26 \ - jaxlib==0.4.26+cuda12.cudnn89 \ - -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html + jax==0.4.26 \ + jaxlib==0.4.26+cuda12.cudnn89 \ + -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html RUN sed -i "s|alphafold/common/stereo_chemical_props.txt|/app/alphafold/alphafold/common/stereo_chemical_props.txt|g" /app/alphafold/alphafold/common/residue_constants.py @@ -87,5 +87,5 @@ WORKDIR /app/alphafold RUN echo $'#!/bin/bash\n\ ldconfig\n\ python /app/alphafold/run_alphafold.py "$@"' > /app/run_alphafold.sh \ - && chmod +x /app/run_alphafold.sh + && chmod +x /app/run_alphafold.sh ENTRYPOINT ["/app/run_alphafold.sh"] From 80b698ecceeec1107a7f0aba2c040e802b04c71e Mon Sep 17 00:00:00 2001 From: jscgh Date: Fri, 17 Jan 2025 09:43:39 +1100 Subject: [PATCH 4/4] Revert "Prettier" This reverts commit 8cb90ad58d1ec965dc0af3b6b9a12c969c433437. --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 - .github/workflows/branch.yml | 18 ++++++++++-------- .github/workflows/linting_comment.yml | 2 +- .pre-commit-config.yaml | 2 +- LICENSE | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 257da826..dd3ef7a9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -9,7 +9,6 @@ body: - [nf-core website: troubleshooting](https://nf-co.re/usage/troubleshooting) - [nf-core/proteinfold pipeline documentation](https://nf-co.re/proteinfold/usage) - - type: textarea id: description attributes: diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index cabcdbdd..d1c7e5f4 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -1,15 +1,17 @@ name: nf-core branch protection -# This workflow is triggered on PRs to master branch on the repository -# It fails when someone tries to make a PR against the nf-core `master` branch instead of `dev` +# This workflow is triggered on PRs to `main`/`master` branch on the repository +# It fails when someone tries to make a PR against the nf-core `main`/`master` branch instead of `dev` on: pull_request_target: - branches: [master] + branches: + - main + - master jobs: test: runs-on: ubuntu-latest steps: - # PRs to the nf-core repo master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches + # PRs to the nf-core repo main/master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches - name: Check PRs if: github.repository == 'nf-core/proteinfold' run: | @@ -22,7 +24,7 @@ jobs: uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 with: message: | - ## This PR is against the `master` branch :x: + ## This PR is against the `${{github.event.pull_request.base.ref}}` branch :x: * Do not close this PR * Click _Edit_ and change the `base` to `dev` @@ -32,9 +34,9 @@ jobs: Hi @${{ github.event.pull_request.user.login }}, - It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `master` branch. - The `master` branch on nf-core repositories should always contain code from the latest release. - Because of this, PRs to `master` are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. + It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) ${{github.event.pull_request.base.ref}} branch. + The ${{github.event.pull_request.base.ref}} branch on nf-core repositories should always contain code from the latest release. + Because of this, PRs to ${{github.event.pull_request.base.ref}} are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page. Note that even after this, the test will continue to show as failing until you push a new commit. diff --git a/.github/workflows/linting_comment.yml b/.github/workflows/linting_comment.yml index 42e519bf..0bed96d3 100644 --- a/.github/workflows/linting_comment.yml +++ b/.github/workflows/linting_comment.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Download lint results - uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 + uses: dawidd6/action-download-artifact@80620a5d27ce0ae443b965134db88467fc607b43 # v7 with: workflow: linting.yml workflow_conclusion: completed diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 12cb85b7..9e9f0e1c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v4.0.0-alpha.8" + rev: "v3.1.0" hooks: - id: prettier additional_dependencies: diff --git a/LICENSE b/LICENSE index 93555944..7f0ffbad 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) Athanasios Baltzis, Jose Espinosa-Carrasco, Harshil Patel +Copyright (c) The nf-core/proteinfold team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal