当前位置:网站首页>Rdkit installation
Rdkit installation
2022-06-11 16:30:00 【Dazed flounder】
RDKit file
RDKit summary
What is it ?
Chemical informatics Open Source Toolkit
- Business friendly BSD license
- C++ The core data structure and algorithm in
- Use Boost.Python Generated Python 3.x Wrappers
- Use SWIG Generated Java and C# Wrappers
- 2D and 3D Molecular manipulation
- Machine learning descriptor generation
- be used for PostgreSQL Molecular database box
- KNIME Chemical informatics node ( come from KNIME Community site :https://www.knime.com/rdkit)
operation :
- http://www.rdkit.org
- Support Mac/Windows/Linux
install
anaconda python Lower cross platform ( The fastest installation )
anaconda brief introduction
Conda It's open source 、 Cross platform package manager . It supports the packaging and distribution of software components , And manage their installation in an isolated execution environment . It is associated with pip and virtualenv There are several analogies , But it was designed to be more “ And python irrelevant ” And it is more suitable for the distribution of binary packages and their dependencies .
How to get conda
obtain Conda The easiest way to do this is to install it as Anaconda Python Distribution version Part of . smaller 、 More independent Miniconda Provides a possibility ( But it is more complicated to use ) alternatives .conda The source code repository is in github Available on the , Other documents are provided by the project website .
How to use Conda install RDKit
Create an installation of RDKit The new conda The environment needs a command similar to the following :
conda create -c conda-forge -n my-rdkit-env rdkit
Last , The new environment must be activated , So that the corresponding python The interpreter is in the same shell Available in the :
conda activate my-rdkit-env
If for some reason this doesn't work , Please try :
cd [anaconda folder]/bin
source activate my-rdkit-env
Windows The user will use slightly different commands :
C:\> activate my-rdkit-env
How to use Conda Build from source
About using Conda More details on building from source code , see also conda-rdkit The repository .
macOS 10.12 (Sierra):Python 3 Environmental Science
The following command will be macOS Sierra and Python 3 Create a development environment . from Conda download Miniconda3-latest-MacOSX-x86_64.sh And run the following command :
bash Miniconda3-latest-MacOSX-x86_64.sh
conda install numpy matplotlib
conda install cmake cairo pillow eigen pkg-config
conda install boost-cpp boost py-boost
perhaps , Add the following package to your environment as a useful development tool .
pip install yapf==0.11.1
pip install coverage==3.7.1
Then follow the usual build instructions .PYTHON_INCLUDE_DIR Must be in cmake Set... In the command .
PYROOT=<path to miniconda3>
cmake -DPYTHON_INCLUDE_DIR=$PYROOT/include/python3.6m \
-DRDK_BUILD_AVALON_SUPPORT=ON \
-DRDK_BUILD_CAIRO_SUPPORT=ON \
-DRDK_BUILD_INCHI_SUPPORT=ON \
..
After successful completion make, Run the test using the following command :make install
RDBASE=$RDBASE DYLD_FALLBACK_LIBRARY_PATH="$RDBASE/lib:$PYROOT/lib" PYTHONPATH=$RDBASE ctest
This is necessary , because Recent macOS The version introduces System integrity protection SIP .
Linux x86_64:Python 3 Environmental Science
The following command will be Linux x86_64 and Python 3 Create a development environment .
First of all, from the Anaconda Download the latest anaconda Install the program and install it . then , Install required packages :
bash Anaconda3-5.2.0-x86_64.sh
conda install -y cmake cairo pillow eigen pkg-config
conda install -y boost-cpp boost py-boost
Numpy and matplotlib It's already anaconda Part of foundation installation . Because the current build is up to date boost Library GLIBC Version higher than anaconda Default version in , We need to update to a newer version :
conda install -y gxx_linux-64
here , You should be able to put RDKit Clone the repository to the desired build location , Then start building . Please note that , It is necessary to point out numpy The path to the header , In order to RDKit Find them , because anaconda Hide them in numpy In bag :
git clone https://github.com/rdkit/rdkit.git
cd rdkit
mkdir build && cd build
cmake -DPy_ENABLE_SHARED=1 \
-DRDK_INSTALL_INTREE=ON \
-DRDK_INSTALL_STATIC_LIBS=OFF \
-DRDK_BUILD_CPP_TESTS=ON \
-DPYTHON_NUMPY_INCLUDE_PATH="$(python -c 'import numpy ; print(numpy.get_include())')" \
-DBOOST_ROOT="$CONDA_PREFIX" \
..
Last make, and make installctest
from conda Environment installation and use PostgreSQL and RDKit PostgreSQL box
because conda python Distribution and system python Different versions , So by conda install PostgreSQL and PostgreSQL python The client is the easiest .
After activating your environment , Just do it by :
conda install -c rdkit rdkit-postgresql
conda package PostgreSQL Version needs to be run initdb Command to initialize [conda folder]/envs/my-rdkit-env/bin
[conda folder]/envs/my-rdkit-env/bin/initdb -D /folder/where/data/should/be/stored
You can then run... From the terminal using the following command PostgreSQL:
[conda folder]/envs/my-rdkit-env/bin/postgres -D /folder/where/data/should/be/stored
For most use cases , You need to PostgreSQL Run as a daemons , One way is to use supervisor. You can... Here Learn more and how to install supervisor . The required configuration files will be as follows :
[program:postgresql]
command=[conda folder]/envs/my-rdkit-env/bin/postgres -D /folder/where/data/should/be/stored
user=[your username]
autorestart=true
once PostgreSQL Start and run , All normal PostgreSQL Commands are available in your conda Run when the environment is activated . therefore , To create a database , You can run :
createdb my_rdkit_db
psql my_rdkit_db
# create extension rdkit;
If you try to use multiple... In different environments PostgreSQL install , You have to go through edit PostgreSQL The configuration file To set up different pid file 、unix Sockets and ports . Through the above configuration , These files can be found in /folder/where/data/should/be/stored Find .
Linux and OS X
Install from the repository
Ubuntu 12.04 And higher
thank Debichem Team effort ,RDKit Can pass Ubuntu The repository gets . install :
sudo apt-get install python-rdkit librdkit1 rdkit-data
Fedora、CentOS and RHEL
thank Gianluca Sforna The job of ,RDKit Binary system RPM Now it is Fedora Part of the official Repository :https://admin.fedoraproject.org/pkgdb/package/rpms/rdkit/
Build from source
from 2018_03 Publish start ,RDKit The core C++ The code is modern C++ Compiling ; For this version , It means C++11. This means that the compiler used to build it cannot be completely old . The following is the minimum test version :
- g++ v4.8: But please pay attention to ,SLN Parser code cannot use v4.8 structure . When using this old compiler , It will automatically disable .
- clang v3.9: Maybe an older version of the compiler can also work , But we haven't tested yet .
- Visual Studio 2015: Maybe an older version of the compiler can also work , But we haven't tested it yet .
structure RDKit
Get source code , Here is tar.gz, But you can also use git:
wget https://github.com/rdkit/rdkit/archive/Release_XXXX_XX_X.tar.gz
senior
Specify the installation location
You need to RDK_INSTALL_INTRE close :
cmake -DRDK_INSTALL_INTREE=OFF -DCMAKE_INSTALL_PREFIX=/path/as/you/like ..
Designated spare Boost install
You need to tell cmake Where can I find boost Library and header files :
If you are in Added in boost /opt/local, be cmake The call will look like this :
cmake -DBOOST_ROOT=/opt/local ..
Please note that , If you use your own... On a system with a system installation boost install , Usually it's best to do it in your cmake The command contains parameters .-D Boost_NO_SYSTEM_PATHS=ON
Designated spare Python install
If you do not use the default for your computer python install , You need to tell cmake Where can I find what it should link to python Kuhe python The header file .
This is an example command line :
cmake -D PYTHON_LIBRARY=/usr/lib/python3.6/config/libpython3.6.a -D PYTHON_INCLUDE_DIR=/usr/include/python3.6/ -D PYTHON_EXECUTABLE=/usr/bin/python3 ..
If correct PYTHON_EXECUTABLEpython It's yours PATH.
Ban Python Wrappers
You can disable... Completely python The construction of the wrapper :
cmake -DRDK_BUILD_PYTHON_WRAPPERS=OFF ..
Recommended additional features
- -DRDK_BUILD_INCHI_SUPPORT=ON You can add parameters to cmake Command line to enable the generation of InChI String and InChI Key support .
- -DRDK_BUILD_AVALON_SUPPORT=ON You can add parameters to your cmake Command line to enable Avalon Toolkit support .
- If you want to be able to generate high-quality PNG, You should install... On your system cairo And build enable cairo Supported by RDKit:-DRDK_BUILD_CAIRO_SUPPORT=ON
- If you want to be able to use 3D The descriptor , You need to install eigen3 Copy of . Most operating systems have corresponding software packages .
structure Java Wrappers
build
- When you call cmake When adding parameters . for example :-D RDK_BUILD_SWIG_WRAPPERS=ONcmake -D RDK_BUILD_SWIG_WRAPPERS=ON …
- Use make Build and install normally . This directory $RDBASE/Code/JavaWrappers/gmwrapper Will contain three required files :(libGraphMolWrap.so stay libGraphMolWrap.jnilibOS X On )org.RDKit.jar、 and org.RDKitDoc.jar.
$ CLASSPATH=$CLASSPATH:$RDBASE/Code/JavaWrappers/gmwrapper/org.RDKit.jar jython -Djava.library.path=$RDBASE/Code/JavaWrappers/gmwrapper
Jython 2.2.1 on java1.6.0_20
Type "copyright", "credits" or "license" for more information.
>>> from org.RDKit import *
>>> from java import lang
>>> lang.System.loadLibrary('GraphMolWrap')
>>> m = RWMol.MolFromSmiles('c1ccccc1')
>>> m.getNumAtoms()
6L
Reference resources
https://www.rdkit.org/docs/Install.html
边栏推荐
- Project workspace creation steps - Zezhong ar automated test tool
- [从零开始学习FPGA编程-17]:快速入门篇 - 操作步骤2-5- VerilogHDL硬件描述语言符号系统与程序框架(软件程序员和硬件工程师都能看懂)
- Cloud data management will break the island of storage and the island of team
- 项目无法加载nacos配置中心的配置文件问题
- [LeetCode每日一题] |686.重复叠加字符串匹配
- R1 Quick Open Pressure Vessel Operation test Library and Simulation Test in 2022
- 2022 R1 quick opening pressure vessel operation test question bank and simulation test
- 2022年高处安装、维护、拆除考试模拟100题及在线模拟考试
- laravel 8 使用passport 进行Auth验证及颁发token
- 从0到1了解Prometheus
猜你喜欢

面试高频算法题---最长回文子串

Implementation of VGA protocol based on FPGA

时序预测 | MATLAB实现RBF径向基神经网络时间序列未来多步预测

项目经理如何击退被工作汇报支配的恐惧感?

What if the win10 security center cannot be closed

真香,华为主动离职也给 N+1

Will you be punished for not wearing seat belts in the back row?

JDBC debugging error, ask for guidance
![[sword finger offer] 21 Adjust array order so that odd numbers precede even numbers](/img/ba/8fa84520bacbc56ce7cbe02ee696c8.png)
[sword finger offer] 21 Adjust array order so that odd numbers precede even numbers

【pytest学习】pytest 用例执行失败后其他不再执行
随机推荐
Zhenxiang, Huawei gives n+1 for voluntary resignation
Learn about Prometheus from 0 to 1
Differences between list and set access elements
虚拟局域网划分与虚拟局域网间路由(VLAN)
从0到1了解Prometheus
2022 safety officer-a certificate test question simulation test question bank simulation test platform operation
【opencvsharp】斑点检测 条码解码 图像操作 图像旋转/翻转/缩放 透视变换 图像显示控件 demo笔记
pycharm和anaconda的基础上解决Jupyter连接不上Kernel(内核)的问题--解决方案1
List和Dict数据类型作用详解
TC8:UDP_MessageFormat_01-02
If you want to learn ArrayList well, it is enough to read this article
Time processing logic for the last 7 days, the last 10 days, and the last 90 days
2022高压电工特种作业证考试题库及在线模拟考试
信息收集常用工具及命令
Toolbar details of user interface - autorunner automated test tool
Production problem troubleshooting reference
Leetcode 1974. 使用特殊打字机键入单词的最少时间(可以,一次过)
leetcode684. 冗余连接(中等)
Aaai2022 latest "time series data processing" report, 127 pages of PPT describing time series data processing and medical application progress
(OJ assignment of Hunan University of science and Technology) problem g: pattern matching of strings