<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Kushagra,<div class=""><br class=""></div><div class="">  ChimeraX has a Python shell, menu Tools / General / Shell.  That brings up a separate panel where you can type Python code.  To get the list of open models</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span>mlist = session.models.list()</div><div class=""><br class=""></div><div class="">To make a molecular surface for each chain</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span>from chimerax.surface.surfacecmds import surface</div><div class=""><span class="Apple-tab-span" style="white-space:pre">  </span>m = mlist[0]</div><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span>surfs = surface(session, m.atoms)</div><div class=""><br class=""></div><div class="">To hide the surface of the first chain</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space: pre;">    </span>surfs[0].display = False</div><div class=""><div><br class=""></div><div>To list the methods of a ChimeraX class</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>from chimerax.atomic import Structure</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>dir(Structure)</div><div><br class=""></div><div>But you might find it easier to read the ChimeraX Python API documentation, for instance for atomic structures</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">  </span><a href="https://www.cgl.ucsf.edu/chimerax/docs/devel/bundles/atomic/src/atomic.html" class="">https://www.cgl.ucsf.edu/chimerax/docs/devel/bundles/atomic/src/atomic.html</a></div><div><br class=""></div><div>Here are low level surface related functions</div><div><br class=""></div><div><a href="https://www.cgl.ucsf.edu/chimerax/docs/devel/bundles/surface/src/surface.html" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>https://www.cgl.ucsf.edu/chimerax/docs/devel/bundles/surface/src/surface.html</a></div><div><br class=""></div><div>For the Python functions used by the typed ChimeraX commands</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">   </span><a href="https://www.cgl.ucsf.edu/chimerax/docs/devel/core/commands/user_commands.html" class="">https://www.cgl.ucsf.edu/chimerax/docs/devel/core/commands/user_commands.html</a></div><div><br class=""></div><div>for instance, the "surface" command</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">       </span><a href="https://www.cgl.ucsf.edu/chimerax/docs/devel/core/commands/user_commands.html#surface" class="">https://www.cgl.ucsf.edu/chimerax/docs/devel/core/commands/user_commands.html#surface</a></div><div><br class=""></div><div>If the API documentation does not give all the details you want, then look at the Python code which is included in ChimeraX.  For instance, on Mac it is in</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">    </span>ChimeraX.app/Contents/lib/python3.9/site-packages/chimerax</div><div><br class=""></div><div>for instance the surface command Python code is here</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ChimeraX.app/Contents/lib/python3.9/site-packages/chimerax/surface/surfacecmds.py</div><div><br class=""></div><div>Or if you prefer look at that same code in the ChimeraX Github repository</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">    </span><a href="https://github.com/RBVI/ChimeraX/blob/develop/src/bundles/surface/src/surfacecmds.py" class="">https://github.com/RBVI/ChimeraX/blob/develop/src/bundles/surface/src/surfacecmds.py</a></div><div><br class=""></div><div>If all else fails, ask us on this ChimeraX mailing list your specific programming questions.  We'd love to have you develop plugins.</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">     </span>Tom</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 23, 2022, at 12:09 AM, KUSHAGRA RUSTAGI via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Greetings,</div><div class=""><br class=""></div><div class="">I am Kushagra Rustagi an undergraduate student at IIT Roorkee who is working on developing a ChimeraX plugin. I had some doubts:</div><div class=""><br class=""></div>1. Can we open a session in ipython? Basically while developing codes for chimerax is there a way to open chimera command line in ipython?<br class=""><br class=""><div class="">2. For example if we want to run an inbuilt function of any particular class in ChimeraX and we want to find all methods associated with that class. How do we go about doing it? <br class=""><br class="">3. How to go about exploring surface generation functions in ChimeraX?<div class=""><br class=""></div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Kushagra Rustagi</div></div><div class=""><br class=""></div></div>
_______________________________________________<br class="">ChimeraX-users mailing list<br class=""><a href="mailto:ChimeraX-users@cgl.ucsf.edu" class="">ChimeraX-users@cgl.ucsf.edu</a><br class="">Manage subscription:<br class="">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users<br class=""></div></blockquote></div><br class=""></div></body></html>