<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
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.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
That tip <a href="http://model.opened_data_format.name" target="_blank" rel="noopener noreferrer" data-auth="NotApplicable" data-safelink="true" data-linkindex="1" class="ContentPasted0" data-loopstyle="link" id="LPlnk946145">
model.opened_data_format.name</a> 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.<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Tony Schaefer <tony.schaefer.chem@gmail.com><br>
<b>Sent:</b> Wednesday, April 19, 2023 2:09 PM<br>
<b>To:</b> BARRY E DEZONIA <barry.dezonia@wisc.edu><br>
<b>Cc:</b> Thomas Mulvaney <thomas.mulvaney@cssb-hamburg.de>; chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu><br>
<b>Subject:</b> Re: [chimerax-users] Hopefully simple plugin development question</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Barry,<br>
</div>
<div><br>
</div>
<div>The shell tool is under Tools -> General on the ChimeraX menu. There's some API documentation online here:
<a href="https://www.cgl.ucsf.edu/chimerax/docs/devel/index.html">https://www.cgl.ucsf.edu/chimerax/docs/devel/index.html</a>.</div>
<div><br>
</div>
<div>Models should also have an 'opened_data_format' attribute with info about which file parser was used (e.g.
<a href="http://model.opened_data_format.name">model.opened_data_format.name</a>). This could be one way to limit models to only PDB or whatever you'd be able to support.
<br>
</div>
<div><br>
</div>
<div>Tony<br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Wed, Apr 19, 2023 at 12:57 PM BARRY E DEZONIA via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu">chimerax-users@cgl.ucsf.edu</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div class="x_msg-263679172433795410">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks Tom,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
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.<br>
</div>
<div id="x_m_-6419325199671734922appendonsend"></div>
<hr style="display:inline-block; width:98%">
<div id="x_m_-6419325199671734922divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Thomas Mulvaney <<a href="mailto:thomas.mulvaney@cssb-hamburg.de" target="_blank">thomas.mulvaney@cssb-hamburg.de</a>><br>
<b>Sent:</b> Wednesday, April 19, 2023 1:36 PM<br>
<b>To:</b> BARRY E DEZONIA <<a href="mailto:barry.dezonia@wisc.edu" target="_blank">barry.dezonia@wisc.edu</a>><br>
<b>Cc:</b> <a href="mailto:chimerax-users@cgl.ucsf.edu" target="_blank">chimerax-users@cgl.ucsf.edu</a> <<a href="mailto:chimerax-users@cgl.ucsf.edu" target="_blank">chimerax-users@cgl.ucsf.edu</a>><br>
<b>Subject:</b> Re: [chimerax-users] Hopefully simple plugin development question</font>
<div> </div>
</div>
<div>
<div>Hi Barry,</div>
<div><br>
</div>
<div>The list of current models the user is viewing is in the `session.models` variable.</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>Hope that helps,</div>
<div><br>
</div>
<div>Tom</div>
<div>
<div dir="auto" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<div>—<br>
Tom Mulvaney<br>
PhD Student <br>
Centre for Structural Systems Biology (CSSB)<br>
Research Group of Prof. Dr. Maya Topf<br>
c/o DESY, Building 15<br>
Notkestraße 85, 22607 Hamburg<br>
Germany</div>
</div>
</div>
<div><br>
<blockquote type="cite">
<div>On 19. Apr 2023, at 20:05, BARRY E DEZONIA via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" target="_blank">chimerax-users@cgl.ucsf.edu</a>> wrote:</div>
<br>
<div>
<div style="font-style:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Hello,</div>
<div style="font-style:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="font-style:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
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.<br>
</div>
<span style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline">_______________________________________________</span><br style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline">ChimeraX-users
mailing list</span><br style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="mailto:ChimeraX-users@cgl.ucsf.edu" target="_blank" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px">ChimeraX-users@cgl.ucsf.edu</a><br style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline">Manage
subscription:</span><br style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" target="_blank" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a></div>
</blockquote>
</div>
<br>
</div>
</div>
_______________________________________________<br>
ChimeraX-users mailing list<br>
<a href="mailto:ChimeraX-users@cgl.ucsf.edu" target="_blank">ChimeraX-users@cgl.ucsf.edu</a><br>
Manage subscription:<br>
<a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" rel="noreferrer" target="_blank">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a><br>
</div>
</blockquote>
</div>
</div>
</body>
</html>