[BioPython] BioPDB problem
Hua Wong
wong at ebgm.jussieu.fr
Fri Jun 18 06:01:23 EDT 2004
I have a PDB file that count 3145 atoms [1...3145], and using BioPDB I try to get all the coordinate.
So I use the example:
parser=PDBParser()
structure=parser.get_structure('0b','0b.pdb')
liste=[]
for model in structure.get_iterator():
for chain in model.get_iterator():
for residue in chain.get_iterator():
for atom in residue.get_iterator():
a=atom.get_coord()
liste.append(a)
To obtain a list of array representing the x y and z
But I can't have all the atoms. The liste[] list is 3144 which seems ok [0...3144]
But when I want to display the 3144th atom I obtain:
>>> len(liste)
3144
>>> liste[3144]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
IndexError: list index out of range
The lastest atoms he accepts to display is 3143th.
Am I doing something wrong?
Thanks.
More information about the BioPython
mailing list