rdkit mol 属性操作

源码

https://github.com/rdkit/rdkit/blob/master/rdkit/Chem/PropertyMol.py

get set has 都有,基本也就可以向mol对象添加新属性了,比如图谱之类

 

>>> pm = PropertyMol(m)
>>> pm.GetProp('_Name')
'benzene.mol'
>>> pm.SetProp('MyProp','foo')
>>> pm.HasProp('MyProp')




>>> pm2 = pickle.loads(pickle.dumps(pm)) >>> Chem.MolToSmiles(pm2) 'c1ccccc1' >>> pm2.GetProp('_Name') 'benzene.mol' >>> pm2.HasProp('MyProp') 1 >>> pm2.GetProp('MyProp') 'foo' >>> pm2.HasProp('MissingProp') 0

 

posted @ 2020-09-18 22:58  永远的幻想  阅读(717)  评论(0编辑  收藏  举报