1 Nov 2009 20:50
Questions on StructureBuilder, MMCIFParser, and MMCIFlex
Paul B <tallpaulinjax <at> yahoo.com>
2009-11-01 19:50:31 GMT
2009-11-01 19:50:31 GMT
Hi, I'm a computer science guy trying to figure out some chemistry logic to support my thesis, so bear with me!(Continue reading)To sum it up, I'm not sure MMCIFParser is handling ATOM and MODEL records correctly because of this code in MMCIFParser: if fieldname=="HETATM": hetatm_flag="H" else: hetatm_flag=" " This causes ATOM (and potentially MODEL) records to die as seen in the exception below (I think!) My questions are: 1. Am I correct the correct code is insufficient? 2. What additional logic beyond just recognizing whether it's a HETATM, ATOM or MODEL record needs to be added? Thanks! Paul Background: I understand MMCIFlex.py et cetera is commented out in the Windows setup.py package due to difficulties compiling it. So I re-wrote MMCIFlex strictly in Python to emulate what I THINK the original MMCIFlex did. My version processes a .cif file one line at a time (readline()) then passes tokens back to MMCIF2Dict at each call to get_token(). That seems to work fine for unit testing of my MMCIFlex and MMCIFDict which I had to slightly re-write (to ensure it handled how I passed SEMICOLONS line back etc). However when I try and use this with MMCIFParser against the 2beg .cif file which has no HETATM records and, as I understand the definition, no disordered atoms I get:
To sum it up, I'm not sure MMCIFParser is handling ATOM and MODEL records correctly because of this code
in MMCIFParser:
if fieldname=="HETATM":
hetatm_flag="H"
else:
hetatm_flag=" "
This causes ATOM (and potentially MODEL) records to die as seen in the exception below (I think!)
My questions are:
1. Am I correct the correct code is insufficient?
2. What additional logic beyond just recognizing whether it's a HETATM, ATOM or MODEL record needs to be added?
Thanks!
Paul
Background:
I understand MMCIFlex.py et cetera is commented out in the Windows setup.py package due to difficulties
compiling it. So I re-wrote MMCIFlex strictly in Python to emulate what I THINK the original MMCIFlex did.
My version processes a .cif file one line at a time (readline()) then passes tokens back to MMCIF2Dict at
each call to get_token(). That seems to work fine for unit testing of my MMCIFlex and MMCIFDict which I had
to slightly re-write (to ensure it handled how I passed SEMICOLONS line back etc).
However when I try and use this with MMCIFParser against the 2beg .cif file which has no HETATM records and,
as I understand the definition, no disordered atoms I get:
RSS Feed