[Biopython] PDBParser Class --> Output

Willis, Jordan R jordan.r.willis at Vanderbilt.Edu
Sun Feb 13 17:39:22 UTC 2011


1.56,

As it turns out, our molecular modeling suite does not output an element field. I went into Bio/PDB/Atom.py and commented out:

 if element is None :
            import warnings
            from PDBExceptions import PDBConstructionWarning
            warnings.warn("Atom object (name=%s) without element" % name,
                          PDBConstructionWarning)
            element = "?"
            print name, "--> ?"
        elif len(element)>2 or element != element.upper() or element != element.strip():

But it is still taking the time on checking the error even though its not printing it. I wonder if you can just turn it off the error checking completely. 

Jordan


On Feb 13, 2011, at 5:40 AM, Peter Cock wrote:

> On Sun, Feb 13, 2011 at 1:52 AM, Willis, Jordan R
> <jordan.r.willis at vanderbilt.edu> wrote:
>> Hello,
>> 
>> I am loving the PDB tools that are available with Biopython. I am
>> getting a weird output I can't figure out when I parse a PDB. My
>> code looks something like this.
>> 
>> .....Thousands of lines
>> G --> ?
>> CD --> ?
>> CE --> ?
>> .......More lines
>> 
>> I wouldn't mind so much except i have to parse thousands of pdbs and
>> the unnecessary printing adds to the computation time.
>> Any ideas how to turn this off?
> 
> That looks like it is failing to assign the element to those atoms. Do
> your PDB files have the element column filled in? Which version of
> Biopython do you have as there have been a few changes to this
> bit of code recently... could you try the latest code from github?
> http://www.biopython.org/wiki/SourceCode
> 
> Peter





More information about the Biopython mailing list