[Biopython] PDB parser: suppress warnings

Frederico Moraes Ferreira ferreirafm at usp.br
Tue Jul 22 18:14:12 UTC 2014


Hi Biopythonees,
Has anybody happen to know how to suppress warnings when reading PDBs 
with hydrogenated waters?

from Bio.PDB.PDBParser import PDBParser
struct = PDBParser().get_structure('tmp', pdbf)

My PDBs came from MD so as all water molecules have hydrogens causing 
thousands of warnings like:
...
/usr/lib64/python2.7/site-packages/Bio/PDB/PDBParser.py:284: 
PDBConstructionWarning: PDBConstructionException: Atom 2H defined twice 
in residue <Residue HOH het=W resseq=2640 icode= > at line 71037.
Exception ignored.
Some atoms or residues may be missing in the data structure.
   % message, PDBConstructionWarning)
...

Thanks in advance.
Fred


-- 
Dr. Frederico Moraes Ferreira
University of Sao Paulo
Heart Institute, School of Medicine
Laboratoy of Immunology
Av. Dr. Enéas de Carvalho Aguiar, 44
05403-900     Sao Paulo - SP
Brasil



More information about the Biopython mailing list