Open aozalevsky opened 1 month ago
I have checked in a tentative fix for this bug. Give it a try and let me know if you still have an issue.
@vbchen, the fix seems to work. i've tested it on several entries. thanks!
However, in the process, I encountered another JSON export issue, now with bonds:
https://www.wwpdb.org/pdb?id=9a78 (this is a PDB-Dev entry, but since it's an atomic model with fully populated _atom_site
table, Molprobity works just fine with such files)
If there are no outliers, the code throws an exception:
>>> data.restraints.bonds.n_total_by_model
{'': 9949}
>>> data.restraints.bonds.n_outliers_by_model
{}
>>> data.restraints.bonds.as_JSON()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/molprobity/modules/cctbx_project/mmtbx/validation/restraints.py", line 370, in as_JSON
summary_results[model_id] = { "num_outliers" : self.n_outliers_by_model[model_id],
KeyError: ''
>>>
while chiralities
export in a similar situation works fine:
>>> data.restraints.chiralities.n_total_by_model
{'': 1568}
>>> data.restraints.chiralities.n_outliers_by_model
{'': 0}
>>> data.restraints.chiralities.as_JSON()
'{\n "validation_type": "chirality",\n "flat_results": [],\n "hierarchical_results": {},\n "summary_results": {\n "": {\n "num_outliers": 0,\n "num_total": 1568,\n "num_handedness_outliers": 0,\n "num_chiral_centers": 1326,\n "num_tetrahedral_outliers": 0,\n "num_pseudochiral_outliers": 0\n }\n }\n}'
>>>
should I create a new issue, or can we continue with this one?
Hmm, OK, I'll look into it. I appreciate you bringing these issues to my attention, the JSON export features are fairly new so it's good for them to get tested in real world situations.
thank you! i'm very interested in the json output and happy to test/provide feedback. we use molprobity as part of the PDB-Dev validation pipeline (to assess the quality of atomic models), and i'd be happy to switch to json outputs and get rid of some legacy code for capturing and parsing text molprobity output that we are using right now.
and sorry for only reporting issues without providing pull-requests. i'd love to contribute, but not familiar enough with the codebase.
I have checked in fixes for the issues you found with files with no bond/angle outliers.
I wanted to let you know that we've noticed some inconsistencies with the json outputs between the different validation scripts, so we'll be going through and fixing some of those issues. Let me know if you have any issues or opinions on how they should be formatted or if there's any missing information.
Thank you, @vbchen. I'll do some tests over the weekend and will let you know.
restraints.angles.as_JSON()
throws error. Steps to reproduce:Molprobity Internal Version (from core.php): 4.5.2
molprobity_version_number
(from pickled output): (4, 1)