24小时热门版块排行榜    

查看: 915  |  回复: 2
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

zyj8119

木虫 (著名写手)

[交流] 【原创】MAPS中计算自由体积的python程序 已有2人参与

CODE:
#!/usr/bin/python
###########################################################################
#              calculateVolumeQt.py  -  description
#              ------------------------------------
#   begin                : Fri Dec 15 16:11:04 CET 2006
#   copyright            : (C) 2006 by Scienomics
#   email                : Joerg-Ruediger.Hill@scienomics.com
###########################################################################
#
###########################################################################
#                                                                         #
#   This program and all subroutines,  data, and  files used by it are    #
#   protected by copyright and hence may not be used, copied, modified    #
#   transmitted, inspected, or executed by any means including the use    #
#   of electronic data processing equipment,  xerography, or any other    #
#   methods  without the express  written permission  of the copyright    #
#   holder.                                                               #
#                                                                         #
#   Copyright (C) 2006 Scienomics S. A.                                   #
#                                                                         #
###########################################################################
#
# $Id: calculateVolumeQt.py,v 1.4 2010/03/29 15:15:56 jrh Exp $
# $Log: calculateVolumeQt.py,v $
# Revision 1.4  2010/03/29 15:15:56  jrh
# Moved to new way of retrieving plugin objects
#
# Revision 1.3  2008/01/16 12:42:53  jrh
# Moved to Qt4
#
# Revision 1.2  2006/12/20 13:08:54  jrh
# Added error checking
#
# Revision 1.1  2006/12/15 16:05:32  jrh
# Created
#
#

# A simple demo script showing how to calculate a property for a
# molecule from information already available in MAPS and using
# Qt for output.

from math import pi
import Maps
import MapsChemistryDataModel
from PyQt4.QtGui import QMessageBox

app=Maps.MapsApp.getContainer()
cdm=MapsChemistryDataModel.ChemistryDataModel.get()
projects=cdm.getProjects()
if len(projects) == 0:
  QMessageBox.information(app, "Note", "Please load or sketch a molecule before running this script.")
else:  
  molecules=projects[0].getMolecules()
  if len(molecules) == 0:
    QMessageBox.information(app, "Note", "Please load or sketch a molecule before running this script.")
  else:
    volume=0.0
    for atom in molecules[0].atoms:
      r=atom.element.vanDerWaalsRadius
      volume=volume+r*r*r
    QMessageBox.information(app, "Note", "The volume is " + str(4.0*pi*volume/3.0) + " Ang^3.")

回复此楼

» 本帖已获得的红花(最新10朵)

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

好好学习,天天向上。
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

qphll

金虫 (正式写手)

送鲜花一朵
好东西不少, 继续...
Life, Love, Laugh.
3楼2012-03-23 10:14:21
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 3 个回答
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 为什么网上很多人说本周 12号出结果 +4 瞬息宇宙 2026-08-10 4/200 2026-08-11 02:02 by 旁观2020
[基金申请] FileCode能看出啥? +7 要乐观耀哥 2026-08-10 15/750 2026-08-10 19:29 by 要乐观耀哥
[基金申请] filecode +8 documentary 2026-08-10 8/400 2026-08-10 19:20 by loufangrui
[基金申请] 确定了,国自然21号放榜 +6 布布和一二 2026-08-10 7/350 2026-08-10 19:15 by 2000zf36392
[基金申请] 综述论文作为代表作会不会影响评审专家的印象分? +10 yufeiwaner 2026-08-09 11/550 2026-08-10 18:47 by yufeiwaner
[基金申请] 静等基金结果 +5 gjjjzhong 2026-08-10 16/800 2026-08-10 17:19 by Tide man
[基金申请] 国自然结果 +4 Vierhys 2026-08-10 8/400 2026-08-10 15:06 by Vierhys
[基金申请] 据悉今年马上要出结果了 +7 瞬息宇宙 2026-08-10 8/400 2026-08-10 12:42 by Vivilian
[基金申请] 2026国自然放榜时间 +9 布布和一二 2026-08-08 9/450 2026-08-10 11:22 by xxxx2020
[基金申请] 这样的filecode谁见过 +11 布布和一二 2026-08-08 22/1100 2026-08-10 11:10 by wmfsnow
[基金申请] 面上项目filecode邪修 +5 西山十月 2026-08-09 7/350 2026-08-10 07:32 by 仁砚薪传
[基金申请] filecode与中标关系的预测 +5 布布和一二 2026-08-07 5/250 2026-08-09 16:15 by 袁向阳007
[基金申请] 关于filecode,很负责任的告诉大家 +6 爱看书的可乐 2026-08-08 7/350 2026-08-08 22:13 by a_niu
[基金申请] 国基金的申报应该改成非等额制,评价高的钱多评价低的钱少,但是增加资助率 +7 a089 2026-08-07 7/350 2026-08-08 18:05 by gltch
[基金申请] 固定端突然变了,今天 +6 archvillain 2026-08-06 10/500 2026-08-07 16:03 by 医学老男孩
[基金申请] 听说今天filecode变了 +24 布布和一二 2026-08-06 47/2350 2026-08-07 16:02 by zhiyanjiang
[基金申请] filecode变化情况 +6 布布和一二 2026-08-07 22/1100 2026-08-07 14:45 by 且听虎啸
[基金申请] 大家散了吧,后缀研究没有意义,别浪费时间了,过好目前的每一天,不要焦虑 +5 Tide man 2026-08-06 7/350 2026-08-07 13:11 by 医学老男孩
[基金申请] 求各位大神看下 100+6 hpkpkpkp 2026-08-05 33/1650 2026-08-06 14:49 by zhiyanjiang
[基金申请] 好消息?这个有何含义??? +8 Tide man 2026-08-05 10/500 2026-08-05 16:14 by xmuxiaoyu
信息提示
请填处理意见