Skip to content

Commit

Permalink
Merge pull request #17206 from smoors/20230125173522_new_pr_OpenFold101
Browse files Browse the repository at this point in the history
enhance OpenFold 1.0.1 for standalone usage
  • Loading branch information
boegel authored Jan 28, 2023
2 parents a59f4e3 + 6b55fa0 commit d568144
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ 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', '-DeepMind-patch'),
('OpenMM', '7.5.1', '-CUDA-%(cudaver)s-DeepMind-patch'),
]

use_pip = True

# flash_attn (FlashAttention) is optional, speeds up MSA attention for sequences with < 1000 residues
exts_list = [
('flash_attn', '0.2.8', {
'checksums': ['b54fee86463cdb9933e8d47e500c52f3eaf283f1c8a9d96099e62acc7dc0be1f'],
}),
('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'}],
Expand Down Expand Up @@ -80,13 +84,36 @@ exts_list = [
}),
]

# _resources_dir = '%(installdir)s/lib/python%(pyshortver)s/site-packages/openfold/resources/'
# _resources_target_dir = '/databases/bio/%(namelower)s-%(version)s'

postinstallcmds = [
'cp -a run_pretrained_openfold.py thread_sequence.py train_openfold.py %(installdir)s/bin',
'cp -a scripts %(installdir)s/bin',
'chmod -R a+x %(installdir)s/bin',
# manually download stereo_chemical_props.txt, openfold parameters and alphafold parameters
# see scripts download_alphafold_params.sh, download_openfold_params.sh ,install_third_party_dependencies.sh
# download to _resources_target_dir and add symlinks in _resources_dir
# or download directly into _resources_dir
# 'ln -s %s/stereo_chemical_props.txt %s' % (_resources_target_dir, _resources_dir),
# 'ln -s %s/openfold_params %s' % (_resources_target_dir, _resources_dir),
# 'ln -s %s/params %s' % (_resources_target_dir, _resources_dir),
]

fix_python_shebang_for = ['bin/*.py', '/bin/scripts/*.py']

modextrapaths = {
'PATH': 'bin/scripts',
}

sanity_check_paths = {
'files': ['bin/pdbfixer'],
'dirs': ['lib/python%(pyshortver)s/site-packages'],
'files': ['bin/pdbfixer', 'bin/run_pretrained_openfold.py'],
'dirs': ['lib/python%(pyshortver)s/site-packages', 'bin/scripts'],
}

sanity_check_commands = [
"pdbfixer --help",
"run_pretrained_openfold.py --help",
]

sanity_pip_check = True
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
easyblock = 'CMakeMake'

name = 'OpenMM'
version = '7.5.1'
versionsuffix = '-CUDA-%(cudaver)s-DeepMind-patch'

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_DeepMind.patch', 'wrappers/python'),
'%(name)s-7.5.0_fix_path_to_nvcc.patch',
]
checksums = [
{'7.5.1.tar.gz': 'c88d6946468a2bde2619acb834f57b859b5e114a93093cf562165612e10f4ff7'},
{'OpenMM-7.5.1_DeepMind.patch': '1b109dfff3af5c6aa70690bca14618612953c68840a7e64f679db7ca33c1aff6'},
{'OpenMM-7.5.0_fix_path_to_nvcc.patch': '050d5b81e70b34d06ef87eafc6d540b2cf716a61f53b1d2a3786504da3ec2e3c'},
]

builddependencies = [
('CMake', '3.20.1'),
('Doxygen', '1.9.1'),
]

dependencies = [
('Python', '3.9.5'),
('SciPy-bundle', '2021.05'),
('CUDA', '11.3.1', '', SYSTEM),
('SWIG', '4.0.2'),
]

# Flags for CUDA-enabled build
configopts = "-DOPENMM_BUILD_CUDA_LIB=ON"

# defining OPENMM_CUDA_COMPILER=nvcc on pretestops causes 1 test to fail: https://github.com/openmm/openmm/issues/3373
pretestopts = " CTEST_OUTPUT_ON_FAILURE=1"
local_ignore_pattern = "(Integrator)|(Thermostat)|(Barostat)|(Rpmd)|(Amoeba)"
runtest = """test -e ARGS="-E \'%s\'" """ % local_ignore_pattern

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'

0 comments on commit d568144

Please sign in to comment.