本家様 https://github.com/rsanchezgarc/deepEMhancer

gitには

DeepEMhancer is a python package designed to perform post-processing of cryo-EM maps as described in 
"DeepEMhancer: a deep learning solution for cryo-EM volume post-processing", by Sanchez-Garcia et al, 2020.
Simply speaking, DeepEMhancer performs a non-linear post-processing of cryo-EM maps that produces two main effects:
 
 1. Local sharpening-like post-processing.
 2. Automatic masking/denoising of cryo-EM maps.

とある.
ドキュメントには、DeepEMhancerはTensorflow version 1.14を使って構築しているとある. このTensorflow version 1.14は
下記を参照するに cuda-10.0 が必要みたい.
https://www.tensorflow.org/install/source?hl=ja#gpu

だがしかし計算機に於いてnvidiaのドライバが 418.39 より上なら自動的に合うcudaを入れてくれるそうな.
一応下記コマンドでインストールされている nvidia ドライバは 460.27.04 のようである.

[root@e ~]# cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module  460.27.04  Fri Dec 11 23:35:05 UTC 2020
GCC version:  gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
 
[root@e ~]#

加えて anaconda による環境整備を求めている. ここではcrYOLOのように既にanaconda環境で各種のアプリケーションを
用意している. それに習い進める.

*既にpyenv/anacondaの環境があるとして進めてます

[root@e ~]# export PYENV_ROOT=/apps/pyenv
[root@e ~]# export PATH=$PYENV_ROOT/bin:$PATH
[root@e ~]# eval "$(pyenv init - --no-rehash)"
[root@e ~]# export PATH=$PYENV_ROOT/versions/anaconda3-5.3.1/bin/:$PATH
 
[root@e ~]# cd /apps
[root@e apps]# git clone https://github.com/rsanchezgarc/deepEMhancer
 
[root@e apps]# cd deepEMhancer
 
[root@e deepEMhancer]# conda env create -f deepEMhancer_env.yml  -n deepEMhancer_env
Collecting package metadata (repodata.json): done
Solving environment: done
 
Downloading and Extracting Packages
mkl-service-2.3.0    | 208 KB    | ####################################################################################### | 100%
 :
 :
done
#
# To activate this environment, use
#
#     $ conda activate deepEMhancer_env
#
# To deactivate an active environment, use
#
#     $ conda deactivate
 
[root@e deepEMhancer]#

と環境構築が完了します. 引き続きその作った環境に移行して、deepEMhancerのプログラムをインストールします.

[root@e deepEMhancer]# source activate deepEMhancer_env
(deepEMhancer_env) [root@e deepEMhancer]#
(deepEMhancer_env) [root@e deepEMhancer]# pwd
/apps/deepEMhancer
(deepEMhancer_env) [root@e deepEMhancer]# ls -CF
alternative_installation/  condaDeepEMHancer/  deepEMhancer/  deepEMhancer_env.yml  LICENSE  README.md  setup.py
 
(deepEMhancer_env) [root@e deepEMhancer]# which python
/apps/pyenv/versions/anaconda3-5.3.1/envs/deepEMhancer_env/bin/python
 
(deepEMhancer_env) [root@e deepEMhancer]# python -m pip install . --no-deps
Processing /apps/deepEMhancer
Building wheels for collected packages: deepEMhancer
  Building wheel for deepEMhancer (setup.py) ... done
  Created wheel for deepEMhancer: filename=deepEMhancer-0.13-cp36-none-any.whl size=33704 sha256=86e9791fa55e4c925439d00c0065cf5a657aa948a8a1b5c68ec43e6c74f6290e
  Stored in directory: /tmp/pip-ephem-wheel-cache-mkau9kef/wheels/5b/b5/bc/94d34445c5896c246e738ce9fb8813299f57abe7db9ea127fa
Successfully built deepEMhancer
Installing collected packages: deepEMhancer
Successfully installed deepEMhancer-0.13
 
(deepEMhancer_env) [root@e deepEMhancer]#

次にmodelをダウンロードします

(deepEMhancer_env) [root@e deepEMhancer]# deepemhancer --download

っで、ユーザrootで行ったために変な場所に落としてしまった...

(deepEMhancer_env) [root@e deepEMhancer]# ls -lh /root/.local/share/deepEMhancerModels/production_checkpoints/
total 884M
-rw-r--r--. 1 root root 298M Apr  4 23:25 deepEMhancer_highRes.hd5
-rw-r--r--. 1 root root 196M Apr  4 23:25 deepEMhancer_masked.hd5
-rw-r--r--. 1 root root 196M Apr  4 23:25 deepEMhancer_tightTarget.hd5
-rw-r--r--. 1 root root 196M Apr  4 23:25 deepEMhancer_wideTarget.hd5
-rw-r--r--. 1 root root   74 Apr  4 23:25 versions.txt
(deepEMhancer_env) [root@e deepEMhancer]#

これを別の場所に移す

(deepEMhancer_env) [root@e deepEMhancer]# mv /root/.local/share/deepEMhancerModels/production_checkpoints /apps/deepEMhancer/deepEMhancerModels

どうやら「deepemhancer --download」の時に場所を指定できるみたい

EnvironmentModulesで環境作成

[root@e deepEMhancer]# vi /etc/modulefiles/deepEMhancer
#%Module1.0
set          root       /apps/pyenv/versions/anaconda3-5.3.1/envs/deepEMhancer_env/
prepend-path PATH       $root/bin
 
[root@e deepEMhancer]#

つかう

[saber@e ~]$ module load deepEMhancer
 
[saber@e ~]$ 
[saber@e ~]$ deepemhancer -h
usage: deepemhancer -i INPUTMAP -o OUTPUTMAP
                    [-p {wideTarget,tightTarget,highRes}] [-i2 HALFMAP2]
                    [-s SAMPLINGRATE] [--noiseStats NOISE_MEAN NOISE_STD]
                    [-m BINARYMASK]
                    [--deepLearningModelPath PATH_TO_MODELS_DIR]
                    [--cleaningStrengh CLEANINGSTRENGH] [-g GPUIDS]
                    [-b BATCH_SIZE] [-h] [--download [DOWNLOAD_DEST]]
 
DeepEMHancer. Deep post-processing of cryo-EM maps. https://github.com/rsanchezgarc/deepEMhancer
 
optional arguments:
  -h, --help            show this help message and exit
  --download [DOWNLOAD_DEST]
                        download default DeepEMhancer models. They will be
                        saved at /home/saber/.local/share/deepEMhancerModels/p
                        roduction_checkpoints if no path provided
 
Main options:
  -i INPUTMAP, --inputMap INPUTMAP
                        Input map to process or half map number 1. This map
                        should be unmasked and not sharpened (Do not use post-
                        processed maps, only maps directly obtained from
                        refinement). If half map 1 used, do not forget to also
                        provide the half map 2 using -i2
  -o OUTPUTMAP, --outputMap OUTPUTMAP
                        Output fname where post-processed map will be saved
  -p {wideTarget,tightTarget,highRes}, --processingType {wideTarget,tightTarget,highRes}
                        Select the deep learning model you want to use.
                        WideTarget will produce less sharp results than
                        tightTarget. HighRes is only recommended for overal
                        FSC resolution < 4 A This option is igonred if
                        normalization mode 2 is selected
  -i2 HALFMAP2, --halfMap2 HALFMAP2
                        (Optional) Input half map 2 to process
  -s SAMPLINGRATE, --samplingRate SAMPLINGRATE
                        (Optional) Sampling rate (A/voxel) of the input map.
                        If not provided, the sampling rate will be read from
                        mrc file header
 
Normalization options (auto normalization is applied if no option selected):
  --noiseStats NOISE_MEAN NOISE_STD
                        (Optional) Normalization mode 1: The statisitcs of the
                        noise to normalize (mean and standard deviation) the
                        input. Preferred over binaryMask but ignored if
                        binaryMask provided. If not --noiseStats nor
                        --binaryMask provided, nomralization params will be
                        automatically estimated, although, in some rare cases,
                        estimation may fail or be less accurate
  -m BINARYMASK, --binaryMask BINARYMASK
                        (Optional) Normalization mode 2: A binaryMask (1
                        protein, 0 no protein) used to normalize the input. If
                        no normalization mode provided, automatic
                        normalization will be carried out. Supresses
                        --precomputedModel option
 
Alternative options:
  --deepLearningModelPath PATH_TO_MODELS_DIR
                        (Optional) Directory where a non default deep learning
                        model is located (model is selected using
                        --precomputedModel) or a path to hd5 file containing
                        the model
  --cleaningStrengh CLEANINGSTRENGH
                        (Optional) Post-processing step to remove small
                        connected components (hide dust). Max relative size of
                        connected components to remove 0<s<1 or -1 to
                        deactivate. Default: -1
 
Computing devices options:
  -g GPUIDS, --gpuIds GPUIDS
                        The gpu(s) where the program will be executed. If more
                        that 1, comma seppared. E.g -g 1,2,3. Set to -1 to use
                        only cpu (very slow). Default: 0
  -b BATCH_SIZE, --batch_size BATCH_SIZE
                        Number of cubes to process simultaneously. Lower it if
                        CUDA Out Of Memory error happens and increase it if
                        low GPU performance observed. Default: 8
 
examples:
 
  + Download deep learning models
deepemhancer --download
 
  + Post-process input map path/to/inputVol.mrc and save it at path/to/outputVol.mrc using default  deep model tightTarget
deepemhancer  -i path/to/inputVol.mrc -o  path/to/outputVol.mrc
 
  + Post-process input map path/to/inputVol.mrc and save it at path/to/outputVol.mrc using high resolution deep model
deepemhancer -p highRes -i path/to/inputVol.mrc -o  path/to/outputVol.mrc
 
  + Post-process input map path/to/inputVol.mrc and save it at path/to/outputVol.mrc using a deep learning model located in path/to/deep/learningModel
deepemhancer -c path/to/deep/learningModel -i path/to/inputVol.mrc -o  path/to/outputVol.mrc
 
  + Post-process input map path/to/inputVol.mrc and save it at path/to/outputVol.mrc using high resolution  deep model and providing normalization information (mean
    and standard deviation of the noise)
deepemhancer -p highRes -i path/to/inputVol.mrc -o  path/to/outputVol.mrc --noiseStats 0.12 0.03
[saber@e ~]$

トップ   編集 添付 複製 名前変更     ヘルプ   最終更新のRSS
Last-modified: 2021-09-30 (木) 02:18:21 (20d)