我在 wiki 中查看如何转换有关珠子、笛卡尔坐标 + 能量的以下信息:
23.4 54.6 12.3 -123.5 54.5 23.1 9.45 -56.7 ......
在 pymol 中绘制,其中每个原子包含一个半径为 R 的球体,以其坐标为中心,颜色呈彩虹渐变。
谢谢
最佳答案
您渲染的内容实际上与分子结构有任何关系吗(即使用 PyMol 的动机是什么)?
如果您正在绘制一些分子结构,我建议只输出一个带有球体坐标的自定义 PDB 文件(您可以使用每个 ATOM 行的 B 因子字段作为在 PyMol 中控制每个原子着色的方法)。
如果您不绘制分子结构,最好使用 PyMol 的 CGO 界面。
来自 PyMol 文档:
CGO spheres are generated by the SPHERE command.
SPHERE, x,y,z,d
where x,y,z are the coordinates of the sphere centre and d is the diameter of the sphere. Note how a COLOR command is used to set the colour of a sphere. As with LINES you only need a COLOR command when the colour of the next sphere to be drawn changes.
一个简单的例子:
from pymol.cgo import *
from pymol import cmd
spherelist = [
COLOR, 0.100, 1.000, 0.000,
SPHERE, 30.304, 30.407, 30.531,0.30,
COLOR, 1.000, 0.000, 0.000,
SPHERE, 30.250, 30.250, 30.250,0.20,
]
cmd.load_cgo(spherelist, 'segment', 1)
关于python - 从pymol中的笛卡尔坐标绘制彩色球体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2060582/