diff --git a/EM/tomodrgn/README.md b/EM/tomodrgn/README.md new file mode 100644 index 0000000..f4d5526 --- /dev/null +++ b/EM/tomodrgn/README.md @@ -0,0 +1,13 @@ + Installation remarks for Tomodrgn: + +1.) function in tomodrgn/analysis.py is not valid with matplotlib v3.8 anymore, this is why the function is substituted in the build script: +sed -i 's/cbar.draw_all/cbar._draw_all/' tomodrgn/analysis.py + +2.) the tomodrgn quicktest script can be exectued by : +python /opt/psi/EM/tomodrgn/0.2.2/tomodrgn/testing/quicktest.py +REMARK: This file was changed in order to provide the argument --datadir /opt/psi/EM/tomodrgn/0.2.2/tomodrgn/testing/, otherwise it will look for the "data" folder in the current working dir. + +3.) quicktest is run without the two arguments: --num-workers (dafault =0) and --prefetch-factor (default should be None, but is actually 2), which throws an error,was fixed by changing the default of --prefetch-factor to None in the file /opt/psi/EM/tomodrgn/0.2.2/miniconda/envs/tomodrgn_0.2.2/lib/python3.9/site-packages/tomodrgn/commands/train_vae.py + + + diff --git a/EM/tomodrgn/build b/EM/tomodrgn/build new file mode 100755 index 0000000..aec16fa --- /dev/null +++ b/EM/tomodrgn/build @@ -0,0 +1,34 @@ +#!/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 "tomodrgn_$V" -f "$BUILDBLOCK_DIR/environment.yaml" + source "$PREFIX/miniconda/etc/profile.d/conda.sh" + conda activate "tomodrgn_$V" + + #CP SOURCE CODE + mkdir "$PREFIX/tomodrgn" + cd "$PREFIX/tomodrgn" + cp -r "$SRC_DIR"/* . + #FIX MATPLOTLIB VERSION issue + sed -i 's/cbar.draw_all/cbar._draw_all/' tomodrgn/analysis.py + #INSTALL IN ENV + pip install . + +} + +#DO NOTHING +pbuild::compile(){ + : +} + +pbuild::install(){ + : +} diff --git a/EM/tomodrgn/environment.yaml b/EM/tomodrgn/environment.yaml new file mode 100644 index 0000000..1ed6b23 --- /dev/null +++ b/EM/tomodrgn/environment.yaml @@ -0,0 +1,18 @@ +channels: + - pytorch + - conda-forge + - defaults +dependencies: + - pytorch-gpu>=1.11.0 + - cudatoolkit>=11.0 + - pandas + - seaborn + - scikit-learn + - umap-learn + - ipython_genutils + - notebook + - pip + - pip: + - ipyvolume>=0.6.0 + - pythreejs>=2.4.2 + diff --git a/EM/tomodrgn/files/config.yaml b/EM/tomodrgn/files/config.yaml new file mode 100644 index 0000000..273ff2e --- /dev/null +++ b/EM/tomodrgn/files/config.yaml @@ -0,0 +1,11 @@ +format: 1 +tomodrgn: + deaults: + group: EM + overlay: base + relstage: unstable + urls: + - url: https://github.com/bpowell122/tomodrgn/archive/refs/tags/v${V_PKG}.tar.gz + name: tomodrgn-${V_PKG}.tar.gz + versions: + 0.2.2: diff --git a/EM/tomodrgn/modulefile b/EM/tomodrgn/modulefile new file mode 100644 index 0000000..4871b84 --- /dev/null +++ b/EM/tomodrgn/modulefile @@ -0,0 +1,34 @@ +#%Module1.0 + +module-whatis "TomoDRGN - analyzing structural heterogeneity in cryo-electron sub-tomograms" +module-url "https://github.com/bpowell122/tomodrgn" +module-license "-" +module-maintainer "Greta Assmann " + +module-help "https://github.com/bpowell122/tomodrgn" + + +# Check for supported shell types +set shelltype [module-info shelltype] +switch -- $shelltype { + "sh" { + 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" + } +} + +