madscatt / zazzie

development branch
GNU General Public License v3.0
2 stars 3 forks source link

PDBScan failure: "NoteType" object has no attribute pdbname: Case 4 #96

Open madscatt opened 6 years ago

madscatt commented 6 years ago

39 PDB files failed with this "case 4" message:

File "/share/apps/local/anacondaz/lib/python2.7/site-packages/sassie/build/pdbscan/pdbscan/header_reader.py", line 107, in init
 'Unable to parse PDB header: {0:s}'.format(sasmol.pdbname))

PDB file 732.pdb is an example of this.

These seems to be a "catch-all" exception and more information is needed to track this down. Comment out the exception to find the true error.

madscatt commented 6 years ago

File 732.pdb has a REMARK 300 line of

BIOMOLECULE:

where as most PDB files have

BIOMOLECULE: 1, 2

So header_reader is unable to loop over / assign the number of biomolecules present. Whereas the REMARK 350 comment for the same 732.pdb file has:

BIOMOLECULE: 1

So we could attempt to grab the 300 record and if empty assign BIOMOLECULE to "1" and then test it in the REMARK 350 reader?

madscatt commented 6 years ago

I put the bit of code that expects an integer number of chains to be listed in a "try/except" block so that if there aren't any integer(s) in the REMARK 300 line that it appends a single chain to the list of biomol_300 chains. Note that a WARNING message is returned so that the user can deconstruct this issue.

This brings up the fact that we should audit the workflow so that these warning messages are passed up in a uniform manner to the GUI etc.

            if remark['text'].startswith('BIOMOLECULE:'):
                try:
                    for biomol_no in remark['text'][13:].split(','):
                        biomol_300.append(int(biomol_no))
                except:
                        logger.warning('Did not find the number of chains in REMARK 300')
                        logger.warning('Set the number of chains to 1: please confirm this case')
                        biomol_300.append(1)