From 4fe2a103b1881cb6f4e03bdd6f18ee71f4262203 Mon Sep 17 00:00:00 2001 From: Miguel Dias Costa Date: Fri, 5 Aug 2022 15:05:15 +0800 Subject: [PATCH 1/6] adding easyconfigs: colossalai-0.1.8-foss-2021a-CUDA-11.3.1.eb, einops-0.4.1-GCCcore-10.3.0.eb, OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb, OpenMM-7.5.1-foss-2021a_AlphaFold.eb and patches: OpenMM-7.5.1_AlphaFold.patch --- ...colossalai-0.1.8-foss-2021a-CUDA-11.3.1.eb | 55 +++++++++++ .../e/einops/einops-0.4.1-GCCcore-10.3.0.eb | 29 ++++++ .../OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb | 91 +++++++++++++++++++ .../OpenMM-7.5.1-foss-2021a_AlphaFold.eb | 55 +++++++++++ .../o/OpenMM/OpenMM-7.5.1_AlphaFold.patch | 45 +++++++++ 5 files changed, 275 insertions(+) create mode 100644 easybuild/easyconfigs/c/colossalai/colossalai-0.1.8-foss-2021a-CUDA-11.3.1.eb create mode 100644 easybuild/easyconfigs/e/einops/einops-0.4.1-GCCcore-10.3.0.eb create mode 100644 easybuild/easyconfigs/o/OpenFold/OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb create mode 100644 easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a_AlphaFold.eb create mode 100644 easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1_AlphaFold.patch diff --git a/easybuild/easyconfigs/c/colossalai/colossalai-0.1.8-foss-2021a-CUDA-11.3.1.eb b/easybuild/easyconfigs/c/colossalai/colossalai-0.1.8-foss-2021a-CUDA-11.3.1.eb new file mode 100644 index 00000000000..ecd12d1162f --- /dev/null +++ b/easybuild/easyconfigs/c/colossalai/colossalai-0.1.8-foss-2021a-CUDA-11.3.1.eb @@ -0,0 +1,55 @@ +easyblock = 'PythonBundle' + +name = 'colossalai' +version = '0.1.8' +versionsuffix = '-CUDA-%(cudaver)s' + +homepage = 'https://colossalai.org/' +description = """Colossal-AI: A Unified Deep Learning System for Big Model Era""" + +toolchain = {'name': 'foss', 'version': '2021a'} + +dependencies = [ + ('Python', '3.9.5'), + ('CUDA', '11.3.1', '', True), + ('SciPy-bundle', '2021.05'), + ('PyTorch-Lightning', '1.5.9', versionsuffix), + ('torchvision', '0.11.1', versionsuffix), +] + +exts_list = [ + ('cfgv', '3.3.1', { + 'checksums': ['f5a830efb9ce7a445376bb66ec94c638a9787422f96264c98edc6bdeed8ab736'], + }), + ('identify', '2.5.1', { + 'checksums': ['3d11b16f3fe19f52039fb7e39c9c884b21cb1b586988114fbe42671f03de3e82'], + }), + ('nodeenv', '1.6.0', { + 'checksums': ['3ef13ff90291ba2a4a7a4ff9a979b63ffdd00a464dbe04acf0ea6471517a4c2b'], + }), + ('pre_commit', '2.19.0', { + 'checksums': ['4233a1e38621c87d9dda9808c6606d7e7ba0e087cd56d3fe03202a01d2919615'], + }), + ('commonmark', '0.9.1', { + 'checksums': ['452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60'], + }), + ('rich', '12.4.4', { + 'checksums': ['4c586de507202505346f3e32d1363eb9ed6932f0c2f63184dea88983ff4971e2'], + }), + ('invoke', '1.7.1', { + 'checksums': ['7b6deaf585eee0a848205d0b8c0014b9bf6f287a8eb798818a642dff1df14b19'], + }), + ('fabric', '2.7.1', { + 'checksums': ['76f8fef59cf2061dbd849bbce4fe49bdd820884385004b0ca59136ac3db129e4'], + }), + (name, version, { + 'checksums': ['3a2cdd4dc2d8b4832fa132a0bd1102f86c38f6865d7f119018404069d35984b2'], + }), +] + +download_dep_fail = True +use_pip = True + +sanity_pip_check = True + +moduleclass = 'ai' diff --git a/easybuild/easyconfigs/e/einops/einops-0.4.1-GCCcore-10.3.0.eb b/easybuild/easyconfigs/e/einops/einops-0.4.1-GCCcore-10.3.0.eb new file mode 100644 index 00000000000..80b81ff50b5 --- /dev/null +++ b/easybuild/easyconfigs/e/einops/einops-0.4.1-GCCcore-10.3.0.eb @@ -0,0 +1,29 @@ +easyblock = 'PythonPackage' + +name = 'einops' +version = '0.4.1' + +homepage = 'https://einops.rocks/' +description = """ +Flexible and powerful tensor operations for readable and reliable code. +Supports numpy, pytorch, tensorflow, jax, and others.""" + +toolchain = {'name': 'GCCcore', 'version': '10.3.0'} + +sources = [SOURCE_TAR_GZ] +checksums = ['65ede824fa54ce99ba969c61152f9948eb8cad08d5f0ca97c95e3804bafcce48'] + +builddependencies = [ + ('binutils', '2.36.1'), +] + +dependencies = [ + ('Python', '3.9.5'), +] + +download_dep_fail = True +use_pip = True + +sanity_pip_check = True + +moduleclass = 'math' diff --git a/easybuild/easyconfigs/o/OpenFold/OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb b/easybuild/easyconfigs/o/OpenFold/OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb new file mode 100644 index 00000000000..2dde80a23b1 --- /dev/null +++ b/easybuild/easyconfigs/o/OpenFold/OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb @@ -0,0 +1,91 @@ +easyblock = 'PythonBundle' + +name = 'OpenFold' +version = '1.0.0' +versionsuffix = '-CUDA-%(cudaver)s' + +homepage = 'https://github.com/aqlaboratory/openfold' +description = "A faithful PyTorch reproduction of DeepMind's AlphaFold 2" + +toolchain = {'name': 'foss', 'version': '2021a'} + +builddependencies = [ + ('CMake', '3.20.1'), # required to build ninja +] + +dependencies = [ + ('Python', '3.9.5'), + ('CUDA', '11.3.1', '', True), + ('SciPy-bundle', '2021.05'), + ('PyYAML', '5.4.1'), + ('Biopython', '1.79'), + ('HH-suite', '3.3.0'), + ('HMMER', '3.3.2'), + ('Kalign', '3.3.1'), + ('UCX-CUDA', '1.10.0', versionsuffix), + ('cuDNN', '8.2.1.32', versionsuffix, True), + ('NCCL', '2.10.3', versionsuffix), + ('dm-tree', '0.1.6'), + ('einops', '0.4.1'), + ('colossalai', '0.1.8', versionsuffix), + ('scikit-build', '0.11.1'), + ('OpenMM', '7.5.1', '_AlphaFold'), # patched OpenMM +] + +use_pip = True + +exts_list = [ + ('PDBFixer', '1.7', { + 'source_urls': ['https://github.com/openmm/pdbfixer/archive/refs/tags/'], + 'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': '%(name)s-%(version)s.tar.gz'}], + 'checksums': ['a0bef3c52a7bbe69a6aea5333f51f3e7d158339be5829aed19b0344bd66d4eea'], + }), + ('ninja', '1.10.2.3', { + 'checksums': ['e1b86ad50d4e681a7dbdff05fc23bb52cb773edb90bc428efba33fa027738408'], + }), + ('hjson', '3.0.2', { + 'checksums': ['2838fd7200e5839ea4516ece953f3a19892c41089f0d933ba3f68e596aacfcd5'], + }), + ('py-cpuinfo', '8.0.0', { + 'modulename': 'cpuinfo', + 'checksums': ['5f269be0e08e33fd959de96b34cd4aeeeacac014dd8305f70eb28d06de2345c5'], + }), + ('triton', version, { + 'source_tmpl': '%(name)s-%(version)s-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', + 'checksums': ['37b8d0eb36ed7631a6f9d01bd3183f900ae7dbd9e5e40112468a3568505671dc'], + }), + ('deepspeed', '0.5.9', { + 'checksums': ['7c43d151b51d346a430034e77764097c4af7637217c08503291c48c37ae7d090'], + }), + ('contextlib2', '21.6.0', { + 'checksums': ['ab1e2bfe1d01d968e1b7e8d9023bc51ef3509bba217bb730cee3827e1ee82869'], + }), + ('ml_collections', '0.1.0', { + 'preinstallopts': "touch requirements.txt && touch requirements-test.txt && ", + 'checksums': ['59a17fcd1c140153009788517f304caaddd7a94f06690f9f0ed09987beebcf3c'], + }), + ('dllogger', version, { + 'source_urls': ['https://github.com/NVIDIA/dllogger/archive/refs/tags/'], + 'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': '%(name)s-%(version)s.tar.gz'}], + 'checksums': ['43e5e3c3acf891dfe6151f7d869f3ad2424772fe57fd8dcb0a45bad06de93bf7'], + }), + (name, version, { + 'source_urls': ['https://github.com/aqlaboratory/openfold/archive/refs/tags/'], + 'sources': ['v%(version)s.tar.gz'], + 'checksums': ['543cb0d36a6118a60de4b4ec2f4a49ebcc965523e5b31e9ad03425de367384a7'], + }), +] + +sanity_check_paths = { + 'files': ['bin/pdbfixer'], + 'dirs': ['lib/python%(pyshortver)s/site-packages'], +} + +sanity_check_commands = [ + "pdbfixer --help", + "python -c 'import openfold'", +] + +sanity_pip_check = True + +moduleclass = 'bio' diff --git a/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a_AlphaFold.eb b/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a_AlphaFold.eb new file mode 100644 index 00000000000..00b1c233032 --- /dev/null +++ b/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a_AlphaFold.eb @@ -0,0 +1,55 @@ +easyblock = 'CMakeMake' + +name = 'OpenMM' +version = '7.5.1' +versionsuffix = '_AlphaFold' + +homepage = 'https://openmm.org' +description = "OpenMM is a toolkit for molecular simulation." + +toolchain = {'name': 'foss', 'version': '2021a'} +toolchainopts = {'opt': True} + +source_urls = ['https://github.com/openmm/openmm/archive/'] +sources = ['%(version)s.tar.gz'] +patches = [('OpenMM-%(version)s_AlphaFold.patch', 'wrappers/python')] +checksums = [ + 'c88d6946468a2bde2619acb834f57b859b5e114a93093cf562165612e10f4ff7', + '1b109dfff3af5c6aa70690bca14618612953c68840a7e64f679db7ca33c1aff6', +] + +builddependencies = [ + ('CMake', '3.20.1'), + ('Doxygen', '1.9.1'), +] + +separate_build_dir = True + +dependencies = [ + ('Python', '3.9.5'), + ('SciPy-bundle', '2021.05'), + ('SWIG', '4.0.2'), +] + +runtest = """test -e ARGS="-E \'(Integrator)|(Thermostat)|(Barostat)|(Rpmd)|(Amoeba)|(HippoNonbondedForce)\'" """ + +preinstallopts = ' export OPENMM_INCLUDE_PATH=%(installdir)s/include && ' +preinstallopts += ' export OPENMM_LIB_PATH=%(installdir)s/lib && ' + +# required to install the python API +installopts = ' && cd python && python setup.py build && python setup.py install --prefix=%(installdir)s' + +sanity_check_paths = { + 'files': ['lib/libOpenMM.%s' % SHLIB_EXT, 'lib/python%(pyshortver)s/site-packages/simtk/openmm/openmm.py'], + 'dirs': [] +} + +sanity_check_commands = ["python -m simtk.testInstallation"] + +modextrapaths = { + 'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages', + 'OPENMM_INCLUDE_PATH': 'include', + 'OPENMM_LIB_PATH': 'lib', +} + +moduleclass = 'bio' diff --git a/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1_AlphaFold.patch b/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1_AlphaFold.patch new file mode 100644 index 00000000000..878ffd11b03 --- /dev/null +++ b/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1_AlphaFold.patch @@ -0,0 +1,45 @@ +custom patch for OpenMM to use in conjunction with AlphaFold +see https://github.com/deepmind/alphafold/blob/main/docker/openmm.patch + +Index: simtk/openmm/app/topology.py +=================================================================== +--- simtk.orig/openmm/app/topology.py ++++ simtk/openmm/app/topology.py +@@ -356,19 +356,35 @@ + def isCyx(res): + names = [atom.name for atom in res._atoms] + return 'SG' in names and 'HG' not in names ++ # This function is used to prevent multiple di-sulfide bonds from being ++ # assigned to a given atom. This is a DeepMind modification. ++ def isDisulfideBonded(atom): ++ for b in self._bonds: ++ if (atom in b and b[0].name == 'SG' and ++ b[1].name == 'SG'): ++ return True ++ ++ return False + + cyx = [res for res in self.residues() if res.name == 'CYS' and isCyx(res)] + atomNames = [[atom.name for atom in res._atoms] for res in cyx] + for i in range(len(cyx)): + sg1 = cyx[i]._atoms[atomNames[i].index('SG')] + pos1 = positions[sg1.index] ++ candidate_distance, candidate_atom = 0.3*nanometers, None + for j in range(i): + sg2 = cyx[j]._atoms[atomNames[j].index('SG')] + pos2 = positions[sg2.index] + delta = [x-y for (x,y) in zip(pos1, pos2)] + distance = sqrt(delta[0]*delta[0] + delta[1]*delta[1] + delta[2]*delta[2]) +- if distance < 0.3*nanometers: +- self.addBond(sg1, sg2) ++ if distance < candidate_distance and not isDisulfideBonded(sg2): ++ candidate_distance = distance ++ candidate_atom = sg2 ++ # Assign bond to closest pair. ++ if candidate_atom: ++ self.addBond(sg1, candidate_atom) ++ ++ + + class Chain(object): + """A Chain object represents a chain within a Topology.""" From 9cd691bc54ff9ba6bcd27ca5ff6e011a242d7e8c Mon Sep 17 00:00:00 2001 From: Miguel Dias Costa Date: Sat, 6 Aug 2022 00:44:13 +0800 Subject: [PATCH 2/6] remove download_dep_fail --- .../colossalai/colossalai-0.1.8-foss-2021a-CUDA-11.3.1.eb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/easybuild/easyconfigs/c/colossalai/colossalai-0.1.8-foss-2021a-CUDA-11.3.1.eb b/easybuild/easyconfigs/c/colossalai/colossalai-0.1.8-foss-2021a-CUDA-11.3.1.eb index ecd12d1162f..5a14fa765f1 100644 --- a/easybuild/easyconfigs/c/colossalai/colossalai-0.1.8-foss-2021a-CUDA-11.3.1.eb +++ b/easybuild/easyconfigs/c/colossalai/colossalai-0.1.8-foss-2021a-CUDA-11.3.1.eb @@ -17,6 +17,9 @@ dependencies = [ ('torchvision', '0.11.1', versionsuffix), ] +use_pip = True +sanity_pip_check = True + exts_list = [ ('cfgv', '3.3.1', { 'checksums': ['f5a830efb9ce7a445376bb66ec94c638a9787422f96264c98edc6bdeed8ab736'], @@ -47,9 +50,4 @@ exts_list = [ }), ] -download_dep_fail = True -use_pip = True - -sanity_pip_check = True - moduleclass = 'ai' From e24daad29fb434d056ef4668c255d751ab50af39 Mon Sep 17 00:00:00 2001 From: Miguel Dias Costa Date: Sun, 7 Aug 2022 02:25:34 +0800 Subject: [PATCH 3/6] clarify comments and remove redundant sanity check command --- .../o/OpenFold/OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/easybuild/easyconfigs/o/OpenFold/OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb b/easybuild/easyconfigs/o/OpenFold/OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb index 2dde80a23b1..209e65a8c5d 100644 --- a/easybuild/easyconfigs/o/OpenFold/OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb +++ b/easybuild/easyconfigs/o/OpenFold/OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb @@ -10,7 +10,8 @@ description = "A faithful PyTorch reproduction of DeepMind's AlphaFold 2" toolchain = {'name': 'foss', 'version': '2021a'} builddependencies = [ - ('CMake', '3.20.1'), # required to build ninja + # CMake is required to build ninja Python package (included as extension) + ('CMake', '3.20.1'), ] dependencies = [ @@ -29,7 +30,10 @@ dependencies = [ ('einops', '0.4.1'), ('colossalai', '0.1.8', versionsuffix), ('scikit-build', '0.11.1'), - ('OpenMM', '7.5.1', '_AlphaFold'), # patched OpenMM + # OpenFold also requires the AlphaFold modification to OpenMM + # https://github.com/aqlaboratory/openfold/blob/v1.0.0/scripts/install_third_party_dependencies.sh#L20-L24 + # https://github.com/aqlaboratory/openfold/blob/v1.0.0/lib/openmm.patch + ('OpenMM', '7.5.1', '_AlphaFold'), ] use_pip = True @@ -83,7 +87,6 @@ sanity_check_paths = { sanity_check_commands = [ "pdbfixer --help", - "python -c 'import openfold'", ] sanity_pip_check = True From 99d129df26a8fc93a8073c1e1dd6d237b8266702 Mon Sep 17 00:00:00 2001 From: Miguel Dias Costa Date: Sun, 7 Aug 2022 06:52:58 +0800 Subject: [PATCH 4/6] change versionsuffix of the OpenMM easyconfig that includes DeepMind's patch to -DeepMind-patch --- .../OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb | 2 +- ...OpenMM-7.5.1-foss-2021a-DeepMind-patch.eb} | 4 +- .../o/OpenMM/OpenMM-7.5.1_DeepMind.patch | 45 +++++++++++++++++++ 3 files changed, 48 insertions(+), 3 deletions(-) rename easybuild/easyconfigs/o/OpenMM/{OpenMM-7.5.1-foss-2021a_AlphaFold.eb => OpenMM-7.5.1-foss-2021a-DeepMind-patch.eb} (93%) create mode 100644 easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1_DeepMind.patch diff --git a/easybuild/easyconfigs/o/OpenFold/OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb b/easybuild/easyconfigs/o/OpenFold/OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb index 209e65a8c5d..f4797eae8eb 100644 --- a/easybuild/easyconfigs/o/OpenFold/OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb +++ b/easybuild/easyconfigs/o/OpenFold/OpenFold-1.0.0-foss-2021a-CUDA-11.3.1.eb @@ -33,7 +33,7 @@ dependencies = [ # OpenFold also requires the AlphaFold modification to OpenMM # https://github.com/aqlaboratory/openfold/blob/v1.0.0/scripts/install_third_party_dependencies.sh#L20-L24 # https://github.com/aqlaboratory/openfold/blob/v1.0.0/lib/openmm.patch - ('OpenMM', '7.5.1', '_AlphaFold'), + ('OpenMM', '7.5.1', '-DeepMind-patch'), ] use_pip = True diff --git a/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a_AlphaFold.eb b/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a-DeepMind-patch.eb similarity index 93% rename from easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a_AlphaFold.eb rename to easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a-DeepMind-patch.eb index 00b1c233032..cd9f06a4f42 100644 --- a/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a_AlphaFold.eb +++ b/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a-DeepMind-patch.eb @@ -2,7 +2,7 @@ easyblock = 'CMakeMake' name = 'OpenMM' version = '7.5.1' -versionsuffix = '_AlphaFold' +versionsuffix = '-DeepMind-patch' homepage = 'https://openmm.org' description = "OpenMM is a toolkit for molecular simulation." @@ -12,7 +12,7 @@ toolchainopts = {'opt': True} source_urls = ['https://github.com/openmm/openmm/archive/'] sources = ['%(version)s.tar.gz'] -patches = [('OpenMM-%(version)s_AlphaFold.patch', 'wrappers/python')] +patches = [('OpenMM-%(version)s_DeepMind.patch', 'wrappers/python')] checksums = [ 'c88d6946468a2bde2619acb834f57b859b5e114a93093cf562165612e10f4ff7', '1b109dfff3af5c6aa70690bca14618612953c68840a7e64f679db7ca33c1aff6', diff --git a/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1_DeepMind.patch b/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1_DeepMind.patch new file mode 100644 index 00000000000..878ffd11b03 --- /dev/null +++ b/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1_DeepMind.patch @@ -0,0 +1,45 @@ +custom patch for OpenMM to use in conjunction with AlphaFold +see https://github.com/deepmind/alphafold/blob/main/docker/openmm.patch + +Index: simtk/openmm/app/topology.py +=================================================================== +--- simtk.orig/openmm/app/topology.py ++++ simtk/openmm/app/topology.py +@@ -356,19 +356,35 @@ + def isCyx(res): + names = [atom.name for atom in res._atoms] + return 'SG' in names and 'HG' not in names ++ # This function is used to prevent multiple di-sulfide bonds from being ++ # assigned to a given atom. This is a DeepMind modification. ++ def isDisulfideBonded(atom): ++ for b in self._bonds: ++ if (atom in b and b[0].name == 'SG' and ++ b[1].name == 'SG'): ++ return True ++ ++ return False + + cyx = [res for res in self.residues() if res.name == 'CYS' and isCyx(res)] + atomNames = [[atom.name for atom in res._atoms] for res in cyx] + for i in range(len(cyx)): + sg1 = cyx[i]._atoms[atomNames[i].index('SG')] + pos1 = positions[sg1.index] ++ candidate_distance, candidate_atom = 0.3*nanometers, None + for j in range(i): + sg2 = cyx[j]._atoms[atomNames[j].index('SG')] + pos2 = positions[sg2.index] + delta = [x-y for (x,y) in zip(pos1, pos2)] + distance = sqrt(delta[0]*delta[0] + delta[1]*delta[1] + delta[2]*delta[2]) +- if distance < 0.3*nanometers: +- self.addBond(sg1, sg2) ++ if distance < candidate_distance and not isDisulfideBonded(sg2): ++ candidate_distance = distance ++ candidate_atom = sg2 ++ # Assign bond to closest pair. ++ if candidate_atom: ++ self.addBond(sg1, candidate_atom) ++ ++ + + class Chain(object): + """A Chain object represents a chain within a Topology.""" From 76c6ea95c8967c641e121749c679bd85c25acd4a Mon Sep 17 00:00:00 2001 From: Miguel Dias Costa Date: Sun, 7 Aug 2022 06:59:46 +0800 Subject: [PATCH 5/6] manually remove renamed patch --- .../o/OpenMM/OpenMM-7.5.1_AlphaFold.patch | 45 ------------------- 1 file changed, 45 deletions(-) delete mode 100644 easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1_AlphaFold.patch diff --git a/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1_AlphaFold.patch b/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1_AlphaFold.patch deleted file mode 100644 index 878ffd11b03..00000000000 --- a/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1_AlphaFold.patch +++ /dev/null @@ -1,45 +0,0 @@ -custom patch for OpenMM to use in conjunction with AlphaFold -see https://github.com/deepmind/alphafold/blob/main/docker/openmm.patch - -Index: simtk/openmm/app/topology.py -=================================================================== ---- simtk.orig/openmm/app/topology.py -+++ simtk/openmm/app/topology.py -@@ -356,19 +356,35 @@ - def isCyx(res): - names = [atom.name for atom in res._atoms] - return 'SG' in names and 'HG' not in names -+ # This function is used to prevent multiple di-sulfide bonds from being -+ # assigned to a given atom. This is a DeepMind modification. -+ def isDisulfideBonded(atom): -+ for b in self._bonds: -+ if (atom in b and b[0].name == 'SG' and -+ b[1].name == 'SG'): -+ return True -+ -+ return False - - cyx = [res for res in self.residues() if res.name == 'CYS' and isCyx(res)] - atomNames = [[atom.name for atom in res._atoms] for res in cyx] - for i in range(len(cyx)): - sg1 = cyx[i]._atoms[atomNames[i].index('SG')] - pos1 = positions[sg1.index] -+ candidate_distance, candidate_atom = 0.3*nanometers, None - for j in range(i): - sg2 = cyx[j]._atoms[atomNames[j].index('SG')] - pos2 = positions[sg2.index] - delta = [x-y for (x,y) in zip(pos1, pos2)] - distance = sqrt(delta[0]*delta[0] + delta[1]*delta[1] + delta[2]*delta[2]) -- if distance < 0.3*nanometers: -- self.addBond(sg1, sg2) -+ if distance < candidate_distance and not isDisulfideBonded(sg2): -+ candidate_distance = distance -+ candidate_atom = sg2 -+ # Assign bond to closest pair. -+ if candidate_atom: -+ self.addBond(sg1, candidate_atom) -+ -+ - - class Chain(object): - """A Chain object represents a chain within a Topology.""" From dbf7314b53344454fd9502cb4256fdb769505da7 Mon Sep 17 00:00:00 2001 From: Miguel Dias Costa Date: Wed, 10 Aug 2022 06:53:14 +0800 Subject: [PATCH 6/6] remove unnecessary separate_build_dir --- .../o/OpenMM/OpenMM-7.5.1-foss-2021a-DeepMind-patch.eb | 2 -- 1 file changed, 2 deletions(-) diff --git a/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a-DeepMind-patch.eb b/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a-DeepMind-patch.eb index cd9f06a4f42..42a22798b5f 100644 --- a/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a-DeepMind-patch.eb +++ b/easybuild/easyconfigs/o/OpenMM/OpenMM-7.5.1-foss-2021a-DeepMind-patch.eb @@ -23,8 +23,6 @@ builddependencies = [ ('Doxygen', '1.9.1'), ] -separate_build_dir = True - dependencies = [ ('Python', '3.9.5'), ('SciPy-bundle', '2021.05'),