关于RDKit的学习及介绍:
RDKit安装
基础教程:[Getting Started with RDKit in Python]
RDkit四:数据处理过程中smiles编码的清洗统一化
reticulate-R Interface to Python
在RStudio中加载 rdkit.Chem和rdkit.Chem.rdmolops 时,报错,根据保存内容提示,是需要先安装python的,具体安装及设置参考:Python | 安装、环境配置及包的安装。
# reticulate包涵盖了用于Python和R之间协同操作的全套工具,在R和Rstudio中均可使用
library(reticulate)
## 6.2 安装rdkit包
reticulate::py_install("rdkit")
# 加载rdkit.Chem和rdkit.Chem.rdmolops
rdkit <- import("rdkit.Chem")
rdmolops <- import("rdkit.Chem.rdmolops")
remover <- import("rdkit.Chem.SaltRemover")
> rdkit <- import("rdkit.Chem")
Error in stop_no_virtualenv_starter(version = version, python = python) :
Suitable Python installation for creating a venv not found.
Please install Python with one of following methods:
- https://www.python.org/downloads/
- reticulate::install_python(version = '')
更详细的安装及调用报错过程可参考:reticulate | R-python调用 | 安装及配置 | conda文件配置。
> reticulate::py_install("rdkit")
+ "C:/Users/hp/AppData/Local/r-miniconda/condabin/conda.bat" "install" "--yes" "--prefix" "C:/Users/hp/AppData/Local/r-miniconda/envs/r-reticulate" "-c" "conda-forge" "rdkit"
Retrieving notices: ...working... done
Channels:
- conda-forge
- defaults
Platform: win-64
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
## Package Plan ##
environment location: C:\Users\hp\AppData\Local\r-miniconda\envs\r-reticulate
added / updated specs:
- rdkit
The following packages will be downloaded:
package | build
---------------------------|-----------------
brotli-1.1.0 | hcfcfb64_1 19 KB conda-forge
brotli-bin-1.1.0 | hcfcfb64_1 20 KB conda-forge
cairo-1.18.0 | h1fef639_0 1.4 MB conda-forge
certifi-2023.7.22 | pyhd8ed1ab_0 150 KB conda-forge
contourpy-1.2.0 | py39h1f6ef14_0 182 KB conda-forge
cycler-0.12.1 | pyhd8ed1ab_0 13 KB conda-forge
expat-2.5.0 | h63175ca_1 221 KB conda-forge
font-ttf-dejavu-sans-mono-2.37| hab24e00_0 388 KB conda-forge
font-ttf-inconsolata-3.000 | h77eed37_0 94 KB conda-forge
font-ttf-source-code-pro-2.038| h77eed37_0 684 KB conda-forge
font-ttf-ubuntu-0.83 | hab24e00_0 1.9 MB conda-forge
fontconfig-2.14.2 | hbde0cde_0 186 KB conda-forge
fonts-conda-ecosystem-1 | 0 4 KB conda-forge
fonts-conda-forge-1 | 0 4 KB conda-forge
fonttools-4.44.0 | py39ha55989b_0 1.7 MB conda-forge
freetype-2.12.1 | hdaf720e_2 498 KB conda-forge
freetype-py-2.3.0 | pyhd8ed1ab_0 58 KB conda-forge
gettext-0.21.1 | h5728263_0 5.3 MB conda-forge
greenlet-3.0.1 | py39h99910a6_0 188 KB conda-forge
icu-73.2 | h63175ca_0 12.8 MB conda-forge
importlib-resources-6.1.1 | pyhd8ed1ab_0 9 KB conda-forge
importlib_resources-6.1.1 | pyhd8ed1ab_0 29 KB conda-forge
kiwisolver-1.4.5 | py39h1f6ef14_1 54 KB conda-forge
lcms2-2.15 | h67d730c_3 487 KB conda-forge
lerc-4.0.0 | h63175ca_0 190 KB conda-forge
libboost-1.82.0 | h65993cd_6 2.3 MB conda-forge
libboost-python-1.82.0 | py39h5c3ab46_6 108 KB conda-forge
libbrotlicommon-1.1.0 | hcfcfb64_1 69 KB conda-forge
libbrotlidec-1.1.0 | hcfcfb64_1 32 KB conda-forge
libbrotlienc-1.1.0 | hcfcfb64_1 241 KB conda-forge
libdeflate-1.19 | hcfcfb64_0 150 KB conda-forge
libexpat-2.5.0 | h63175ca_1 135 KB conda-forge
libglib-2.78.1 | he8f3873_0 2.5 MB conda-forge
libjpeg-turbo-3.0.0 | hcfcfb64_1 804 KB conda-forge
libpng-1.6.39 | h19919ed_0 336 KB conda-forge
libtiff-4.6.0 | h6e2ebb7_2 769 KB conda-forge
libwebp-base-1.3.2 | hcfcfb64_0 263 KB conda-forge
libxcb-1.15 | hcd874cb_0 947 KB conda-forge
m2w64-gcc-libgfortran-5.3.0| 6 342 KB conda-forge
m2w64-gcc-libs-5.3.0 | 7 520 KB conda-forge
m2w64-gcc-libs-core-5.3.0 | 7 214 KB conda-forge
m2w64-gmp-6.1.0 | 2 726 KB conda-forge
m2w64-libwinpthread-git-5.0.0.4634.697f757| 2 31 KB conda-forge
matplotlib-base-3.8.1 | py39hf19769e_0 6.3 MB conda-forge
msys2-conda-epoch-20160418 | 1 3 KB conda-forge
munkres-1.1.4 | pyh9f0ad1d_0 12 KB conda-forge
openjpeg-2.5.0 | h3d672ee_3 231 KB conda-forge
packaging-23.2 | pyhd8ed1ab_0 48 KB conda-forge
pandas-2.1.3 | py39h32e6231_0 10.7 MB conda-forge
pcre2-10.40 | h17e33f8_0 1.9 MB conda-forge
pillow-10.1.0 | py39h368b509_0 44.2 MB conda-forge
pixman-0.42.2 | h63175ca_0 445 KB conda-forge
pthread-stubs-0.4 | hcd874cb_1001 6 KB conda-forge
pycairo-1.25.1 | py39h82915f6_0 101 KB conda-forge
pyparsing-3.1.1 | pyhd8ed1ab_0 87 KB conda-forge
python-dateutil-2.8.2 | pyhd8ed1ab_0 240 KB conda-forge
python-tzdata-2023.3 | pyhd8ed1ab_0 140 KB conda-forge
pytz-2023.3.post1 | pyhd8ed1ab_0 183 KB conda-forge
rdkit-2023.09.2 | py39h4e49fef_0 34.6 MB conda-forge
reportlab-4.0.7 | py39ha55989b_0 2.2 MB conda-forge
rlpycairo-0.2.0 | pyhd8ed1ab_0 15 KB conda-forge
six-1.16.0 | pyh6c4a22f_0 14 KB conda-forge
sqlalchemy-2.0.23 | py39ha55989b_0 2.6 MB conda-forge
typing-extensions-4.8.0 | hd8ed1ab_0 10 KB conda-forge
typing_extensions-4.8.0 | pyha770c72_0 34 KB conda-forge
unicodedata2-15.1.0 | py39ha55989b_0 365 KB conda-forge
xorg-libxau-1.0.11 | hcd874cb_0 50 KB conda-forge
xorg-libxdmcp-1.1.3 | hcd874cb_0 66 KB conda-forge
zipp-3.17.0 | pyhd8ed1ab_0 19 KB conda-forge
zlib-1.2.13 | hcfcfb64_5 105 KB conda-forge
zstd-1.5.5 | h12be248_0 335 KB conda-forge
------------------------------------------------------------
Total: 141.8 MB
The following NEW packages will be INSTALLED:
brotli conda-forge/win-64::brotli-1.1.0-hcfcfb64_1
brotli-bin conda-forge/win-64::brotli-bin-1.1.0-hcfcfb64_1
cairo conda-forge/win-64::cairo-1.18.0-h1fef639_0
certifi conda-forge/noarch::certifi-2023.7.22-pyhd8ed1ab_0
contourpy conda-forge/win-64::contourpy-1.2.0-py39h1f6ef14_0
cycler conda-forge/noarch::cycler-0.12.1-pyhd8ed1ab_0
expat conda-forge/win-64::expat-2.5.0-h63175ca_1
font-ttf-dejavu-s~ conda-forge/noarch::font-ttf-dejavu-sans-mono-2.37-hab24e00_0
font-ttf-inconsol~ conda-forge/noarch::font-ttf-inconsolata-3.000-h77eed37_0
font-ttf-source-c~ conda-forge/noarch::font-ttf-source-code-pro-2.038-h77eed37_0
font-ttf-ubuntu conda-forge/noarch::font-ttf-ubuntu-0.83-hab24e00_0
fontconfig conda-forge/win-64::fontconfig-2.14.2-hbde0cde_0
fonts-conda-ecosy~ conda-forge/noarch::fonts-conda-ecosystem-1-0
fonts-conda-forge conda-forge/noarch::fonts-conda-forge-1-0
fonttools conda-forge/win-64::fonttools-4.44.0-py39ha55989b_0
freetype conda-forge/win-64::freetype-2.12.1-hdaf720e_2
freetype-py conda-forge/noarch::freetype-py-2.3.0-pyhd8ed1ab_0
gettext conda-forge/win-64::gettext-0.21.1-h5728263_0
greenlet conda-forge/win-64::greenlet-3.0.1-py39h99910a6_0
icu conda-forge/win-64::icu-73.2-h63175ca_0
importlib-resourc~ conda-forge/noarch::importlib-resources-6.1.1-pyhd8ed1ab_0
importlib_resourc~ conda-forge/noarch::importlib_resources-6.1.1-pyhd8ed1ab_0
kiwisolver conda-forge/win-64::kiwisolver-1.4.5-py39h1f6ef14_1
lcms2 conda-forge/win-64::lcms2-2.15-h67d730c_3
lerc conda-forge/win-64::lerc-4.0.0-h63175ca_0
libboost conda-forge/win-64::libboost-1.82.0-h65993cd_6
libboost-python conda-forge/win-64::libboost-python-1.82.0-py39h5c3ab46_6
libbrotlicommon conda-forge/win-64::libbrotlicommon-1.1.0-hcfcfb64_1
libbrotlidec conda-forge/win-64::libbrotlidec-1.1.0-hcfcfb64_1
libbrotlienc conda-forge/win-64::libbrotlienc-1.1.0-hcfcfb64_1
libdeflate conda-forge/win-64::libdeflate-1.19-hcfcfb64_0
libexpat conda-forge/win-64::libexpat-2.5.0-h63175ca_1
libglib conda-forge/win-64::libglib-2.78.1-he8f3873_0
libjpeg-turbo conda-forge/win-64::libjpeg-turbo-3.0.0-hcfcfb64_1
libpng conda-forge/win-64::libpng-1.6.39-h19919ed_0
libtiff conda-forge/win-64::libtiff-4.6.0-h6e2ebb7_2
libwebp-base conda-forge/win-64::libwebp-base-1.3.2-hcfcfb64_0
libxcb conda-forge/win-64::libxcb-1.15-hcd874cb_0
m2w64-gcc-libgfor~ conda-forge/win-64::m2w64-gcc-libgfortran-5.3.0-6
m2w64-gcc-libs conda-forge/win-64::m2w64-gcc-libs-5.3.0-7
m2w64-gcc-libs-co~ conda-forge/win-64::m2w64-gcc-libs-core-5.3.0-7
m2w64-gmp conda-forge/win-64::m2w64-gmp-6.1.0-2
m2w64-libwinpthre~ conda-forge/win-64::m2w64-libwinpthread-git-5.0.0.4634.697f757-2
matplotlib-base conda-forge/win-64::matplotlib-base-3.8.1-py39hf19769e_0
msys2-conda-epoch conda-forge/win-64::msys2-conda-epoch-20160418-1
munkres conda-forge/noarch::munkres-1.1.4-pyh9f0ad1d_0
openjpeg conda-forge/win-64::openjpeg-2.5.0-h3d672ee_3
packaging conda-forge/noarch::packaging-23.2-pyhd8ed1ab_0
pandas conda-forge/win-64::pandas-2.1.3-py39h32e6231_0
pcre2 conda-forge/win-64::pcre2-10.40-h17e33f8_0
pillow conda-forge/win-64::pillow-10.1.0-py39h368b509_0
pixman conda-forge/win-64::pixman-0.42.2-h63175ca_0
pthread-stubs conda-forge/win-64::pthread-stubs-0.4-hcd874cb_1001
pycairo conda-forge/win-64::pycairo-1.25.1-py39h82915f6_0
pyparsing conda-forge/noarch::pyparsing-3.1.1-pyhd8ed1ab_0
python-dateutil conda-forge/noarch::python-dateutil-2.8.2-pyhd8ed1ab_0
python-tzdata conda-forge/noarch::python-tzdata-2023.3-pyhd8ed1ab_0
pytz conda-forge/noarch::pytz-2023.3.post1-pyhd8ed1ab_0
rdkit conda-forge/win-64::rdkit-2023.09.2-py39h4e49fef_0
reportlab conda-forge/win-64::reportlab-4.0.7-py39ha55989b_0
rlpycairo conda-forge/noarch::rlpycairo-0.2.0-pyhd8ed1ab_0
six conda-forge/noarch::six-1.16.0-pyh6c4a22f_0
sqlalchemy conda-forge/win-64::sqlalchemy-2.0.23-py39ha55989b_0
typing-extensions conda-forge/noarch::typing-extensions-4.8.0-hd8ed1ab_0
typing_extensions conda-forge/noarch::typing_extensions-4.8.0-pyha770c72_0
unicodedata2 conda-forge/win-64::unicodedata2-15.1.0-py39ha55989b_0
xorg-libxau conda-forge/win-64::xorg-libxau-1.0.11-hcd874cb_0
xorg-libxdmcp conda-forge/win-64::xorg-libxdmcp-1.1.3-hcd874cb_0
zipp conda-forge/noarch::zipp-3.17.0-pyhd8ed1ab_0
zlib conda-forge/win-64::zlib-1.2.13-hcfcfb64_5
zstd conda-forge/win-64::zstd-1.5.5-h12be248_0
Downloading and Extracting Packages: ...working... done
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done