[Biopython] Remove heteroatoms

Rojan Shrestha rojan at riken.jp
Fri Sep 5 04:46:01 UTC 2014


Hello,

Can someone tell me about removing heteroatoms from PDB?

Here is the code for removing the heteroatoms I took from the link -
http://pelican.rsvs.ulaval.ca/mediawiki/index.php/Manipulating_PDB_files_usi
ng_BioPython but it did not work. I have tested with 1C4R.pdb. It removes
some water but some still remain in PDB.
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)

Regards,

Rojan 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20140905/8e94dea5/attachment.html>


More information about the Biopython mailing list