[chimerax-users] differentiating file category
Anthony James Schaefer
tony.schaefer at uga.edu
Mon Dec 30 14:30:44 PST 2019
Hello,
Is there any way I can get a bundle to know that I'm trying to open a file from a certain category (e.g. Molecular structure vs. Molecular trajectory) from the File -> Open... menu?
I'm trying to build a plugin that will allow me to open Gaussian log files in ChimeraX. I'd like to have it open the optimized structure when I go File -> Open... and change the file filter to "Molecular structure files". When I set the file filter to "Molecular trajectory files", I'd like it to open the log file as a trajectory with each frame being one of Gaussian's optimization steps. The file stays the same, I just want to have my 'open_file' method know that it should open the file differently.
So far, I've tried having multiple 'Open' entries in my bundle tags. Here are some relevant tags from my setup.py:
"ChimeraX :: DataFormat :: LOG :: Gaussian output file :: Molecular structure :: .log :: :: :: :: :: Gaussian output file :: utf-8",
"ChimeraX :: DataFormat :: LOG trajectory :: Gaussian output trajectory :: Molecular trajectory :: .log :: :: :: :: :: Gaussian output file :: utf-8",
"ChimeraX :: Open :: LOG :: Gaussian output file ::",
"ChimeraX :: Open :: LOG trajectory :: Gaussian output trajectory :: :: coordsets:Bool",
My 'open_file' definition line is:
def open_file(session, path, format_name, coordsets=False):
While I'm testing, I've set up my 'open_file' method to print the arguments that get passed to it. When I use File -> Open..., I can see that 'format_name' is always "Gaussian ouput file" (never "Gaussian output trajectory") and 'coordsets' is always False, regardless of the file filter. When I use the `open` command (`open asdf.log coordsets true`), 'coordsets' is True and 'format_name' is "Gaussian output file".
I can work with the open command because of the 'coordsets' argument, but I'd like to know if there's something I can do with the File -> Open... menu.
Thanks,
Tony
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimerax-users/attachments/20191230/028328ef/attachment.html>
More information about the ChimeraX-users
mailing list