From 51547afd7618b1cdf746c38d3fb08fe31d43deca Mon Sep 17 00:00:00 2001 From: Greta Assmann Date: Mon, 16 Dec 2024 15:20:00 +0100 Subject: [PATCH] add topaz merlin7 --- EM/topaz/README.md | 34 ++++++++++++++++++++++++++++++++++ EM/topaz/build | 27 +++++++++++++++++++++++++++ EM/topaz/environment.yaml | 8 ++++++++ EM/topaz/files/config.yaml | 13 +++++++++++++ EM/topaz/modulefile | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 116 insertions(+) create mode 100644 EM/topaz/README.md create mode 100755 EM/topaz/build create mode 100644 EM/topaz/environment.yaml create mode 100644 EM/topaz/files/config.yaml create mode 100644 EM/topaz/modulefile diff --git a/EM/topaz/README.md b/EM/topaz/README.md new file mode 100644 index 0000000..7b5063d --- /dev/null +++ b/EM/topaz/README.md @@ -0,0 +1,34 @@ +# TOPAZ + +The topaz module is build for using it with the cryosparc software. An executable path to the topaz binary needs to be provided in cryosparc. + +## Adding New Versions + +Adding new versions: change the environment file in the build folder accordingly (and the config.yaml file) and run the build script. +IMPORTANT: Build it on the GPU node , otherwise the pytorch installation will not enable GPU support. + +## HINTS + +Current successful environment.yaml file: + +channels: + - tbepler + - pytorch +dependencies: + - python=3.6 + - cudatoolkit + - topaz + - pytorch + +- specifing cudatoolkit version of 11.8 failed for GPU support (see below) +- specifing higher python/cudatoolkit versions lead to higher pytorch versions, which again failed for topaz to run successful (https://discuss.cryosparc.com/t/topaz-train-typeerror-concat-takes-1-positional-argument-but-2-were-given/11240/18) + +## Versions + +Nov. 2024: 0.2.5 (TOPAZ) with +``` +python3.6 +cudatoolkit 11.3.1 h2bc3f7f_2 +pytorch 1.10.2 py3.6_cuda11.3_cudnn8.2.0_0 +pytorch-mutex 1.0 cuda +``` diff --git a/EM/topaz/build b/EM/topaz/build new file mode 100755 index 0000000..789c7bd --- /dev/null +++ b/EM/topaz/build @@ -0,0 +1,27 @@ +#!/usr/bin/env modbuild + + +pbuild::configure() { + #MINICONDA INSTALL + mkdir -p "$PREFIX/miniconda" + wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O "$PREFIX/miniconda/miniconda.sh" + bash "$PREFIX/miniconda/miniconda.sh" -b -u -p "$PREFIX/miniconda/" + + + #CREATE ENV , make sure to source the "correct" conda.sh + "$PREFIX/miniconda/condabin/conda" env create --name "${P}_${V}" -f "$BUILDBLOCK_DIR/environment.yaml" + +} + +#DO NOTHING +pbuild::compile(){ + : +} + +pbuild::install(){ + : +} + + + + diff --git a/EM/topaz/environment.yaml b/EM/topaz/environment.yaml new file mode 100644 index 0000000..8f19db7 --- /dev/null +++ b/EM/topaz/environment.yaml @@ -0,0 +1,8 @@ +channels: + - tbepler + - pytorch +dependencies: + - python=3.6 + - cudatoolkit + - topaz + - pytorch diff --git a/EM/topaz/files/config.yaml b/EM/topaz/files/config.yaml new file mode 100644 index 0000000..6841a46 --- /dev/null +++ b/EM/topaz/files/config.yaml @@ -0,0 +1,13 @@ +--- +format: 1 +topaz: + defaults: + group: EM + overlay: base + relstage: unstable + versions: + 0.2.5: + variants: + - overlay: Alps + systems: [.*.merlin7.psi.ch] + relstage: unstable diff --git a/EM/topaz/modulefile b/EM/topaz/modulefile new file mode 100644 index 0000000..4527b50 --- /dev/null +++ b/EM/topaz/modulefile @@ -0,0 +1,34 @@ +#%Module + +module-whatis "A pipeline for particle detection in cryo-electron microscopy images using convolutional neural networks trained from positive and unlabeled examples. Topaz also includes methods for micrograph and tomogram denoising using deep denoising models." +module-url "https://github.com/tbepler/topaz" +module-license "https://github.com/tbepler/topaz/blob/master/LICENSE" +module-maintainer "Greta Assmann " + +module-help "Particle Picker for CryoEM. Used with Cryosparc" + +# Check for supported shell types +set shelltype [module-info shelltype] +switch -- $shelltype { + "sh" { + puts stdout "conda(){ :; };" + puts stdout "set +u" + puts stdout "source \"${PREFIX}\"/miniconda/etc/profile.d/conda.sh;\n" + } + default { + puts stderr "Shells of type '$shelltype' are NOT supported!" + } +} + + +switch [module-info mode] { + "load" { + # Relies on the anaconda module being loaded since we need to update the path + puts stdout "conda activate ${P}_${V};\n" + } + "unload" - + "remove" { + puts stdout "conda deactivate;\n" + } +} +