<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div>Hello,</div><div><br></div><div>Can someone tell me about removing heteroatoms from PDB?</div><div><br></div><div>Here is the code for removing the heteroatoms I took from the link - <a href="http://pelican.rsvs.ulaval.ca/mediawiki/index.php/Manipulating_PDB_files_using_BioPython">http://pelican.rsvs.ulaval.ca/mediawiki/index.php/Manipulating_PDB_files_using_BioPython</a> but it did not work. I have tested with 1C4R.pdb. It removes some water but some still remain in PDB.</div><div><pre style="font-family: monospace, Courier; padding: 1em; border: 1px dashed rgb(47, 111, 171); background-color: rgb(249, 249, 249); line-height: 1.1em; font-size: 13px;">for model in structure:
for chain in model:
for residue in chain:
id = residue.id
if id[0] != ' ':
chain.detach_child(id)
if len(chain) == 0:
model.detach_child(chain.id)</pre></div><div><br></div><div>Regards,</div><div><br></div><div>Rojan </div></body></html>