bjornwallner / DockQ

DockQ is a single continuous quality measure for Protein, Nucleic Acids and Small Molecule Docking Models
MIT License
212 stars 49 forks source link

CIFs don't seem to work properly #34

Closed nzrandol closed 3 months ago

nzrandol commented 3 months ago

Hello! I've noticed that CIF files don't seem to work properly with DockQ. I've been using DockQ as a Python module and when I give a structure from a PDB file to run_on_all_native_interfaces as both the model and native, it works as expected (a perfect score). But when I try this same test with the same structure but in a CIF format, the scores are drastically different.

Here's a screenshot of what I've tried:

Screenshot 2024-06-13 at 9 53 58 AM
clami66 commented 3 months ago

Hi, it's a bit hard to say what's going on just from the screenshot. Can you attach the CIF files perhaps?

Also what happens when you compare the same structures on the command line?

nzrandol commented 3 months ago

I've done a little bit more playing around with this, and I think the issue is a bit more complicated than "CIFs don't work". I've attached a zip file that contains the files I'm using and a test Python script.

When I run the script, the "N-N CIF" and "D-N CIF" outputs are identical and match the "N-N PDB" results. Interestingly if you swap the two lines around (so "D-N CIF" before "N-N CIF"), the outputs are still identical but now match the "D-N PDB" results.

When using the command line, it seems to be fine. So this seems to me like some sort of Python memory issue related to CIFs?

(The results in my first screenshot are consistent with this as when the kernel is restarted, it also seems to be correct for only the first call on CIF-based structures.)

dockQ_test.zip

clami66 commented 3 months ago

This is probably related to issue #26 After loading a PDB try to follow it up with, e.g.: native1.id = "1kee_native.cif"

So that every structure has a different id field. That should help with avoiding problems with the lru_cache.

I will push a fix to this as soon as possible

clami66 commented 3 months ago

@nzrandol this should be fixed now, please try to pull the latest commit and check again

You were right that this was a CIF issue, as I had fixed this following #26 but only for .pdb files somehow