Skip to content

Commit 13d2c71

Browse files
authored
Merge pull request #470 from KosinskiLab/alphafold3_backend
Alphafold3 backend
2 parents 8e33e7a + 7d19598 commit 13d2c71

File tree

8 files changed

+711
-84
lines changed

8 files changed

+711
-84
lines changed

.github/workflows/github_actions.yml

+28-67
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- main
88
release:
99
types: [published]
10-
workflow_dispatch:
10+
workflow_dispatch:
1111

1212
jobs:
1313
build-and-test:
@@ -16,39 +16,32 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
python-version: ["3.10", "3.11"]
19-
install-type: ['user', 'developer']
19+
install-type: ["user", "developer"]
20+
21+
defaults:
22+
run:
23+
shell: bash -el {0}
2024

2125
steps:
22-
- uses: webfactory/[email protected]
23-
with:
24-
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
2526
- uses: actions/checkout@v4
2627
with:
2728
submodules: recursive
28-
- uses: actions/setup-python@v4
29+
30+
- uses: conda-incubator/setup-miniconda@v3
2931
with:
32+
environment-file: environment.yml
33+
activate-environment: AlphaPulldown
3034
python-version: ${{ matrix.python-version }}
31-
cache: "pip"
32-
- run: python -c "import sys; print(sys.version)"
33-
- run: |
34-
echo $CONDA/bin >> $GITHUB_PATH
35-
echo "$GITHUB_WORKSPACE/alphapulldown" >> $GITHUB_PATH
35+
auto-update-conda: true
36+
use-mamba: true
37+
3638
- if: matrix.install-type == 'user'
3739
run: |
38-
conda install -y -c conda-forge mamba
39-
mamba create -n AlphaPulldown -c omnia -c bioconda -c conda-forge python==${{ matrix.python-version }} \
40-
openmm==8.0 pdbfixer==1.9 kalign2 hmmer hhsuite modelcif
41-
eval "$(conda shell.bash hook)"
42-
conda activate AlphaPulldown
4340
pip install alphapulldown
4441
pip install -U "jax[cuda12]"
42+
4543
- if: matrix.install-type == 'developer'
4644
run: |
47-
conda install -y -c conda-forge mamba
48-
mamba create -n AlphaPulldown -c omnia -c bioconda -c conda-forge python==${{ matrix.python-version }} \
49-
openmm==8.0 pdbfixer==1.9 kalign2 hmmer hhsuite modelcif
50-
eval "$(conda shell.bash hook)"
51-
conda activate AlphaPulldown
5245
pip install .
5346
pip install -U "jax[cuda12]"
5447
# export PYTHONPATH=$PWD/AlphaLink2:$PYTHONPATH
@@ -60,8 +53,6 @@ jobs:
6053
# python setup.py install --disable-cuda-ext
6154
# cd ..
6255
- run: |
63-
eval "$(conda shell.bash hook)"
64-
conda activate AlphaPulldown
6556
python test/test_python_imports.py
6657
pytest -s test/test_custom_db.py
6758
pytest -s test/test_remove_clashes_low_plddt.py
@@ -71,8 +62,8 @@ jobs:
7162
pytest -s test/test_parse_fold.py
7263
#export PYTHONPATH=$PWD/alphapulldown/analysis_pipeline:$PYTHONPATH
7364
## Test analysis pipeline
74-
#conda install -c bioconda biopandas
75-
#pip install pyrosetta-installer
65+
#conda install -c bioconda biopandas
66+
#pip install pyrosetta-installer
7667
#python -c 'import pyrosetta_installer; pyrosetta_installer.install_pyrosetta()'
7768
#pytest -s test/test_pdb_analyser.py
7869
#pytest -s test/test_get_good_inter_pae.py
@@ -83,22 +74,13 @@ jobs:
8374
- uses: webfactory/[email protected]
8475
with:
8576
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
86-
- name: Checkout
87-
uses: actions/checkout@v4
88-
89-
- name: Free disk space
90-
run: |
91-
rm -rf /opt/hostedtoolcache
92-
93-
- name: Login to Docker Hub
94-
uses: docker/login-action@v3
77+
- uses: actions/checkout@v4
78+
- run: rm -rf /opt/hostedtoolcache
79+
- uses: docker/login-action@v3
9580
with:
9681
username: ${{ secrets.DOCKER_USERNAME }}
9782
password: ${{ secrets.DOCKER_PASSWORD }}
98-
99-
- name: Set up Docker Buildx
100-
uses: docker/setup-buildx-action@v3
101-
83+
- uses: docker/setup-buildx-action@v3
10284
- name: Build and push fold container
10385
if: github.event_name == 'push'
10486
uses: docker/build-push-action@v5
@@ -108,7 +90,6 @@ jobs:
10890
push: true
10991
tags: ${{ secrets.DOCKER_USERNAME }}/fold:latest
11092
ssh: default
111-
11293
- name: Build and push fold container with version
11394
if: github.event_name == 'release' && github.event.action == 'published'
11495
uses: docker/build-push-action@v5
@@ -125,22 +106,13 @@ jobs:
125106
- uses: webfactory/[email protected]
126107
with:
127108
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
128-
- name: Checkout
129-
uses: actions/checkout@v4
130-
131-
- name: Free disk space
132-
run: |
133-
rm -rf /opt/hostedtoolcache
134-
135-
- name: Login to Docker Hub
136-
uses: docker/login-action@v3
109+
- uses: actions/checkout@v4
110+
- run: rm -rf /opt/hostedtoolcache
111+
- uses: docker/login-action@v3
137112
with:
138113
username: ${{ secrets.DOCKER_USERNAME }}
139114
password: ${{ secrets.DOCKER_PASSWORD }}
140-
141-
- name: Set up Docker Buildx
142-
uses: docker/setup-buildx-action@v3
143-
115+
- uses: docker/setup-buildx-action@v3
144116
- name: Build and push alphalink container
145117
if: github.event_name == 'push'
146118
uses: docker/build-push-action@v5
@@ -150,7 +122,6 @@ jobs:
150122
push: true
151123
tags: ${{ secrets.DOCKER_USERNAME }}/alphalink:latest
152124
ssh: default
153-
154125
- name: Build and push alphalink container with version
155126
if: github.event_name == 'release' && github.event.action == 'published'
156127
uses: docker/build-push-action@v5
@@ -164,22 +135,13 @@ jobs:
164135
build-analysis-container:
165136
runs-on: ubuntu-latest
166137
steps:
167-
- name: Checkout
168-
uses: actions/checkout@v4
169-
170-
- name: Free disk space
171-
run: |
172-
rm -rf /opt/hostedtoolcache
173-
174-
- name: Login to Docker Hub
175-
uses: docker/login-action@v3
138+
- uses: actions/checkout@v4
139+
- run: rm -rf /opt/hostedtoolcache
140+
- uses: docker/login-action@v3
176141
with:
177142
username: ${{ secrets.DOCKER_USERNAME }}
178143
password: ${{ secrets.DOCKER_PASSWORD }}
179-
180-
- name: Set up Docker Buildx
181-
uses: docker/setup-buildx-action@v3
182-
144+
- uses: docker/setup-buildx-action@v3
183145
- name: Build and push analysis container
184146
if: github.event_name == 'push'
185147
uses: docker/build-push-action@v5
@@ -188,7 +150,6 @@ jobs:
188150
file: ./docker/analysis.dockerfile
189151
push: true
190152
tags: ${{ secrets.DOCKER_USERNAME }}/fold_analysis:latest
191-
192153
- name: Build and push analysis container with version
193154
if: github.event_name == 'release' && github.event.action == 'published'
194155
uses: docker/build-push-action@v5

.gitmodules

+4
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414
path = ColabFold
1515
url = [email protected]:sokrypton/ColabFold.git
1616
branch = main
17+
[submodule "alphafold3"]
18+
path = alphafold3
19+
url = [email protected]:google-deepmind/alphafold3.git
20+
branch = main

alphafold3

Submodule alphafold3 added at aa724ca

alphapulldown/folding_backend/__init__.py

+13-5
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,23 @@ def import_backends(self) -> None:
4343
from .alphalink_backend import AlphaLinkBackend
4444
self._BACKEND_REGISTRY.update({"alphalink": AlphaLinkBackend})
4545
except Exception as e:
46-
logging.warning("Failed to import AlphaLinkBackend. Perhaps you haven't installed all the required dependencies.")
47-
46+
logging.warning(
47+
f"Failed to import AlphaLinkBackend: {e}. Perhaps you haven't installed all the required dependencies.")
48+
4849
try:
4950
from .unifold_backend import UnifoldBackend
5051
self._BACKEND_REGISTRY.update({"unifold": UnifoldBackend})
51-
5252
except Exception as e:
53-
logging.warning("Failed to import UnifoldBackend. Perhaps you haven't installed all the required dependencies.")
54-
53+
logging.warning(
54+
f"Failed to import UnifoldBackend: {e}. Perhaps you haven't installed all the required dependencies.")
55+
56+
try:
57+
from .alphafold3_backend import AlphaFold3Backend
58+
self._BACKEND_REGISTRY.update({"alphafold3": AlphaFold3Backend})
59+
except Exception as e:
60+
logging.warning(
61+
f"Failed to import AlphaFold3Backend: {e}. Perhaps you haven't installed all the required dependencies.")
62+
5563
def __repr__(self):
5664
return f"<BackendManager: using {self._backend_name}>"
5765

0 commit comments

Comments
 (0)