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
102 changes: 102 additions & 0 deletions easybuild/easyconfigs/c/ColabFold/ColabFold-1.5.5-foss-2024a.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
easyblock = 'PythonBundle'

name = 'ColabFold'
version = '1.5.5'

homepage = 'https://github.com/sokrypton/ColabFold'
description = """Making protein folding accessible to all. Predict proteins structures both in
google colab and on your machine."""
github_account = 'sokrypton'

toolchain = {'name': 'foss', 'version': '2024a'}

checksums = [
{'ColabFold-1.5.5_bioemu-mods.patch':
'89926580a14f298d2b6161ee30e417a6723b97060b8b114b9036987fdf21d3e3'},
]

builddependencies = [
('poetry', '1.8.3'),
('pytest', '8.3.3'),
]
dependencies = [
('Python', '3.12.3'),
('SciPy-bundle', '2024.05'),
('Biopython', '1.84'),
('matplotlib', '3.9.2'),
('py3Dmol', '2.5.0'),
('TensorFlow', '2.18.1'),
('jax', '0.6.2'),
('dm-haiku', '0.0.16'),
('dm-tree', '0.1.9'),
('ml-collections', '1.1.0'),
('tqdm', '4.66.5'),
('OpenMM', '8.3.0'), # for pdbfixer
]

# relax requirements of versions arbitrarily pinned long ago
# fix name of tensorflow package
_relax_req = """sed -i '/^python =.*/d;s/ = "[=<^]/ = ">=/g;s/tensorflow-cpu/tensorflow/g' pyproject.toml &&"""

exts_default_options = {
'sources': [SOURCE_PY3_WHL],
}
exts_list = [
('toolz', '1.1.0', {
'checksums': ['15ccc861ac51c53696de0a5d6d4607f99c210739caf987b5d2054f3efed429d8'],
}),
('chex', '0.1.90', {
'checksums': ['fce3de82588f72d4796e545e574a433aa29229cbdcf792555e41bead24b704ae'],
}),
('immutabledict', '4.2.2', {
'checksums': ['97c31d098a2c850e93a958badeef765e4736ed7942ec73e439facd764a3a7217'],
}),
('PDBFixer', '1.12', {
'source_urls': ['https://github.com/openmm/pdbfixer/archive/refs/tags/'],
'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': SOURCE_TAR_GZ}],
'checksums': ['a5c0b05dfaf2cdcad3b8ffc9ee1e6a955628aade0dda653da04d4a12ba4fe3ec'],
}),
('alphafold-colabfold', '2.3.12', {
'modulename': 'alphafold',
'sources': ['alphafold_colabfold-%(version)s-py3-none-any.whl'],
'checksums': ['40301c48582be6f30952680b1c4a576534854efc0f30fbf7c438fd8304db8af4'],
}),
('colabfold', version, {
'source_urls': ['https://github.com/%(github_account)s/%(name)s/archive'],
'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': SOURCE_TAR_GZ}],
'checksums': ['7fb0ad263c24ec00d46f2dff1611989234bc1351d71653dd06006f2c88f83dcb'],
'use_pip_extras': 'alphafold',
'preinstallopts': _relax_req,
'testinstall': True,
'runtest': 'pytest',
}),
]

postinstallpatches = [
# apply minor modifications needed by BioEmu
('ColabFold-1.5.5_bioemu-mods.patch', 'lib/python%(pyshortver)s/site-packages'),
]

postinstallcmds = [
# copy notebooks to installation directory
"mkdir %(installdir)s/notebooks",
"cp AlphaFold2.ipynb ESMFold.ipynb RoseTTAFold.ipynb %(installdir)s/notebooks/",
# BioEmu checks for the following file in the installation directory
# of ColabFold to accept this installation as usable
"touch %(installdir)s/.COLABFOLD_PATCHED",
]

sanity_check_paths = {
'files': ['bin/colabfold_batch', 'bin/colabfold_search', 'bin/colabfold_split_msas', 'bin/pdbfixer'],
'dirs': ['lib/python%(pyshortver)s/site-packages', 'notebooks'],
}

sanity_check_commands = [
"colabfold_batch --help",
]

modloadmsg = """
%(name)s notebooks are located in $EBROOTCOLABFOLD/notebooks
"""

moduleclass = 'bio'
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Apply modifications needed by BioEmu to ColabFold. These add extra save files
with embedding information and do not break standard functionality of ColabFold.
Improved version of upstream patches available in:
https://github.com/microsoft/bioemu/tree/v.1.2.0/src/bioemu/colabfold_setup
Author: Alex Domingo (Vrije Universiteit Brussel)
--- colabfold/batch.py.orig 2026-02-28 00:05:26.787888483 +0100
+++ colabfold/batch.py 2026-02-28 00:05:34.738629675 +0100
@@ -487,6 +487,9 @@
del plddt
json.dump(scores, handle)

+ if "representations_evo" in result:
+ np.save(files.get("single_repr_evo", "npy"), result["representations_evo"]["single"])
+ np.save(files.get("pair_repr_evo", "npy"), result["representations_evo"]["pair"])
del result, unrelaxed_protein

# early stop criteria fulfilled
--- alphafold/model/modules.py.orig 2026-02-28 14:47:28.432652616 +0100
+++ alphafold/model/modules.py 2026-02-28 14:50:22.859311986 +0100
@@ -143,7 +143,7 @@
if not head_config.weight: continue
heads[name] = head_factory[name](head_config, self.global_config)

- ret = {'representations':representations}
+ ret = {'representations':representations, 'representations_evo': representations}
for name, head in heads.items():
if name in ('predicted_lddt', 'predicted_aligned_error'):
continue