LoginSignup
3
2

More than 3 years have passed since last update.

ColaboratoryでRDKit (2021.2.26版)

Posted at

Google ColaboratoryでRDKitを使うときのインストール方法。
数多の記事があるが、更新されてなくて動かなくなっていることも多いので、現時点版を書きます。

!wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
!bash Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local
!conda install python=3.6 --yes
!conda install -q -y -c rdkit python=3.6 rdkit
import sys
sys.path.append('/usr/local/lib/python3.6/site-packages/')

これでいけます。

いけたかどうかを確認。

from rdkit import Chem
from rdkit.Chem import AllChem, Descriptors
from rdkit.Chem.Draw import IPythonConsole
from IPython.display import display
from IPython.display import Image
m = Chem.MolFromSmiles("N#Cc1cccc(CN2C(=O)C(=O)c3cccc(Br)c32)c1")
display(m)

image.png

無事Colabで化合物が表示されていれば成功です。よいRDKitライフを。

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2