<div dir="auto">Are you sure you’re talking about the same thing? The shell (Tools/General/Shell) is a full iPython instance with tab completion etc.. I use it on an almost daily basis.</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 19 Apr 2023 at 20:58, 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="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
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)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
That tip <a href="http://model.opened_data_format.name" rel="noopener noreferrer" id="m_-8169406715195209871LPlnk946145" target="_blank">
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="m_-8169406715195209871appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="m_-8169406715195209871divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Tony Schaefer <<a href="mailto:tony.schaefer.chem@gmail.com" target="_blank">tony.schaefer.chem@gmail.com</a>><br>
<b>Sent:</b> Wednesday, April 19, 2023 2:09 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> Thomas Mulvaney <<a href="mailto:thomas.mulvaney@cssb-hamburg.de" target="_blank">thomas.mulvaney@cssb-hamburg.de</a>>; <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>></font></div></div><div dir="ltr"><div id="m_-8169406715195209871divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><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" target="_blank">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" target="_blank">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>
<div dir="ltr">On Wed, Apr 19, 2023 at 12:57 PM BARRY E DEZONIA via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" target="_blank">chimerax-users@cgl.ucsf.edu</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<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="m_-8169406715195209871x_m_-6419325199671734922appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="m_-8169406715195209871x_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>
<a href="https://www.google.com/maps/search/Notkestra%C3%9Fe+85,+22607+Hamburg+%0D%0AGermany?entry=gmail&source=g">Notkestraße 85, 22607 Hamburg</a><br><a href="https://www.google.com/maps/search/Notkestra%C3%9Fe+85,+22607+Hamburg+%0D%0AGermany?entry=gmail&source=g">
Germany</a></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" 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" target="_blank">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" 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" target="_blank">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>
</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>
</blockquote></div></div>