[Biopython] Bio.PDB: removing disordred atoms

Ramon Crehuet rcsqtc at iqac.csic.es
Tue May 19 08:55:14 UTC 2009


Dear all,
I'd like to save a pdb without the positions of alternative atoms, i.e,
for disordered atoms keep only atom.altloc='A'.
I though of something like:

all_atoms=[]
for chain in structure[0]:
    for residue in chain.child_list:
        all_atoms=all_atoms+residue.get_unpacked_list()

for atom in all_atoms:
    if atom.altloc=='B': del atom

io=Bio.PDB.PDBIO()
io.set_structure(structure)
io.save('pdb_out_filename')

But that doesn't works. Disordred atoms are still there  :-(
Thanks in advance,
Ramon



More information about the Biopython mailing list