如何使用for循环获得两个原子之间的距离?
我有一个 PDB 结构。该结构有13个残基。我必须使用 for 循环找到两个原子(仅 C、O、N、S)之间的距离。首先,我必须找到第一个和第二个残基之间的距离。在第一个和第三个残基之后,直到第一个和第 13 个残基,依此类推。如何使用 for 循环编写 python 脚本?
I have one PDB structure. This structure has 13 residues. I have to find the distance between two atoms(only C,O,N,S) using for loop. First I have to find the distance between first and second residue. after that first and third residue.up to first and 13 th residue and so on. How can I write the python script using for loop?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 xyz 坐标,您可以计算每个原子之间的距离。首先,您必须解析 PDB 文件并存储坐标。然后只需迭代原子列表(对于 list_of_atoms 中的原子)并计算它们之间的欧几里德距离..
http://en.wikipedia.org/wiki/Euclidean_distance#Three_dimensions
Biopython的Bio.PDB模块也允许这样的计算 容易地。
Using the xyz coordinates you can calculate distances between each atom. First you'll have to parse the PDB file and store the coordinates. Then just iterate over the list of atoms (for atom in list_of_atoms) and calculate the euclidean distance between them..
http://en.wikipedia.org/wiki/Euclidean_distance#Three_dimensions
Biopython's Bio.PDB module also allows such calculation easily.