Entering edit mode
7.6 years ago
souparnoa91
▴
20
Hi,
I have multiple models in a pdb file and I want to specifically retrieve the atomic coordinates of a model. I wrote the following code:
#!/usr/bin/python
from Bio.PDB.PDBParser import PDBParser
parser=PDBParser(PERMISSIVE=1)
structure_id="mode_7"
filename="mode_7.pdb"
structure=parser.get_structure(structure_id, filename)
model=structure[0]
residues=model.get_residues()
atoms=residues.get_atoms()
coord=atoms.get_coord()
And it yields the following error:
Traceback (most recent call last):
File "./average.py", line 12, in <module>
coord=model.get_coord()
AttributeError: 'Model' object has no attribute 'get_coord'
Can anyone please help???
Update:
I solved this problem using the following code:
#!/usr/bin/python
from Bio.PDB.PDBParser import PDBParser
parser=PDBParser(PERMISSIVE=1)
structure_id="mode_7"
filename="mode_7.pdb"
structure=parser.get_structure(structure_id, filename)
model=structure[0]
for chain in model.get_list():
for residue in chain.get_list():
ca=residue["CA"]
print(ca.get_coord())