在 Python 脚本中嵌入程序
我创建了一个程序,允许用户输入有关 DNA 扭曲、转动和位置的信息以及其他信息。输出是一个 PDB 文件,但是,我想在程序内的 .pdb 查看器中显示 .pdb 文件,但似乎不知道如何操作。所需的应用程序是 Chimera (http://www.cgl.ucsf.edu/chimera/) 或 swiss (http://spdbv.vital-it.ch/)。
I created a program that allows the user to enter info about DNA twist,turn, and location, and other info. And the output is a PDB file, however, I want to show the .pdb file in a .pdb viewer within the program and cannot seem to know how. The desired applications are Chimera(http://www.cgl.ucsf.edu/chimera/), or swiss(http://spdbv.vital-it.ch/).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您希望集成的紧密程度,一个不错的开始可能就像使用 python 从外部调用 Chimera 或 Swiss 一样简单:
这将导致 Chimera 窗口弹出,然后加载并渲染您的 pdb,但保持您的应用程序处于活动状态并在后台运行(如果您希望程序等待外部程序关闭,请改用 subprocess.call。)
(顺便说一句,subprocess 是执行此操作的较新方法。os .system 和os.exec* 是已弃用的方法,但仍会得到类似的结果。)
Depending on how tight you want your integration to be, a decent start could be something as simple as using python to externally invoke Chimera or Swiss:
This would cause a Chimera window to pop open then load and render your pdb, but leave your app active and running in the background (if you want your program to wait for the external program to close, use
subprocess.call
instead.)(Btw, subprocess is the newer way to do this.
os.system
andos.exec*
are the deprecated approaches, but would still get similar results.)