2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

pybelがテキトウすぎてやばい話

Posted at

大量のsmilesを処理しなければならなくなり、RDKitやpybelで処理できないsmilesをあらかじめ省く作業をしていた。

RDKitの場合

from rdkit import Chem
mol = Chem.MolFromSmiles("C(=C)(=C)C") #やばすぎ構造

[14:00:21] Explicit valence for atom # 0 C, 5, is greater than permittedってでてきた。うんうん。そうだね。

Pybel (OpenBabel) の場合

import pybel
mol = pybel.readstring("smi", "C(=C)(=C)C")
print mol.write("can")

C[C](=C)=Cと出力できてしまった。まじですかこれ。

ということで、構造が正しそうかどうかはRDKitを使い、とりあえずなんでもcanonical smiles出したければpybelを使いましょう。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?