本家様https://github.com/keitaroyam/servalcat

Servalcat(Structure refinement and validation for crystallography and single particle analysis)
deepL先生訳「結晶構造解析と単粒子解析のための構造の精密化と検証」

gitのサイトに書かれているように

pip install servalcat

でインストール可能の様子.

ここではpyenv/minicondaでservalcat向けの環境を作ってそこにservalcat を用意してみた

[root@centos7 ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
 
[root@centos7 ~]# git clone https://github.com/yyuu/pyenv.git /apps/pyenv
[root@centos7 ~]# export PYENV_ROOT=/apps/pyenv
[root@centos7 ~]# export PATH=$PYENV_ROOT/bin:$PATH
[root@centos7 ~]# pyenv install miniconda3-4.7.12
[root@centos7 ~]# pyenv global miniconda3-4.7.12
[root@centos7 ~]# pyenv versions
  system
* miniconda3-4.7.12 (set by /apps/pyenv/version)
 
[root@centos7 ~]# export PATH=$PYENV_ROOT/versions/miniconda3-4.7.12/bin/:$PATH
 
[root@centos7 ~]# conda config --add channels conda-forge
[root@centos7 ~]# conda config --remove channels defaults
[root@centos7 ~]# conda info
 
     active environment : None
       user config file : /root/.condarc
 populated config files : /root/.condarc
          conda version : 4.7.12
    conda-build version : not installed
         python version : 3.7.4.final.0
       virtual packages : __cuda=12.0
       base environment : /apps/pyenv/versions/miniconda3-4.7.12  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /apps/pyenv/versions/miniconda3-4.7.12/pkgs
                          /root/.conda/pkgs
       envs directories : /apps/pyenv/versions/miniconda3-4.7.12/envs
                          /root/.conda/envs
               platform : linux-64
             user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.4 Linux/3.10.0-1160.el7.x86_64 centos/7.9.2009 glibc/2.17
                UID:GID : 0:0
             netrc file : None
           offline mode : False
 
[root@centos7 ~]#
[root@centos7 ~]# conda update conda -y
 
(以上でpyenv/miniconda環境の構築が終わって、次にservalcat環境を作る)
[root@centos7 ~]# conda create -n servalcat pip
[root@centos7 ~]# source activate servalcat
(servalcat) [root@centos7 ~]# pip install servalcat
(servalcat) [root@centos7 ~]# conda deactivate
[root@centos7 ~]#

EnvironmentModules

[root@centos7 ~]# vi /apps/modulefiles/servalcat
#%Module1.0
set          root /apps/pyenv/versions/miniconda3-4.7.12/envs/servalcat
prepend-path PATH $root/bin
 
[root@centos7 ~]#

使ってみる

REFMAC5との連携があるので、ccp4のロードも行う

[saber@centos7 ~]$ module use --append /apps/modulefiles/     <-- この部分は$HOME/.bashrcらに記載すれば宜しいかと
[saber@centos7 ~]$ module load ccp4
[saber@centos7 ~]$ module load servalcat
 
[saber@centos7 ~]$ servalcat
usage: servalcat [-h] [--skip_test] [-v]
                 {sfcalc,shiftback,refine_spa,refine_cx,fsc,fofc,trim,translate,localcc,sigmaa,util,refmac5} ...
 
A tool for model refinement and map calculation for cryo-EM SPA.
 
positional arguments:
  {sfcalc,shiftback,refine_spa,refine_cx,fsc,fofc,trim,translate,localcc,sigmaa,util,refmac5}
 
options:
  -h, --help            show this help message and exit
  --skip_test           Skip installation test
  -v, --version         show program's version number and exit
 
# Finished on 2022-12-21 23:50:18.340847
 
[saber@centos7 ~]$

offline環境へ持っていく

[root@centos7 ~]# conda activate servalcat
(servalcat) [root@centos7 ~]# pip freeze > requirements.txt
 
(servalcat) [root@centos7 ~]# cat requirements.txt
gemmi==0.5.7
numpy==1.24.0
pandas==1.5.2
python-dateutil==2.8.2
pytz==2022.7
scipy==1.9.3
servalcat==0.2.122
six==1.16.0
 
(servalcat) [root@centos7 ~]# mkdir servalcat-packages
 
(servalcat) [root@centos7 ~]# pip download -d ./servalcat-packages -r ./requirements.txt
Collecting gemmi==0.5.7
  Using cached gemmi-0.5.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
Collecting numpy==1.24.0
  Using cached numpy-1.24.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
Collecting pandas==1.5.2
  Using cached pandas-1.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB)
Collecting python-dateutil==2.8.2
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pytz==2022.7
  Using cached pytz-2022.7-py2.py3-none-any.whl (499 kB)
Collecting scipy==1.9.3
  Using cached scipy-1.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (33.4 MB)
Collecting servalcat==0.2.122
  Using cached servalcat-0.2.122-py3-none-any.whl (114 kB)
Collecting six==1.16.0
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Saved ./servalcat-packages/gemmi-0.5.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Saved ./servalcat-packages/numpy-1.24.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Saved ./servalcat-packages/pandas-1.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Saved ./servalcat-packages/python_dateutil-2.8.2-py2.py3-none-any.whl
Saved ./servalcat-packages/pytz-2022.7-py2.py3-none-any.whl
Saved ./servalcat-packages/scipy-1.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Saved ./servalcat-packages/servalcat-0.2.122-py3-none-any.whl
Saved ./servalcat-packages/six-1.16.0-py2.py3-none-any.whl
Successfully downloaded gemmi numpy pandas python-dateutil pytz scipy servalcat six
 
(servalcat) [root@centos7 ~]# ls -l servalcat-packages/
total 65136
-rw-r--r--. 1 root root  3097735 Dec 22 00:20 gemmi-0.5.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
-rw-r--r--. 1 root root 17266259 Dec 22 00:20 numpy-1.24.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
-rw-r--r--. 1 root root 12013615 Dec 22 00:20 pandas-1.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
-rw-r--r--. 1 root root   247702 Dec 22 00:20 python_dateutil-2.8.2-py2.py3-none-any.whl
-rw-r--r--. 1 root root   499364 Dec 22 00:20 pytz-2022.7-py2.py3-none-any.whl
-rw-r--r--. 1 root root 33430216 Dec 22 00:20 scipy-1.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
-rw-r--r--. 1 root root   114766 Dec 22 00:20 servalcat-0.2.122-py3-none-any.whl
-rw-r--r--. 1 root root    11053 Dec 22 00:20 six-1.16.0-py2.py3-none-any.whl
 
(servalcat) [root@centos7 ~]#

Singularity

Singularityならファイルとして実行環境を扱えるので、ある意味便利

[root@centos7 ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
 
[root@centos7 ~]# yum install epel-release
[root@centos7 ~]# yum install singularity apptainer-suid
 
[root@centos7 ~]# singularity build --sandbox servalcat docker://python:3.8.12-bullseye
 
[root@centos7 ~]#  singularity shell --writable servalcat
Apptainer>
Apptainer> pip install servalcat
Apptainer>
Apptainer> exit
exit
[root@centos7 ~]#
[root@centos7 ~]# singularity build servalcat.sif servalcat
[root@centos7 ~]# ls -lh servalcat.sif
-rwxr-xr-x. 1 root root 375M Dec 22 00:30 servalcat.sif
[root@centos7 ~]#

使ってみる

[illya@centos7 ~]$ singularity shell /apps/servalcat.sif
Apptainer> servalcat
usage: servalcat [-h] [--skip_test] [-v]
                 {sfcalc,shiftback,refine_spa,refine_cx,fsc,fofc,trim,translate,localcc,sigmaa,util,refmac5} ...
 
A tool for model refinement and map calculation for cryo-EM SPA.
 
positional arguments:
  {sfcalc,shiftback,refine_spa,refine_cx,fsc,fofc,trim,translate,localcc,sigmaa,util,refmac5}
 
optional arguments:
  -h, --help            show this help message and exit
  --skip_test           Skip installation test
  -v, --version         show program's version number and exit
 
# Finished on 2022-12-22 00:37:47.175981
 
Apptainer> servalcat --version
Servalcat 0.2.122 with Python 3.8.12 (gemmi 0.5.7, scipy 1.9.3, numpy 1.24.0, pandas 1.5.2)
 
# Finished on 2022-12-22 00:37:51.354880
 
Apptainer> exit
exit
[illya@centos7 ~]$

ぁrefmac5を忘れた...

ぇっとsingularity のbind機能を活かします

[illya@centos7 ~]$ singularity shell -B /apps:/apps /apps/servalcat.sif
Apptainer> 
Apptainer> source /apps/ccp4-8.0/bin/ccp4.setup-sh
Apptainer> 
Apptainer> which refmac5
/apps/ccp4-8.0/bin/refmac5
Apptainer>
Apptainer> servalcat --version
Servalcat 0.2.122 with Python 3.8.12 (gemmi 0.5.7, scipy 1.9.3, numpy 1.24.0, pandas 1.5.2)
 
# Finished on 2022-12-22 01:05:39.793055
 
Apptainer> exit
[illya@centos7 ~]$

これで行けるかな


トップ   編集 添付 複製 名前変更     ヘルプ   最終更新のRSS
Last-modified: 2022-12-22 (木) 11:50:30 (42d)