LoginSignup
0
1

More than 5 years have passed since last update.

Pandasデータフレーム上のSMILESから化合物画像表示まで

Last updated at Posted at 2019-03-02

環境

  • Python 3.6
  • Jupyter Notebook
  • RDKit

方法

前提としてdf_allというPandasデータフレームの"smiles"というカラムにSMILESが格納されているものとする。以下の流れで画像表示が可能である。

from IPython.display import SVG
from rdkit.Chem import AllChem, Draw, Descriptors, PandasTools

# SMILESから画像を生成し、df_allの"IMAGE"カラムに入れる
PandasTools.AddMoleculeColumnToFrame(df_all, molCol='IMAGE', smilesCol='smiles')

# IMAGEカラムの画像をRDKitのPandasToolにより描画
PandasTools.FrameToGridImage(df_all[:5], column='IMAGE', molsPerRow=3)

image.png

0
1
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
0
1