[Biopython-dev] [Bug 1772] Bio.PDB's parse_pdb_header never stops parsing if there is no ATOM record

thamelry at binf.ku.dk thamelry at binf.ku.dk
Tue Apr 26 04:40:06 EDT 2005


> It will append HETATM lines to the header. Instead we can use
>          if not re.search("\AATOM",l) and not re.search("\AHETATM",l):

Or even simpler:

record_type=l[0:6]
if record_type=='ATOM  ' or record_type=='HETATM' or record_type=='MODEL ':
    break
else:
    header.append(l)

Note that MODEL can also signal the end of the header.

I'll add it to the CVS.

Cheers,

-Thomas





More information about the Biopython-dev mailing list