24小时热门版块排行榜    

查看: 812  |  回复: 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 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考博] 环境领域全国重点实验室招收博士1-2名 +3 QGZDSYS 2026-03-13 3/150 2026-03-18 00:13 by PY-Hzb
[考研] 268求调剂 +3 简单点0 2026-03-17 3/150 2026-03-17 23:15 by wangjihu
[考研] 考研求调剂 +3 橘颂. 2026-03-17 4/200 2026-03-17 21:43 by 有只狸奴
[考研] 341求调剂 +5 捣蛋猪猪 2026-03-11 7/350 2026-03-17 19:09 by 捣蛋猪猪
[硕博家园] 湖北工业大学 生命科学与健康学院-课题组招收2026级食品/生物方向硕士 +3 1喜春8 2026-03-17 5/250 2026-03-17 17:18 by ber川cool子
[考研] 085600材料与化工求调剂 +5 绪幸与子 2026-03-17 5/250 2026-03-17 16:40 by laoshidan
[考研] 0854可跨调剂,一作一项核心论文五项专利,省、国级证书40+数一英一287 +3 小李0854 2026-03-16 3/150 2026-03-17 13:40 by 热情沙漠
[考研] 271求调剂 +12 生如夏花… 2026-03-11 14/700 2026-03-17 10:56 by lovewei0727
[考研] 321求调剂 +5 大米饭! 2026-03-15 5/250 2026-03-16 16:33 by houyaoxu
[考研] 0703一志愿211 285分求调剂 +5 ly3471z 2026-03-13 5/250 2026-03-16 16:16 by 哦哦123
[教师之家] 焦虑 +7 水冰月月野兔 2026-03-13 9/450 2026-03-16 10:00 by Quakerbird
[考研] 070305求调剂 +3 mlpqaz03 2026-03-14 4/200 2026-03-15 11:04 by peike
[考研] 297一志愿上交085600求调剂 +5 指尖八千里 2026-03-14 5/250 2026-03-14 17:26 by a不易
[考研] 材料080500调剂求收留 +3 一颗meteor 2026-03-13 3/150 2026-03-14 10:54 by peike
[考研] 330求调剂 +3 ?酱给调剂跪了 2026-03-13 3/150 2026-03-14 10:13 by JourneyLucky
[考研] 311求调剂 +3 冬十三 2026-03-13 3/150 2026-03-13 20:41 by JourneyLucky
[考研] 一志愿211化学学硕310分求调剂 +8 努力奋斗112 2026-03-12 9/450 2026-03-13 15:41 by JourneyLucky
[考研] 314求调剂 +7 无懈可击的巨人 2026-03-12 7/350 2026-03-13 15:40 by JourneyLucky
[考研] 328化工专硕求调剂 +4 。,。,。,。i 2026-03-12 4/200 2026-03-13 14:44 by JourneyLucky
[考研] 085600材料与化工 309分请求调剂 +7 dtdxzxx 2026-03-12 8/400 2026-03-13 14:43 by jxchenghu
信息提示
请填处理意见