Documentation updates?
Hi Robin,
I hope you'll bear with a couple of silly questions, and if it helps then I can take some time to update your README, to help clarify a couple of things.
I'm a software person and terribly new to the world of scientific computing, so I'm still really getting oriented. I've been asked to write a VMD plugin for configuring and submitting jobs, hopefully in Python. Would you be willing to spend a few moments helping me to understand how I can do that? It would be my pleasure to write up some tutorial notes and submit a pull request.
thanks for your time Tyler
Hi Tyler,
Welcome to scientific computing! If you're coming from a software background, prepare to be entertained :) For a VMD plugin, you'll need a couple of things:
- A backend. Some kind of functions that submit your jobs.
- A frontend GUI, if you want. For Python + VMD, use Tkinter
- Glue between these two and integration into VMD.
The first two are solvable with some googling, but the third can get weird. Here are some hints in the right direction:
- You can register callbacks from button presses in your Tkinter GUI to make things happen in the VMD GUI / render window / environment. See: https://vmd.robinbetz.com/vmdcallbacks.html
- You can add entries to VMD menus (like to the plugins area) with the vmdmenu module. See: https://vmd.robinbetz.com/api/generated/vmd.vmdmenu.add.html
- Getting your plugin installed can be as easy as putting it in $VMDDIR/plugins, but you'll have to poke around with how that works. I bet getting a Python one to load without having to recompile VMD won't be too hard. The vast majority of current plugins are written in TCL, and I know there is functionality for registering them.
This probably isn't the right repo to build off of if you're trying to put something into the VMD GUI window, as it's just a Python module.
I'd go get the VMD source code and build that with Python support, or find a binary someone's distributing. I have a really old blog post on doing this but it is quite out of date. If you feel like wading through code I wrote in grad school, the DensitySampler class in this file implements a matplotlib graph that you can click on and it shows or hides molecules: https://github.com/Eigenstate/beak/blob/master/beak/visualize/sampler.py This isn't done with callbacks but with threads, but it's the only practical example I can find right now :)
Let me know how it goes! I am happy to help, but may respond quite asynchronously.