24小时热门版块排行榜    

Znn3bq.jpeg
查看: 823  |  回复: 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 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 化工学硕294分,求导师收留 +33 yzyzx 2026-04-12 37/1850 2026-04-17 23:00 by wunaiy88
[考研] 求调剂 +9 小聂爱学习 2026-04-16 11/550 2026-04-17 22:34 by chixmc
[考博] 求博导|生物质基多孔碳/超级电容方向,已有相关成果,寻能源材料/碳材料方向老师 +3 猪猪人Zzz 2026-04-12 3/150 2026-04-17 19:10 by 阳阳阳^_^
[有机交流] 二苯甲酮酸类衍生物 50+3 小白爱主人 2026-04-17 6/300 2026-04-17 18:47 by kf2781974
[考研] 320求调剂 +4 深郊akm 2026-04-17 4/200 2026-04-17 17:32 by 一切OK
[考研] 279求调剂 +13 张番茄不炒蛋 2026-04-11 13/650 2026-04-17 10:38 by cuisz
[考研] 271求调剂 +37 2261744733 2026-04-11 39/1950 2026-04-17 10:11 by 黑科技矿业
[考研] 恳请有学校收留 +8 柯淮然 2026-04-12 8/400 2026-04-17 09:34 by 猪会飞
[考研] 材料相关专业344求调剂双非工科学校或课题组 +23 hualkop 2026-04-12 25/1250 2026-04-16 22:12 by SUSE_CL
[考研] 294求调剂 +14 淡然654321 2026-04-15 14/700 2026-04-16 21:01 by lpl364211
[考研] 一志愿沪9,生物学326求调剂 +9 刘墨墨 2026-04-15 9/450 2026-04-16 17:14 by 崔崔崔cccc
[考研] 求助调剂,跨调 +19 X十甫寸Y 2026-04-11 20/1000 2026-04-15 21:18 by cuisz
[考研] 211本科材料化工求调剂 +19 YHLAH 2026-04-11 23/1150 2026-04-14 22:25 by fenglj492
[考研] 105500药学求调剂 +4 x_skys 2026-04-12 4/200 2026-04-14 13:37 by rndfc
[考研] 考研英一数一338分 +9 长江大学东校区 2026-04-13 10/500 2026-04-14 00:41 by 王珺璞
[考研] 材料考研调剂 +29 云木达达 2026-04-11 31/1550 2026-04-13 13:32 by lyh鲁老师
[考研] +10 李多米lee. 2026-04-12 11/550 2026-04-12 22:58 by yuyin1233
[考研] 331求调剂 +5 王国帅 2026-04-11 5/250 2026-04-11 22:56 by 溪涧流水
[考研] 求调剂,一志愿大连理工大学354分 +5 雨声余生 2026-04-11 6/300 2026-04-11 16:12 by 雨声余生
[考研] 求调剂 +3 胃痉挛累了 2026-04-11 5/250 2026-04-11 14:13 by luhong1990
信息提示
请填处理意见