[chimerax-users] Hopefully simple plugin development question

BARRY E DEZONIA barry.dezonia at wisc.edu
Wed Apr 19 12:45:20 PDT 2023


Thanks Tony. That command line interface is what I have been using (for instance to run the devel tools). It does not have tab completion. I am wondering what command line Tom is using that does have tab completion.

That tip model.opened_data_format.name<http://model.opened_data_format.name> will come in handy. I just really need to find the "current" model/view window and then use the session variable or else metadata available to the model/view to get it's model id or model name that I can then match to the session.models[] variables.
________________________________
From: Tony Schaefer <tony.schaefer.chem at gmail.com>
Sent: Wednesday, April 19, 2023 2:09 PM
To: BARRY E DEZONIA <barry.dezonia at wisc.edu>
Cc: Thomas Mulvaney <thomas.mulvaney at cssb-hamburg.de>; chimerax-users at cgl.ucsf.edu <chimerax-users at cgl.ucsf.edu>
Subject: Re: [chimerax-users] Hopefully simple plugin development question

Barry,

The shell tool is under Tools -> General on the ChimeraX menu. There's some API documentation online here: https://www.cgl.ucsf.edu/chimerax/docs/devel/index.html.

Models should also have an 'opened_data_format' attribute with info about which file parser was used (e.g. model.opened_data_format.name<http://model.opened_data_format.name>). This could be one way to limit models to only PDB or whatever you'd be able to support.

Tony

On Wed, Apr 19, 2023 at 12:57 PM BARRY E DEZONIA via ChimeraX-users <chimerax-users at cgl.ucsf.edu<mailto:chimerax-users at cgl.ucsf.edu>> wrote:
Thanks Tom,

How do you invoke this python shell? A quick google search turns up nothing. The command line in the chimerax app does not allow tab completion. I've tried running 'chimerax --nogui' from the command line and that gives me a shell but no tab completion is possible there either.
________________________________
From: Thomas Mulvaney <thomas.mulvaney at cssb-hamburg.de<mailto:thomas.mulvaney at cssb-hamburg.de>>
Sent: Wednesday, April 19, 2023 1:36 PM
To: BARRY E DEZONIA <barry.dezonia at wisc.edu<mailto:barry.dezonia at wisc.edu>>
Cc: chimerax-users at cgl.ucsf.edu<mailto:chimerax-users at cgl.ucsf.edu> <chimerax-users at cgl.ucsf.edu<mailto:chimerax-users at cgl.ucsf.edu>>
Subject: Re: [chimerax-users] Hopefully simple plugin development question

Hi Barry,

The list of current models the user is viewing is in the `session.models` variable.

Assuming the user has only one PDB file open, you can just do `session.models[0].filename` which will return the path to the PDB file they opened.

I've discovered most of the functionality I needed by poking around in the Python Shell that ships with ChimeraX and hitting tab to find out the attributes and methods that objects have.

Hope that helps,

Tom
—
Tom Mulvaney
PhD Student
Centre for Structural Systems Biology (CSSB)
Research Group of Prof. Dr. Maya Topf
c/o DESY, Building 15
Notkestraße 85, 22607 Hamburg
Germany

On 19. Apr 2023, at 20:05, BARRY E DEZONIA via ChimeraX-users <chimerax-users at cgl.ucsf.edu<mailto:chimerax-users at cgl.ucsf.edu>> wrote:

Hello,

I am looking at writing a plugin for chimerax that takes a pdb and runs some python code that will calc some stuff hand stuff to other programs. I know how to do this. What I want to know is how to find the current model's name / associated pdb filename from my plugin. Imagine my plugin really is just a "Run" button that looks up the current model, generates the associated pdb filename, and passes that name to my python script. Can someone tell me how in a chimerax plugin I can make the call that will give me the pdb filename I want? I've read much of the developer docs and could not find what I was looking for.
_______________________________________________
ChimeraX-users mailing list
ChimeraX-users at cgl.ucsf.edu<mailto:ChimeraX-users at cgl.ucsf.edu>
Manage subscription:
https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

_______________________________________________
ChimeraX-users mailing list
ChimeraX-users at cgl.ucsf.edu<mailto:ChimeraX-users at cgl.ucsf.edu>
Manage subscription:
https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rbvi.ucsf.edu/pipermail/chimerax-users/attachments/20230419/83874662/attachment.html>


More information about the ChimeraX-users mailing list