schrodinger / pymol-open-source

Open-source foundation of the user-sponsored PyMOL molecular visualization system.
https://pymol.org/
Other
1.15k stars 275 forks source link

File Size Limit for DCD Plugin #239

Closed christos-efthymiou closed 1 year ago

christos-efthymiou commented 2 years ago

I am using a Windows 10 computer and have been trying to get the program MDContactCom (https://gitlab.com/chiemotono/mdcontactcom) to run on my simulation files. I have been trying for several weeks but I continue to get an error that has been diagnosed on this forum here: https://discuss.python.org/t/how-to-modify-python-program-to-be-able-to-find-files-on-a-mapped-network-drive/16489/9.

According to answers I received from that forum, the error "dcdplugin) Could not access file" comes "...from open_dcd_read() in the dcdplugin of pymol. This exact error message only occurs if the C stat() call fails. The function ignores the C errno value, but the problem is likely that the file size (4.94 GiB) is too big, with errno set to EOVERFLOW. If the plugin links with the Windows C runtime implementation of stat(), then it’s implemented as _stat64i32(), which limits stsize to a 32-bit signed range (up to 2 GiB). A 64-bit size range is implemented by [w]stat64(), but that’s not a standard POSIX call for cross-platform code."

Therefore, they suggested that I report this problem and advised that it could be fixed by "implementing a wrapper function for stat() that calls _stat64() in Windows and returns a cross-platform stat result."

Would appreciate if this can be fixed!

JarrettSJohnson commented 2 years ago

I believe the developers of VMD are the original authors of this plugin. I'll contact them to see if they've come across this issue. In the meantime, I'll probably just make a light wrapper for this specific plugin. It seems as though there's similar logic also applies to the source code for other VMD plugins, but I'll likely refrain from patching too much unless it's again requested for them.

JarrettSJohnson commented 2 years ago

Apparently the size of DCD trajectory files can be expected to be that large. It's suggested that they're meant to be broken down into numerous smaller files using: http://www.ks.uiuc.edu/Development/MDTools/catdcd/