python - 从pymol中的笛卡尔坐标绘制彩色球体

标签 python visualization bioinformatics

我在 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/

相关文章:

python - 根据对象属性唯一化对象列表的最快方法

python - 如何使用 Python 的 Bokeh 向日期时间轴添加更多 x 轴刻度和标签?

perl - 使用 perl 在 DNA 序列中查找核苷酸

objective-c - 有助于可视化 iOS 应用程序工作流、算法、调用方法等的东西

bioinformatics - 按 GC 内容分箱序列读取

java - 在 Windows 中设置 Eclipse 以进行 Cytoscape 插件开发

python - 按照 numpy.ndarray 的顺序就地打乱 torch.Tensor

python - pandas,matplotlib,使用数据帧索引作为轴刻度标签

python - pandas 多索引选择与列条件

MySQL Workbench 符号引用