Use multiprocessing from within a PyMOL plugin
0
0
Entering edit mode
3.8 years ago

I am developing a PyMOL plugin for membrane protein systems using Qt widgets. The plugin builds MP assemblies in a lipid/detergent environment and refines the models against SAXS data. It seems to work fine, although the computation (mostly three simple operations repeated over and over again: copy a pymol object, translate, rotate) takes ages. What I would really like to implement is to introduce multithreading to speed up computations, however, the standard python features like "multiprocessing" module do not work under the PyMol plugin. I am wondering if someone encounters the same problem and if there is an easy way around it?

Just in case, my project is located here: https://github.com/emblsaxs/MPBuilder

pymol multithreads multiprocessing pymol plugin • 1.2k views
ADD COMMENT
0
Entering edit mode

Can you elaborate by what you mean 'do not work'? I don't use PyMOL, but with UCSF Chimera, many things that "don't work" simply aren't recommended, or will break certain things, but can still work depending on the usecase. A common one was that Chimera shipped with a very out of date numpy which caused issues, but an updated one could be installed in to the environment without breaking too much.

Most likely PyMOL was not build with MP in mind though, so this may be a hard limitation of working inside PyMOL (and python's implementations of multiprocessing are not stellar either).

ADD REPLY
0
Entering edit mode

Thanks, and sorry for the fuzziness. "don't work" means that pymol objects (models) exist only for the mother process, for the others (created) processes it gives "NoneType" error, which simply means that the pymol object is not found. I used the code similar to this one: https://stackoverflow.com/questions/5442910/how-to-use-multiprocessing-pool-map-with-multiple-arguments I was thinking to somehow hand over pymol objects from the main process to all others, but have no idea how to do it exactly...

ADD REPLY
0
Entering edit mode

Sounds like it may be a hard restriction of working with PyMol in that case. I'm not sure if PyMol themselves have a messageboard but this might be best addressed directly to them (I expect the solution won't be simple!)

ADD REPLY

Login before adding your answer.

Traffic: 2369 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6