将杂原子添加到pdb文件中

问题描述 投票:0回答:1

我正在使用Biopython对pdb文件执行各种操作。随后,我想向Biopython生成的Biopython结构对象中添加一些新原子。有没有一种好的/推荐的方法可以在Python中做到这一点。似乎Biopython仅提供了写出pdb文件中现有元素的选项,而不提供创建新元素的选项。

bioinformatics biopython pymol
1个回答
0
投票

您可以看一下Python包Biotitehttps://www.biotite-python.org/):在以下示例代码中,下载,读取PDB结构,然后添加原子:

import biotite.database.rcsb as rcsb
import biotite.structure as struc
import biotite.structure.io as strucio


# Download lysozyme structure for example
file_name = rcsb.fetch("1aki", "pdb", target_path=".")

# Read the file into Biotite's structure object (atom array)
atom_array = strucio.load_structure(file_name)

# Add an HETATM
atom = struc.Atom(
    coord = [1.0, 2.0, 3.0],
    chain_id = "A",
    # The residue ID is the last ID in the file +1
    res_id = atom_array.res_id[-1] + 1,
    res_name = "ABC",
    hetero = True,
    atom_name = "CA",
    element = "C"
)
atom_array += struc.array([atom])

# Save edited structure
strucio.save_structure("1aki_edited.pdb", atom_array)

1aki_edited.pdb的最后几行:

...
HETATM 1075 O    HOH A 203      12.580  21.214   5.006  1.00 0.000          O   
HETATM 1076 O    HOH A 204      19.687  23.750  -4.851  1.00 0.000          O   
HETATM 1077 O    HOH A 205      27.098  35.956 -12.358  1.00 0.000          O   
HETATM 1078 O    HOH A 206      37.255   9.634  10.002  1.00 0.000          O   
HETATM 1079 O    HOH A 207      43.755  23.843   8.038  1.00 0.000          O   
HETATM 1080 CA   ABC A 208       1.000   2.000   3.000  1.00 0.000          C 
© www.soinside.com 2019 - 2024. All rights reserved.