本家様 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]#

EnvironmentModules

「/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

テストrun

[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
最新の60件
2024-09-16 2024-09-14 2024-09-12 2024-09-09 2024-09-08 2024-09-06 2024-09-05 2024-09-04 2024-09-02 2024-09-01 2024-08-31 2024-08-28 2024-08-21 2024-08-18 2024-08-17 2024-08-16 2024-08-15 2024-08-14 2024-08-11 2024-08-09 2024-08-01 2024-07-27 2024-07-26 2024-07-16 2024-07-15 2024-07-12 2024-07-07 2024-06-22 2024-06-21 2024-06-17 2024-06-14 2024-06-11 2024-06-10 2024-06-08 2024-06-07 2024-06-02 2024-06-01 2024-05-30 2024-05-16 2024-04-26 2024-04-15 2024-04-11

edit


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2023-05-13 (土) 17:26:34