diff --git a/easybuild/easyconfigs/c/Cython/Cython-3.0.5-GCCcore-11.3.0.eb b/easybuild/easyconfigs/c/Cython/Cython-3.0.5-GCCcore-11.3.0.eb new file mode 100644 index 000000000000..7e7fe1effff5 --- /dev/null +++ b/easybuild/easyconfigs/c/Cython/Cython-3.0.5-GCCcore-11.3.0.eb @@ -0,0 +1,38 @@ +easyblock = 'PythonPackage' + +name = 'Cython' +version = '3.0.5' + +homepage = 'https://cython.org/' +description = """ +Cython is an optimising static compiler for both the Python programming +language and the extended Cython programming language (based on Pyrex). +""" +docurls = [ + 'https://cython.org/#documentation', + 'https://github.com/cython/cython', +] + +toolchain = {'name': 'GCCcore', 'version': '11.3.0'} + +builddependencies = [('binutils', '2.38')] + +dependencies = [('Python', '3.10.4')] + +download_dep_fail = True +use_pip = True +sanity_pip_check = True + +sources = [SOURCE_TAR_GZ] +checksums = ['39318348db488a2f24e7c84e08bdc82f2624853c0fea8b475ea0b70b27176492'] + +sanity_check_paths = { + 'files': ['bin/cygdb', 'bin/cython', 'bin/cythonize'], + 'dirs': ['lib/python%(pyshortver)s/site-packages'], +} + +sanity_check_commands = [ + 'cython --version', +] + +moduleclass = 'lang' diff --git a/easybuild/easyconfigs/m/Model-Angelo/Model-Angelo-1.0.11-foss-2022a-CUDA-11.7.0.eb b/easybuild/easyconfigs/m/Model-Angelo/Model-Angelo-1.0.11-foss-2022a-CUDA-11.7.0.eb new file mode 100644 index 000000000000..f48da5d4986c --- /dev/null +++ b/easybuild/easyconfigs/m/Model-Angelo/Model-Angelo-1.0.11-foss-2022a-CUDA-11.7.0.eb @@ -0,0 +1,80 @@ +# Thomas Hoffmann, EMBL Heidelberg, structures-it@embl.de, 2023/11 +easyblock = 'PythonBundle' + +name = 'Model-Angelo' +versionsuffix = '-CUDA-%(cudaver)s' +version = '1.0.11' + +homepage = 'https://github.com/3dem/model-angelo' +description = """ModelAngelo is an automatic atomic model building program for cryo-EM maps""" + +toolchain = {'name': 'foss', 'version': '2022a'} + +builddependencies = [ + ('pkg-config', '0.29.2'), + ('cppy', '1.2.1'), + +] + +dependencies = [ + ('CUDA', '11.7.0', '', SYSTEM), + ('Python', '3.10.4'), + ('SciPy-bundle', '2022.05'), + ('tqdm', '4.64.0'), + ('Biopython', '1.79'), + ('einops', '0.4.1'), + ('mrcfile', '1.4.3'), + ('matplotlib', '3.5.2'), + ('PyTorch', '1.12.0', versionsuffix), + ('PyHMMER', '0.10.4'), + ('Model-Angelo_data', '1.0.9', '', SYSTEM) +] + +use_pip = True + +github_account = '3dem' + +exts_list = [ + ('loguru', '0.7.2', { + 'checksums': ['e671a53522515f34fd406340ee968cb9ecafbc4b36c679da03c18fd8d0bd51ac'], + }), + ('fair-esm', '2.0.0', { + 'modulename': 'esm', + 'checksums': ['4ed34d4598ec75ed6550a4e581d023bf8d4a8375317ecba6269bb68135f80c85'], + }), + (name, version, { + 'modulename': 'model_angelo', + 'patches': [ + 'Model-Angelo-1.0.9_relax_requirements.patch', + 'Model-Angelo-1.0.9_add_init_py.patch', + 'Model-Angelo-1.0.9_multi_torch_home.patch', + ], + 'source_urls': ['https://github.com/%(github_account)s/%(name)s/archive'], + 'sources': ['v%(version)s.tar.gz'], + 'checksums': [ + {'v1.0.11.tar.gz': '46daba54fb42e75bfb9d845dcf9cc43a6a9bc0d5825d325f46612b772679f57a'}, + {'Model-Angelo-1.0.9_relax_requirements.patch': + '570217999537eb55f5e55bb842a60f58d00850eaace40e5726e2ac058d003986'}, + {'Model-Angelo-1.0.9_add_init_py.patch': + '7d3144ddac92d5800d9a6993bf50a3850627bc836ad01917be531fdd690b72d3'}, + {'Model-Angelo-1.0.9_multi_torch_home.patch': + '950d32ca50f14d04cb7f9cc0c384c1a55979cf88ae7ce5b855bef90a935ce13d'}, + ], + }), +] + +sanity_pip_check = True + +sanity_check_commands = [ + "model_angelo --help", +] + +sanity_check_paths = { + 'files': [ + 'lib/python%(pyshortver)s/site-packages/model_angelo/utils/stereo_chemical_props.txt' + ], + + 'dirs': ['lib/python%(pyshortver)s/site-packages/model_angelo'] +} + +moduleclass = 'bio' diff --git a/easybuild/easyconfigs/m/Model-Angelo/Model-Angelo-1.0.9_add_init_py.patch b/easybuild/easyconfigs/m/Model-Angelo/Model-Angelo-1.0.9_add_init_py.patch new file mode 100644 index 000000000000..8a20539ecad1 --- /dev/null +++ b/easybuild/easyconfigs/m/Model-Angelo/Model-Angelo-1.0.9_add_init_py.patch @@ -0,0 +1,33 @@ +# Thomas Hoffmann, EMBL Heidelberg, structures-it@embl.de, 2023/11 +# add missing __init__.py files in apps, c_alpha, data, gnn, models, and utils +# in order to allow setup.py.find_packages() to find and install subdirectories +diff -ruN model-angelo-1.0.9/model_angelo/apps/__init__.py model-angelo-1.0.9_add_init_py/model_angelo/apps/__init__.py +--- model-angelo-1.0.9/model_angelo/apps/__init__.py 2023-10-27 16:42:58.000000000 +0200 ++++ model-angelo-1.0.9_add_init_py/model_angelo/apps/__init__.py 2023-11-06 11:06:16.212950502 +0100 +@@ -0,0 +1 @@ ++# +diff -ruN model-angelo-1.0.9/model_angelo/c_alpha/__init__.py model-angelo-1.0.9_add_init_py/model_angelo/c_alpha/__init__.py +--- model-angelo-1.0.9/model_angelo/c_alpha/__init__.py 1970-01-01 01:00:00.000000000 +0100 ++++ model-angelo-1.0.9_add_init_py/model_angelo/c_alpha/__init__.py 2023-11-06 11:06:16.212950502 +0100 +@@ -0,0 +1 @@ ++# +diff -ruN model-angelo-1.0.9/model_angelo/data/__init__.py model-angelo-1.0.9_add_init_py/model_angelo/data/__init__.py +--- model-angelo-1.0.9/model_angelo/data/__init__.py 1970-01-01 01:00:00.000000000 +0100 ++++ model-angelo-1.0.9_add_init_py/model_angelo/data/__init__.py 2023-11-06 11:06:16.212950502 +0100 +@@ -0,0 +1 @@ ++# +diff -ruN model-angelo-1.0.9/model_angelo/gnn/__init__.py model-angelo-1.0.9_add_init_py/model_angelo/gnn/__init__.py +--- model-angelo-1.0.9/model_angelo/gnn/__init__.py 1970-01-01 01:00:00.000000000 +0100 ++++ model-angelo-1.0.9_add_init_py/model_angelo/gnn/__init__.py 2023-11-06 11:06:16.212950502 +0100 +@@ -0,0 +1 @@ ++# +diff -ruN model-angelo-1.0.9/model_angelo/models/__init__.py model-angelo-1.0.9_add_init_py/model_angelo/models/__init__.py +--- model-angelo-1.0.9/model_angelo/models/__init__.py 1970-01-01 01:00:00.000000000 +0100 ++++ model-angelo-1.0.9_add_init_py/model_angelo/models/__init__.py 2023-11-06 11:06:16.212950502 +0100 +@@ -0,0 +1 @@ ++# +diff -ruN model-angelo-1.0.9/model_angelo/utils/__init__.py model-angelo-1.0.9_add_init_py/model_angelo/utils/__init__.py +--- model-angelo-1.0.9/model_angelo/utils/__init__.py 1970-01-01 01:00:00.000000000 +0100 ++++ model-angelo-1.0.9_add_init_py/model_angelo/utils/__init__.py 2023-11-06 11:10:29.338107389 +0100 +@@ -0,0 +1 @@ ++# diff --git a/easybuild/easyconfigs/m/Model-Angelo/Model-Angelo-1.0.9_multi_torch_home.patch b/easybuild/easyconfigs/m/Model-Angelo/Model-Angelo-1.0.9_multi_torch_home.patch new file mode 100644 index 000000000000..06c72deb78b5 --- /dev/null +++ b/easybuild/easyconfigs/m/Model-Angelo/Model-Angelo-1.0.9_multi_torch_home.patch @@ -0,0 +1,68 @@ +# Thomas Hoffmann, EMBL Heidelberg, structures-it@embl.de, 2023/11 +# allow to use TORCH_HOME with modextravars. +# Automatic download of models and language is disabled for multi TORCH_HOME. +diff -ru model-angelo-1.0.9/model_angelo/utils/misc_utils.py model-angelo-1.0.9_multi_torch_home/model_angelo/utils/misc_utils.py +--- model-angelo-1.0.9/model_angelo/utils/misc_utils.py 2023-10-27 16:42:58.000000000 +0200 ++++ model-angelo-1.0.9_multi_torch_home/model_angelo/utils/misc_utils.py 2023-11-17 18:58:36.581076278 +0100 +@@ -116,10 +116,17 @@ + warnings.filterwarnings("ignore", ".*with given element none.*") + warnings.filterwarnings("ignore", ".*invalid value encountered in true\_divide.*") + +- + def get_esm_model(esm_model_name): + import esm + import torch ++ is_torch_home_multi=False if os.getenv('TORCH_HOME')==None else len(os.getenv('TORCH_HOME').split(':'))>1 ++ if is_torch_home_multi: ++ for tmp_torch_home in os.getenv('TORCH_HOME').split(':'): ++ tmp_dst = os.path.join(tmp_torch_home, 'hub', 'checkpoints', esm_model_name + ".pt") ++ if os.path.isfile(tmp_dst): ++ model = esm.pretrained.load_model_and_alphabet_local(tmp_dst) ++ return model ++ assert False , "None of the paths defined in $TORCH_HOME contains %s" % esm_model_name + try: + model = esm.pretrained.load_model_and_alphabet_hub(esm_model_name) + except: +diff -ru model-angelo-1.0.9/model_angelo/utils/torch_utils.py model-angelo-1.0.9_multi_torch_home/model_angelo/utils/torch_utils.py +--- model-angelo-1.0.9/model_angelo/utils/torch_utils.py 2023-10-27 16:42:58.000000000 +0200 ++++ model-angelo-1.0.9_multi_torch_home/model_angelo/utils/torch_utils.py 2023-11-14 18:35:39.669951044 +0100 +@@ -446,7 +446,17 @@ + dest = os.path.join( + torch.hub.get_dir(), "checkpoints", "model_angelo_v1.0", bundle_name + ) +- if os.path.isfile(os.path.join(dest, "success.txt")): ++ is_torch_home_multi=False if os.getenv('TORCH_HOME')==None else len(os.getenv('TORCH_HOME').split(':'))>1 ++ if (is_torch_home_multi): ++ torch_homes=os.getenv('TORCH_HOME').split(':') ++ for torch_home in torch_homes: ++ dest = os.path.join( ++ torch_home, "hub", "checkpoints", "model_angelo_v1.0", bundle_name ++ ) ++ if os.path.isfile(os.path.join(dest, "success.txt")): ++ return dest ++ assert False, "Model ownload disabled, because multiple paths defined in $TORCH_HOME. %s" % dest ++ elif os.path.isfile(os.path.join(dest, "success.txt")): + return dest + + print(f"Setting up bundle with name: {bundle_name} for the first time.") +@@ -503,6 +513,20 @@ + + + def download_and_install_esm_model(esm_model_name: str) -> str: ++ is_torch_home_multi=False if os.getenv('TORCH_HOME')==None else len(os.getenv('TORCH_HOME').split(':'))>1 ++ if is_torch_home_multi: ++ torch_homes = os.getenv('TORCH_HOME').split(':') ++ for torch_home in torch_homes: ++ dest_model = os.path.join( ++ torch_home, "checkpoints", esm_model_name + ".pt" ++ ) ++ dest_regr = os.path.join( ++ torch_home, "checkpoints", esm_model_name + "-contact-regression.pt" ++ ) ++ if os.path.isfile(dest_model) and os.path.isfile(dest_regr): ++ return dest_model ++ assert is_torch_home_multi==False, 'Language model download disabled, because multiple paths are set in $TORCH_HOME' ++ + permissions = ( + stat.S_IROTH + | stat.S_IXOTH diff --git a/easybuild/easyconfigs/m/Model-Angelo/Model-Angelo-1.0.9_relax_requirements.patch b/easybuild/easyconfigs/m/Model-Angelo/Model-Angelo-1.0.9_relax_requirements.patch new file mode 100644 index 000000000000..40940eba94e9 --- /dev/null +++ b/easybuild/easyconfigs/m/Model-Angelo/Model-Angelo-1.0.9_relax_requirements.patch @@ -0,0 +1,14 @@ +# Thomas Hoffmann, EMBL Heidelberg, structures-it@embl.de, 2023/11 +# allow to use Biopython/1.79-foss-2022a +diff -ru model-angelo-1.0.9/setup.py model-angelo-1.0.9_relax_requirements/setup.py +--- model-angelo-1.0.9/setup.py 2023-10-27 16:42:58.000000000 +0200 ++++ model-angelo-1.0.9_relax_requirements/setup.py 2023-11-06 10:12:57.641982769 +0100 +@@ -28,7 +28,7 @@ + install_requires=[ + "tqdm", + "scipy", +- "biopython>=1.81", ++ "biopython>=1.79", + "einops", + "matplotlib", + "mrcfile", diff --git a/easybuild/easyconfigs/m/Model-Angelo_data/Model-Angelo_data-1.0.9.eb b/easybuild/easyconfigs/m/Model-Angelo_data/Model-Angelo_data-1.0.9.eb new file mode 100644 index 000000000000..1ce935a7a2f3 --- /dev/null +++ b/easybuild/easyconfigs/m/Model-Angelo_data/Model-Angelo_data-1.0.9.eb @@ -0,0 +1,108 @@ +# Thomas Hoffmann, EMBL Heidelberg, structures-it@embl.de, 2023/11 +easyblock = 'Binary' + +name = 'Model-Angelo_data' +version = '1.0.9' + +homepage = 'https://zenodo.org/search?q=7733060' +description = """A Graph Neural Network Approach to Automated Model Building in Cryo-EM Maps. +Automated model building and protein identification in cryo-EM maps.""" + +toolchain = SYSTEM + +_prepare = '' +# Uncomment and adapt to store data (10GB) elsewhere: +# _common_data = '/easybuild/data' +# _prepare = 'mkdir -p %s/%%(name)s/%%(version)s/torch_home &&' % _common_data +# _prepare += 'ln -s %s/%%(name)s/%%(version)s/torch_home %%(installdir)s/torch_home &&' % _common_data + +buildininstalldir = True + +_models = [ + 'original', + 'original_no_seq', + 'small_gpu', + 'nucleotides', + 'nucleotides_no_seq' +] + +_torch_home = 'torch_home/' +_checkpoints_rel = '%s/hub/checkpoints' % _torch_home +_checkpoints = '%%(installdir)s/%s' % _checkpoints_rel + + +source_urls = [ + 'https://dl.fbaipublicfiles.com/fair-esm/models', + 'https://dl.fbaipublicfiles.com/fair-esm/regression', + 'https://zenodo.org/records/7733060/files/', + 'https://zenodo.org/records/7942241/files/', +] +sources = [ + { + 'filename': 'esm1b_t33_650M_UR50S.pt', + 'extract_cmd': + _prepare + + 'mkdir -p %s/model_angelo && ' % _checkpoints + + 'cp -n %%s %s ' % _checkpoints, + }, + { + 'filename': 'esm1b_t33_650M_UR50S-contact-regression.pt', + 'extract_cmd': 'cp -n %%s %s ' % _checkpoints, + }, + { + 'filename': 'original-7733060.zip', + 'download_filename': 'original.zip', + 'extract_cmd': 'unzip -n %%s -d %s/model_angelo_v1.0/ ' % _checkpoints + }, + { + 'filename': 'original_no_seq-7733060.zip', + 'download_filename': 'original_no_seq.zip', + 'extract_cmd': 'unzip -n %%s -d %s/model_angelo_v1.0/ ' % _checkpoints + }, + { + 'filename': 'small_gpu-7733060.zip', + 'download_filename': 'small_gpu.zip', + 'extract_cmd': 'unzip -n %%s -d %s/model_angelo_v1.0/ ' % _checkpoints + }, + { + 'filename': 'nucleotides-7942241.zip', + 'download_filename': 'nucleotides.zip', + 'extract_cmd': 'unzip -n %%s -d %s/model_angelo_v1.0/ ' % _checkpoints + }, + { + 'filename': 'nucleotides_no_seq-7942241.zip', + 'download_filename': 'nucleotides_no_seq.zip', + 'extract_cmd': 'unzip -n %%s -d %s/model_angelo_v1.0/ ' % _checkpoints + }, +] +checksums = [ + {'esm1b_t33_650M_UR50S.pt': '0569754efaff7dcb7e068c27367bc73f10afb4b450ea30aac30d9bc60783a8b1'}, + {'esm1b_t33_650M_UR50S-contact-regression.pt': '77193a8814f0db0b36a03aebb1a311adc6b4745f463c04839defc15407bbb28a'}, + {'original-7733060.zip': '55bda1751045030f6ed70af55670819f9ada78055b042b9370080df881b6a5bd'}, + {'original_no_seq-7733060.zip': '2e66c7748a446b7c7845e7ff60a2b4e515853ba2093062407cff00ce38550a42'}, + {'small_gpu-7733060.zip': '1c6d69cb568e81661aad2b10bc1197e22fa3ea91271480c0befe89ffaf314948'}, + {'nucleotides-7942241.zip': 'f1b1d22f563977ac54c7366038c48a8ad37ca2f8870879221149d454cb051041'}, + {'nucleotides_no_seq-7942241.zip': '3b75de921440dd6891a6c5ea129fafe86e72fd043393f821157e3eda93d685f8'}, +] + +skipsteps = ['configure', 'build', 'test'] +extract_sources = True + +_success = [ + 'echo Sucessfully downloaded model>%s/model_angelo_v1.0/%s/success.txt' + % (_checkpoints, x) for x in _models +] + +install_cmd = '%s ' % '&&'.join(_success) + +modextrapaths = {'TORCH_HOME': _torch_home} + +sanity_check_paths = { + 'files': [ + '%s/esm1b_t33_650M_UR50S.pt' % _checkpoints, + '%s/esm1b_t33_650M_UR50S-contact-regression.pt' % _checkpoints_rel, + ], + 'dirs': ['%s/model_angelo_v1.0/%s' % (_checkpoints, m) for m in _models] +} + +moduleclass = 'data' diff --git a/easybuild/easyconfigs/p/PyHMMER/PyHMMER-0.10.4-gompi-2022a.eb b/easybuild/easyconfigs/p/PyHMMER/PyHMMER-0.10.4-gompi-2022a.eb new file mode 100644 index 000000000000..be6fcd40c64f --- /dev/null +++ b/easybuild/easyconfigs/p/PyHMMER/PyHMMER-0.10.4-gompi-2022a.eb @@ -0,0 +1,45 @@ +# Thomas Hoffmann, EMBL Heidelberg, structures-it@embl.de, 2023/11 +easyblock = 'PythonBundle' + +name = 'PyHMMER' +version = '0.10.4' + +homepage = 'https://github.com/althonos/pyhmmer' +description = """ +HMMER is a biological sequence analysis tool that uses profile hidden Markov +models to search for sequence homologs. HMMER3 is developed and maintained by +the Eddy/Rivas Laboratory at Harvard University. + +pyhmmer is a Python package, implemented using the Cython language, that +provides bindings to HMMER3. It directly interacts with the HMMER internals, +which has the following advantages over CLI wrappers (like hmmer-py)""" + +toolchain = {'name': 'gompi', 'version': '2022a'} +toolchainopts = {} # toolchain options, e.g. opt, pic, usempi, optarch, ... + + +builddependencies = [ + # Cython 0.29.28 does not work + ('Cython', '3.0.5'), +] +dependencies = [ + ('Python', '3.10.4'), + ('HMMER', '3.3.2'), +] + +use_pip = True + +exts_list = [ + ('pyhmmer', version, { + 'checksums': ['08bc02aadf0f113df2b2912478bb02be9daf5d322df9c72bcd07fa01fe53a87b'], + }), +] + +sanity_check_paths = { + 'files': [], + 'dirs': ['lib/python%(pyshortver)s/site-packages/%(namelower)s'], +} + +sanity_pip_check = True + +moduleclass = 'bio'