本家様 http://pymol.org/
open sourceでソースコードが提供されてます https://github.com/schrodinger/pymol-open-source

コンパイルせずに使えるバージョンは、本家様から入手可能で、open source版よりも機能が強化されてますが、有償です。

下準備

[root@rockylinux9 ~]# dnf install epel-release
[root@rockylinux9 ~]# dnf install --enablerepo=devel  python3-devel platform-python-devel glew-devel glm-devel netcdf-devel libpng-devel libxml2-devel freetype-devel python3-qt5 
 
(rockylinux8なら)
dnf install --enablerepo=powertools,epel  python3-devel platform-python-devel glew-devel netcdf-devel python3-qt5 libpng-devel libxml2-devel freetype-devel
dnf install https://dl.rockylinux.org/pub/rocky/9/devel/aarch64/os/Packages/g/glm-devel-0.9.9.8-3.el9.noarch.rpm
 
(centos7なら)
yum install centos-release-scl-rh epel-release
yum install devtoolset-11
yum install --enablerepo=epel python3-devel glew-devel netcdf-devel libpng-devel libxml2-devel freetype-devel python36-qt5
source scl_source enable devtoolset-11
git clone https://github.com/g-truc/glm
cd glm
git checkout 0.9.9.8
cp -r glm /usr/include
 
(ubuntu22)
apt install cmake git build-essential python-is-python3 python3-distutils python3-dev libglew-dev  libglm-dev libxml2-dev libfreetype-dev libnetcdf-dev libpng-dev

rockylinux8:「git tag」操作で v2.5.0 にするならOS提供の glm-devel-0.9.8.5 でも行けるが、最新コードには glm-devel-0.9.9.x が必要みたい
centos7:「git tag」操作で v2.5.0 にするならOS提供の glm-devel-0.9.6.3 でも行ける. 最新コードにはglmをgitで拾ってglmをコピーすれば行ける

コンパイル

PyMOLのソースコードをgithubから取得します.

mkdir -p /apps/src  && cd /apps/src
 
git clone https://github.com/schrodinger/pymol-open-source
 
cd pymol-open-source/
 
python3 setup.py build
python3 setup.py install --prefix=/apps/PyMOL

これで完了.

呼び出すpymolファイルの中身はこんな感じ

[root@rockylinux9 ~]# cat /apps/PyMOL/bin/pymol
#!/bin/sh
exec "/usr/bin/python3" "/apps/PyMOL/lib64/python3.9/site-packages/pymol/__init__.py" "$@"
 
[root@rockylinux9 ~]#

python3で実行される
*稀に「/usr/bin/python3」が「/usr/local/bin/python3」とかになる場合があるようで要注意

[saber@rockylinux9 ~]$ /apps/PyMOL/bin/pymol

2020y07m16d_013632990.png

めも

windowsPCにXサーバを入れて画面表示する際はMobaXterm経由なら大丈夫。Xming経由では起動しない(200715現在)

Xming経由でのエラー内容

[illya@centos8 ~]$ /apps/pymol/bin/pymol
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
 
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
 
Aborted (core dumped)
[illya@centos8 ~]$

MobaXterm経由なら表示はできているが、下記エラーが表示される。

[illya@centos8 ~]$ /apps/pymol/bin/pymol
 PyMOL(TM) Molecular Graphics System, Version 2.5.0a0.
 Copyright (c) Schrodinger, LLC.
 All Rights Reserved.
 
    Created by Warren L. DeLano, Ph.D.
 
    PyMOL is user-supported open-source software.  Although some versions
    are freely available, PyMOL is not in the public domain.
 
    If PyMOL is helpful in your work or study, then please volunteer
    support for our ongoing efforts to create open and affordable scientific
    software by purchasing a PyMOL Maintenance and/or Support subscription.
 
    More information can be found at "http://www.pymol.org".
 
    Enter "help" for a list of commands.
    Enter "help <command-name>" for information on a specific command.
 
 Hit ESC anytime to toggle between text and graphics.
 
qt.qpa.xcb: QXcbConnection: XCB error: 145 (Unknown), sequence: 175, resource id: 0, major code: 139 (Unknown), minor code: 20
 Detected OpenGL version 3.1. Shaders available.
 Geometry shaders not available
 Detected GLSL version 1.40.
 OpenGL graphics engine:
  GL_VENDOR:   VMware, Inc.
  GL_RENDERER: llvmpipe (LLVM 9.0.0, 256 bits)
  GL_VERSION:  3.1 Mesa 19.3.4
 Detected 4 CPU cores.  Enabled multithreaded rendering.
 
[illya@centos8 ~]$

これはここを参照して回避できた
https://stackoverflow.com/questions/51218417/qxcbconnection-xcb-error-145-unknown-error-message-starting-spyder-with-moba

EnvironmentModules

「/apps/modulefiles/PyMOL」として

#%Module1.0
set pymol /apps/PyMOL
set-alias pymol $pymol/bin/pymol

プラグイン(APBS GUI)

(入れる場所の確認)
[root@rockylinux9 ~]# ls /apps/PyMOL/lib64/python3.9/site-packages/pmg_tk/startup/
__init__.py  __pycache__
 
[root@rockylinux9 ~]#
 
[root@rockylinux9 ~]# git clone https://github.com/YoshitakaMo/pymolplugin.git
 
[root@rockylinux9 ~]# cp -arp ~/pymolplugin/*     /apps/PyMOL/lib64/python3.9/site-packages/pmg_tk/startup/
 
[root@rockylinux9 ~]# ls -l /apps/PyMOL/lib64/python3.9/site-packages/pmg_tk/startup/
total 8
drwxr-xr-x. 2 root root   41 Apr 13 19:33 align_gui
drwxr-xr-x. 2 root root  104 Apr 13 19:33 apbs_gui
drwxr-xr-x. 2 root root   49 Apr 13 19:33 excelexporter
-rw-r--r--. 1 root root 1454 Apr 13 19:28 __init__.py
drwxr-xr-x. 2 root root   40 Apr 13 19:33 lightingsettings_gui
drwxr-xr-x. 2 root root   41 Apr 13 19:33 morph_gui
drwxr-xr-x. 2 root root   37 Apr 13 19:34 __pycache__
-rw-r--r--. 1 root root 1082 Apr 13 19:33 README.md
 
[root@rockylinux9 ~]#

PyMOLを立ち上げて、メニューバーを確認してみる
2023y04m13d_193734284.png

次に表面電荷を計算するプログラムを導入します. pdb2pqr と APBS が必要で pdb2pqr はpipで入るそうな. もう片方(APBS)はmake testに python 3.6 が必要らしい.
なのでpyenv/anaconda環境でconda実行環境を1つ作って構築してみた

git clone https://github.com/yyuu/pyenv.git /apps/pyenv
export PYENV_ROOT=/apps/pyenv
export PATH=$PYENV_ROOT/bin:$PATH
pyenv install anaconda3-2023.03
pyenv global anaconda3-2023.03
export PATH=$PYENV_ROOT/versions/anaconda3-2023.03/bin/:$PATH
conda update conda
 
(既にpyenv/anaconda環境があるなら)
export PYENV_ROOT=/apps/pyenv
export PATH=$PYENV_ROOT/bin:$PATH
export PATH=$PYENV_ROOT/versions/anaconda3-2023.03/bin/:$PATH

としたうえで、

[root@rockylinux9 ~]# conda create -n pdb2pqr pip python=3.6
[root@rockylinux9 ~]# source activate pdb2pqr
(pdb2pqr) [root@rockylinux9 ~]# pip install pdb2pqr
 
(pdb2pqr) [root@rockylinux9 ~]# dnf --enablerepo=devel install suitesparse-devel libtirpc-devel
(pdb2pqr) [root@rockylinux9 ~]# cd /apps/src/
(pdb2pqr) [root@rockylinux9 src]# git clone https://github.com/Electrostatics/apbs
(pdb2pqr) [root@rockylinux9 src]# cd apbs/
(pdb2pqr) [root@rockylinux9 apbs]# mkdir build ; cd build
(pdb2pqr) [root@rockylinux9 build]# cmake .. -DCMAKE_INSTALL_PREFIX=/apps/apbs  -DAPBS_STATIC_BUILD=OFF
(pdb2pqr) [root@rockylinux9 build]# make; make install

これで
pdb2pqr は「/apps/pyenv/versions/anaconda3-2023.03/envs/pdb2pqr/bin/pdb2pqr30」
APBS は「/apps/apbs/bin/apbs」
と指定して実行できます. 事前にLD_LIBRARY_PATHに「/apps/apbs/lib64」を入れる必要あり

プラグイン(APBS GUI) on rockylinux8

プラグインメニューのところまでは同じで、それ以降
その前に追加パッケージを入れます

dnf --enablerepo=powertools install suitesparse-devel libtirpc-devel cmake openblas-threads openblas-devel
dnf --enablerepo=powertools install metis-devel
dnf --enablerepo=powertools install boost-devel eigen3-devel   (-DENABLE_GEOFLOW=ONなら)
dnf --enablerepo=powertools install swig                       (-DENABLE_PYTHON=ONなら + conda install pybind11)

その後で

[root@rockylinux ~]# conda create -n pdb2pqr pip python=3.6
[root@rockylinux ~]# source activate pdb2pqr
(pdb2pqr) [root@rockylinux ~]# pip install pdb2pqr
 
[引き続き APBS のインストール]
(pdb2pqr) [root@rockylinux ~]# cd /apps/src
(pdb2pqr) [root@rockylinux src]# git clone https://github.com/Electrostatics/apbs
(pdb2pqr) [root@rockylinux src]# cd apbs/
(pdb2pqr) [root@rockylinux apbs]# mkdir build ; cd build 
(pdb2pqr) [root@rockylinux build]# cmake .. -DCMAKE_INSTALL_PREFIX=/apps/apbs  -DAPBS_STATIC_BUILD=OFF \
                                             -DENABLE_GEOFLOW=ON \
                                             -DENABLE_BEM=ON  \
                                             -DENABLE_OPENMP=ON \
                                             -DENABLE_PBAM=OFF \
                                             -DENABLE_PBSAM=OFF \
                                             -DENABLE_PYTHON=OFF \
                                             -DENABLE_TESTS=ON
(pdb2pqr) [root@rockylinux build]# make -j 20 ; make install ; PATH=/apps/apbs/bin:$PATH make test

プラグイン(APBS GUI) on centos7

プラグインメニューのところまでは同じで、それ以降
その前に追加パッケージを入れます

yum install centos-release-scl-rh
yum install devtoolset-11
yum install --enablerepo=epel cmake3 
yum install suitesparse-devel libtirpc-devel openblas-threads openblas-devel boost-devel eigen3-devel python3-devel
 
source scl_source enable devtoolset-11

その後で

[root@centos7 ~]# conda create -n pdb2pqr pip python=3.6
[root@centos7 ~]# source activate pdb2pqr
(pdb2pqr) [root@centos7 ~]# pip install pdb2pqr
 
[引き続き APBS のインストール]
(pdb2pqr) [root@centos7 ~]# cd /apps/src/
(pdb2pqr) [root@centos7 src]# git clone https://github.com/Electrostatics/apbs
(pdb2pqr) [root@centos7 src]# cd apbs/
(pdb2pqr) [root@centos7 apbs]# mkdir build ; cd build 
 
(pdb2pqr) [root@centos7 build]# which gcc
/opt/rh/devtoolset-11/root/usr/bin/gcc
 
(pdb2pqr) [root@centos7 build]# cmake3 .. -DCMAKE_INSTALL_PREFIX=/apps/apbs  -DAPBS_STATIC_BUILD=OFF \
                                             -DENABLE_GEOFLOW=ON \
                                             -DENABLE_BEM=ON  \
                                             -DENABLE_OPENMP=ON \
                                             -DENABLE_PBAM=OFF \
                                             -DENABLE_PBSAM=OFF \
                                             -DENABLE_PYTHON=OFF\
                                             -DENABLE_TESTS=ON
 
(pdb2pqr) [root@centos7 build]# make VERBOSE=1 ; make install ; PATH=/apps/apbs/bin:$PATH make test

テスト

2023y04m23d_054411202.png

conda

一応 conda-forge にも pymol が存在している.
簡単にはcondaで作るのがいいのかも

[root@rockylinux ~]# conda create -n pymol-open-source -c conda-forge pymol-open-source
 
 
[saber@rockylinux ~]$ /apps/pyenv/versions/anaconda3-2023.03/envs/pymol-open-source/bin/pymol

あとschrodinger様のpymolもあるけど、

[root@rockylinux ~]# conda create -n pymol-schrodinger -c schrodinger pymol
 
[saber@rockylinux ~]$ /apps/pyenv/versions/anaconda3-2023.03/envs/pymol-schrodinger/bin/pymol

と起動した後に
2023y06m18d_133911881.png
と言われますので、ライセンス購入者様向けのパッケージですね.

最新の60件
2024-02-23 2024-02-22 2024-02-21 2024-02-20 2024-02-19 2024-02-18 2024-02-17 2024-02-16 2024-02-13 2024-02-12
  • PyMOL
2024-02-09 2024-02-04 2024-02-03 2024-01-31 2024-01-30 2024-01-29 2024-01-28 2024-01-22 2024-01-16 2024-01-15 2024-01-13 2024-01-12 2024-01-09 2024-01-08 2024-01-07 2024-01-03 2023-12-22 2023-12-17 2023-12-16 2023-12-11 2023-12-09 2023-12-06 2023-11-30 2023-11-27 2023-11-21 2023-11-19 2023-11-18 2023-11-14 2023-11-10 2023-11-09 2023-11-05 2023-11-03 2023-10-30 2023-10-26

edit


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2024-02-12 (月) 19:50:51