24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 820  |  回复: 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的回帖
送鲜花一朵
2楼2012-03-22 16:12:35
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

qphll

金虫 (正式写手)

送鲜花一朵
好东西不少, 继续...
Life, Love, Laugh.
3楼2012-03-23 10:14:21
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 zyj8119 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 0703调剂 +15 拾玖壹 2026-04-04 17/850 2026-04-07 08:23 by xihu1109
[考研] 080500求调剂 +11 黄宇博 2026-04-06 11/550 2026-04-07 07:53 by 0谦谦0
[考研] 求调剂 +4 电气小神童 2026-04-04 6/300 2026-04-07 00:14 by guanxin1001
[考研] 070300化学学硕311分求调剂 +12 梁富贵险中求 2026-04-04 12/600 2026-04-06 22:54 by chenzhimin
[考研] 327求调剂 +3 Xxjc1107. 2026-04-06 3/150 2026-04-06 22:34 by qlm5820
[考研] 0703调剂,一志愿天津大学319分 +16 haaaabcd 2026-04-05 17/850 2026-04-06 19:25 by 尚水阁主
[考研] 材料与化工363求推荐 +11 zh096 2026-04-04 11/550 2026-04-06 19:14 by guanxin1001
[考研] 332求调剂 +17 小小孟... 2026-04-05 18/900 2026-04-06 09:51 by 蓝云思雨
[考研] 材料334求调剂 +19 Eecho# 2026-04-03 19/950 2026-04-06 08:37 by 小小树2024
[考研] 男生,一志愿沪9生物学071000,初试308求调剂 +3 刘墨墨 2026-04-04 3/150 2026-04-05 08:26 by barlinike
[考研] 278求调剂 +14 范婷娜 2026-04-04 15/750 2026-04-04 22:15 by lqwchd
[考研] 315求调剂 +13 小羊小羊_ 2026-04-02 14/700 2026-04-04 20:30 by 蓝云思雨
[考研] +5 雾与海 2026-04-02 6/300 2026-04-04 19:53 by 蓝云思雨
[考研] 283分材料与化工求调剂 +29 罗KAKA 2026-04-02 29/1450 2026-04-03 23:56 by userper
[考研] 295求调剂 +3 尚偌呀 2026-04-03 4/200 2026-04-03 21:23 by zhq0425
[考研] 兽医调剂 +3 wh119216 2026-04-02 3/150 2026-04-03 19:34 by zrongyan
[基金申请] 请问共同通讯和共同一作的认可度问题 10+4 psa1234 2026-04-01 10/500 2026-04-03 11:08 by Kittylucky
[考研] 0856材料与化工调剂,339 +14 10213207 2026-03-31 14/700 2026-04-02 21:01 by 1104338198
[考研] 环境工程297分求调剂一志愿杭高院 +15 GENJIOW 2026-03-31 16/800 2026-04-02 17:56 by cyh—315
[考研] 321求调剂 一志愿 浙江工业大学生物医药 +5 嘿嘿HC 2026-04-01 6/300 2026-04-02 15:23 by sophie2180
信息提示
请填处理意见