Help us understand the problem. What is going on with this article?

mordredで1分子1記述子の計算を行う

背景

フリーの化合物の記述子計算ソフトであるmordredにおいて、1分子毎、1記述子毎に記述子計算を行いたいが、github上に用意されているマニュアルにはあまり詳しい情報がなかった

環境

  • Windows 10
  • Anaconda
  • Python 3.X
  • mordred 1.1.1

やりかた

まずは、calc = Calculator(descriptors, ignore_3D=False)をやると、用意されているすべての記述子オブジェクトがcalc.descriptorsで取得できる。
ソースをハックすればわかるのだが、記述子オブジェクトの__str__()メソッドで記述子の名前が取得できるのでそれをキーとし、値を記述子オブジェクトとするdictionaryを作成する。

from rdkit import Chem
from mordred import Calculator, descriptors

descs = {}
calc = Calculator(descriptors, ignore_3D=False)
for i, desc in enumerate(calc.descriptors):
   descs[desc.__str__()] = desc

後は、計算したい記述の名前を指定して記述子オブジェクトを取得し、計算したいmolオブジェクトを指定するだけ。

mol = Chem.MolFromSmiles("CCCC")
result = descs["GATS6i"](mol)

ここまで扱えるとかなりシステムに自由自在に組み込めそう。

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away