[BioPython] PDBConstructionException message

Gad Abraham g.abraham at ms.unimelb.edu.au
Sat Jul 8 09:12:34 UTC 2006


Hi,

I apologise in advance if this question is trivial, but I'm a Python and 
BioPython novice, and the mailing list search facility isn't working :)

I'm using Bio.PDB to parse the PDB file 1LUC, and write output to stdout 
(running python inside a script, not shown here).



PDBParser seems to be throwing an exception, and its message goes to 
stdout, even though I'm trying to catch it:

Python 2.4.3 (#2, Apr 27 2006, 14:43:58)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> from Bio.PDB import *
 >>> parser = PDBParser()
 >>> try:
...     s = parser.get_structure('1LUC', 'pdb1luc')
... except:
...     print "Caught exception"
...
PDBConstructionException: Atom O defined twice in residue <Residue GLN 
het=  resseq=355 icode= > at line 2930.
Exception ignored.
Some atoms or residues will be missing in the data structure.
 >>>

(biopython 1.41)



How can I either catch this exception or prevent the message from being 
printed to stdout?


Thanks,
Gad

-- 
Gad Abraham
Department of Mathematics and Statistics
University of Melbourne
Victoria 3010, Australia
email: g.abraham at ms.unimelb.edu.au
web: http://www.ms.unimelb.edu.au/~gabraham



More information about the Biopython mailing list