[Biopython] PDBParser-chain breaks

Eric Talevich eric.talevich at gmail.com
Wed May 9 14:31:34 UTC 2012


Oh, there's a caveat to the warnings module -- if a given warning isn't
captured this way the first time, it's never issued again. So, parsing 3BEG
once normally, and again with the setup I gave, won't trigger the warning
again and therefore won't raise an error.

On Wed, May 9, 2012 at 1:39 AM, João Rodrigues <anaryin at gmail.com> wrote:

> For some reason however, I didn't get the discontinuous error .. That's
> why I proposed this alternative.
>
> João [...] Rodrigues
> http://nmr.chem.uu.nl/~joao
>
>
>
> 2012/5/9 Eric Talevich <eric.talevich at gmail.com>
>
>> The warnings module also lets you convert any warning to an error (or
>> ignore it, etc.). Use a regular expression to match the warning message:
>>
>> from Bio import PDB
>> import warnings
>> warnings.filterwarnings('error', message='.*discontinuous at.*')
>> p = PDB.PDBParser()
>> s = p.get_structure("", "3BEG.pdb")
>>
>>
>>
>> On Tue, May 8, 2012 at 3:39 PM, João Rodrigues <anaryin at gmail.com> wrote:
>>
>>> Of course. Since they throw a warning just make sure to count the
>>> warnings,
>>> parse the chain break ones, and if they are more than 0, you have chain
>>> breaks.
>>>
>>> Cheers,
>>>
>>> João [...] Rodrigues
>>> http://nmr.chem.uu.nl/~joao
>>>
>>>
>>>
>>> 2012/5/8 George Devaniranjan <devaniranjan at gmail.com>
>>>
>>> > Hi João,
>>> >
>>> > Is there a way though to find PDB's with chain breaks? using biopython?
>>> >
>>> > Thank you,
>>> > George
>>> >
>>> > On Tue, May 8, 2012 at 3:34 PM, João Rodrigues <anaryin at gmail.com>
>>> wrote:
>>> >
>>> >> Hi George,
>>> >>
>>> >> Chain breaks are pretty "harmless" and usually do not represent a
>>> faulty
>>> >> PDB file. The PERMISSIVE flag is for "features" like missing
>>> b-factors.
>>> >>
>>> >> Cheers,
>>> >>
>>> >> João [...] Rodrigues
>>> >> http://nmr.chem.uu.nl/~joao
>>> >>
>>> >>
>>> >>
>>> >> 2012/5/8 George Devaniranjan <devaniranjan at gmail.com>
>>> >>
>>> >>>  Hi,
>>> >>>
>>> >>> I thought using PERMISSIVE=0 would raise an exception if I pass a PDB
>>> >>> with
>>> >>> chain breaks.
>>> >>> However, nothing like that seems to happen.....
>>> >>>
>>> >>> For instance
>>> >>>
>>> >>> P=PDBParser(PERMISSIVE=0)
>>> >>> structure=P.get_structure('test', '7ODC.pdb')
>>> >>>
>>> >>>
>>> >>> 7ODC has 3 chain breaks but it does not raise an exception.
>>> >>>
>>> >>> Thank you
>>> >>> George
>>> >>> _______________________________________________
>>> >>> Biopython mailing list  -  Biopython at lists.open-bio.org
>>> >>> http://lists.open-bio.org/mailman/listinfo/biopython
>>> >>>
>>> >>
>>> >>
>>> >
>>>
>>> _______________________________________________
>>> Biopython mailing list  -  Biopython at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/biopython
>>>
>>
>>
>




More information about the Biopython mailing list