本家様 https://github.com/kiharalab/Emap2secPlus
condaで環境を作ります.
このサイトではcrYOLOとかで既にanaconda環境が準備されいます. なので下記のみを実行してanaconda環境に移る.
export PYENV_ROOT=/apps/pyenv
export PATH=$PYENV_ROOT/bin:$PATH
export PATH=$PYENV_ROOT/versions/anaconda3-2023.03/bin/:$PATH
(condaが古いと言われたら)
conda update -n base -c defaults conda
その後に Emap2secPlus を準備して、そこにある「requirement.txt」でconda環境、Emap2secPlus実行環境を作ります
[root@rockylinux ~]# cd /apps
[root@rockylinux apps]# git clone https://github.com/kiharalab/Emap2secPlus
[root@rockylinux apps]# cd Emap2secPlus
[root@rockylinux Emap2secPlus]# ls -CF
Emap2sec+.ipynb* figures/ main.py* ops/ process_map/ requirements.txt*
evaluate/ LICENSE* Model/ prepare_data/ README.md*
[root@rockylinux Emap2secPlus]#
[root@rockylinux Emap2secPlus]# conda create -n Emap2secPlus python=3.6.9
[root@rockylinux Emap2secPlus]# source activate Emap2secPlus
(Emap2secPlus) [root@rockylinux Emap2secPlus]# which pip
/apps/pyenv/versions/anaconda3-2023.03/envs/Emap/bin/pip
(Emap2secPlus) [root@rockylinux Emap2secPlus]#
(Emap2secPlus) [root@rockylinux Emap2secPlus]# pip install -r ./requirements.txt
(Emap2secPlus) [root@rockylinux Emap2secPlus]# conda deactivate
[root@rockylinux Emap2secPlus]#
「/apps/modulefiles/Emap2secPlus」
#%Module1.0
set root /apps/pyenv/versions/anaconda3-2023.03/envs/Emap2secPlus
setenv CRYOLOPATH $root
prepend-path PATH $root/bin:/apps/Emap2secPlus
[saber@rockylinux ~]$ module use /apps/modulefiles/
[saber@rockylinux ~]$ module load Emap2secPlus
[saber@rockylinux ~]$ which python3
/apps/pyenv/versions/anaconda3-2023.03/envs/Emap2secPlus/bin/python3
[saber@rockylinux ~]$ python3 /apps/Emap2secPlus/main.py -h
usage: main.py [-h] -F F --mode MODE [-P P] [-M M] [--type TYPE] [--gpu GPU]
[--class CLASS] [--batch_size BATCH_SIZE] [--contour CONTOUR]
[--cardinality CARDINALITY] [--drop_rate DROP_RATE]
[--fold FOLD] [--output_folder OUTPUT_FOLDER]
[--no_compilation]
optional arguments:
-h, --help show this help message and exit
-F F map path
--mode MODE 0: Predict structures for EM MAP 1: Predict structures
for EM maps with pdb structure 2: Predict structure
for experimental maps with 4 models 3: Predict and
evaluate structure for experimental maps with 4 models
-P P PDB path for evaluating Model's performance
-M M Trained model path which saved all the trained models
--type TYPE 0:simulated map at 6 A 1: simulated map at 10 A 2:
simulated map at 6-10 A 3:experimental map
--gpu GPU gpu id choose for training
--class CLASS number of classes
--batch_size BATCH_SIZE
batch size for training
--contour CONTOUR Contour level for real map
--cardinality CARDINALITY
ResNeXt cardinality
--drop_rate DROP_RATE
Drop out rate for the phase2 Model
--fold FOLD specify the fold Model used for predicting the real
map
--output_folder OUTPUT_FOLDER
specify a custom folder where results will be stored
--no_compilation skip automatic compilation before execution
[saber@rockylinux ~]$
いちいち「python3 /apps/Emap2secPlus/main.py」と実行するのが面倒なら
[root@c ~]# sed -i '1s/^/#!\/usr\/bin\/env python3\n/' /apps/Emap2secPlus/main.py
[root@c ~]# chmod +x /apps/Emap2secPlus/main.py
で「main.py」のみで実行できる. けど....名前が「main.py」って微妙..他でも使われそうな名称で..
[root@rockylinux Emap2secPlus]# curl -O https://kiharalab.org/emsuites/emap2secplus_model/best_model.tar.gz
[root@rockylinux Emap2secPlus]# tar xf best_model.tar.gz
[root@rockylinux Emap2secPlus]# curl -O https://kiharalab.org/emsuites/emap2secplus_model/nocontour_best_model.tar.gz
[root@rockylinux Emap2secPlus]# tar xf nocontour_best_model.tar.gz
[saber@rockylinux ~]$ module use /apps/modulefiles/
[saber@rockylinux ~]$ module load Emap2secPlus
[saber@rockylinux ~]$ mkdir Emap2secPlus
[saber@rockylinux ~]$ cd Emap2secPlus
[saber@rockylinux Emap2secPlus]$
[saber@rockylinux Emap2secPlus]$ curl -O https://kiharalab.org/github_data/emap2secplus_data/SIMU10/5T5K.mrc
[saber@rockylinux Emap2secPlus]$ ls -lh
total 4.6M
-rw-rw-r--. 1 saber saber 4.6M May 13 16:56 5T5K.mrc
[saber@rockylinux Emap2secPlus]$ cp -r /apps/Emap2secPlus/process_map .
[saber@rockylinux Emap2secPlus]$ cp -r /apps/Emap2secPlus/best_model .
[saber@rockylinux Emap2secPlus]$ python3 /apps/Emap2secPlus/main.py --mode=0 -F=5T5K.mrc --type=1 --gpu=0 --class=4