<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Hernando,<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>I forgot that, unlike ChimeraX, Chimera's modules are imported into the global namespace. So the module is just "StructMeasure", not "chimera.StructMeasure". Sorry about that.</div><div class=""><br class=""></div><div class="">--Eric<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 10, 2020, at 1:59 PM, Hernando J Sosa <<a href="mailto:hernando.sosa@einsteinmed.org" class="">hernando.sosa@einsteinmed.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">Hi Eric,<br class=""></div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">I can't find the function. Trying to call it within the chimera idle-python shell I get the following error:</div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><span class="">>>> chimera.StructMeasure.axis()<br class=""></span><div class="">Traceback (most recent call last):<br class=""></div><div class=""> File "<pyshell#3>", line 2, in <module><br class=""></div><span class="">AttributeError: 'module' object has no attribute 'StructMeasure'</span></div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><span class=""><br class=""></span></div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><span class="">I can't see it either (or something similarly called) within the functions listed if a do</span></div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><span class="">>>>help(chimera)</span></div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><span class=""><br class=""></span></div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><span class="">H.</span><br class=""></div><div id="Signature" class=""><div class=""><div class=""><font size="2" face="Arial" class=""><a class=""><span class="">___________________________________<br class=""></span></a></font></div><div class=""><font size="2" face="Arial" class=""><a class=""><span style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif;" class="">Hernando Sosa</span></a><span class=""><span style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif;" class=""> <span class="Apple-converted-space"> </span></span><span class=""><br class=""></span></span></font></div><font size="2" face="Arial" class=""><span class=""><span style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif;" class="">Dept. of Physiology and Biophysics<span class="Apple-converted-space"> </span></span></span><br class=""></font><font size="2" face="Arial" class=""><span class=""><span class=""></span></span><span class=""><span style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif;" class="">Albert Einstein College of Medicine<span class="Apple-converted-space"> </span></span></span><br class=""></font><font size="2" face="Arial" class=""><span class=""><span class=""></span></span><span class=""><span style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif;" class="">1300 Morris Park Av.<span class="Apple-converted-space"> </span></span></span><br class=""></font><font size="2" face="Arial" class=""><span class=""><span class=""></span></span><span class=""><span style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif;" class="">Bronx NY 10461<span class="Apple-converted-space"> </span></span></span><br class=""></font><font size="2" face="Arial" class=""><span class=""><span class=""></span></span><span class=""><span style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif;" class="">phone (718) 430-3456<span class="Apple-converted-space"> </span></span></span><br class=""></font><font size="2" face="Arial" class=""><span class=""><span class=""></span></span><span class=""><span style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif;" class="">FAX (718) 430-8819<span class="Apple-converted-space"> </span></span></span><br class=""></font><div class=""><font size="2" face="Arial" class=""><span class=""><span class=""></span></span><span class=""><span style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif;" class="">emai: <span class="Apple-converted-space"> </span></span><span class=""><a href="mailto:hernando.sosa@einsteinmed.org" title="hernando.sosa@einsteinmed.org" class=""><span style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif;" class="">hernando.sosa@einsteinmed.org</span></a><br class=""></span></span></font></div><div class=""><div class=""><font size="2" face="Arial" class=""><a class=""><span style="font-size: 9pt; font-family: "Arial Black", Arial, sans-serif;" class="">___________________________________</span><span class=""><br class=""></span></a></font></div><div class=""><font size="2" face="Arial" class=""><a class=""><span class=""></span></a></font></div><br class=""><font size="2" face="Arial" class=""><span class=""><span class=""></span></span></font></div></div></div></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div id="appendonsend" class=""></div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><hr tabindex="-1" style="display: inline-block; width: 487.046875px;" class=""><div id="divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu" class="">pett@cgl.ucsf.edu</a>><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Friday, July 10, 2020 4:44 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Hernando J Sosa <<a href="mailto:hernando.sosa@einsteinmed.org" class="">hernando.sosa@einsteinmed.org</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:chimera-users@cgl.ucsf.edu" class="">chimera-users@cgl.ucsf.edu</a><span class="Apple-converted-space"> </span><<a href="mailto:chimera-users@cgl.ucsf.edu" class="">chimera-users@cgl.ucsf.edu</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [Chimera-users] axes</font><div class=""> </div></div><div class="" style="word-wrap: break-word; line-break: after-white-space;"><table cellspacing="3" cellpadding="3" border="4" style="background-color: rgb(254, 0, 0); border-collapse: collapse; border: 4px solid rgb(203, 203, 203); color: rgb(255, 204, 103); width: 493px; text-align: center;" class=""><tbody class=""><tr class=""><td class=""><i class="">CAUTION: This email comes from an external source; the attachments and/or links may compromise our secure environment. Do not open or click on suspicious emails. Please click on the “Phish Alert” button on the top right of the Outlook dashboard to report any suspicious emails.</i></td></tr></tbody></table><div class="">Hi Hernando,<div class=""><span class="x_Apple-tab-span" style="white-space: pre;"></span>Mostly yes. The function is chimera.StructMeasure.axis(). There is a doc string for the function describing its arguments and return values. In its simplest form it takes a numpy array of xyz values and returns a Point (centroid) instance and a Vector (unit direction vector) instance. To get a length you would also have to supply the findBounds=True keyword argument, in which case it will return two additional floating-point values, the scale factors to apply to the unit vector to get it to the approximate bounds of the axis in each direction (so one of the scale factors will be negative).</div><div class=""><span class="x_Apple-tab-span" style="white-space: pre;"></span>If you have a list of Atom instances, the easiest way to generate the numpy xyz array is with numpyArrayFromAtoms,<span class="Apple-converted-space"> </span><i class="">e.g.</i><span class="" style="font-style: normal;">:</span></div><div class=""><br class=""></div><div class="">import chimera</div><div class="">xyzs = chimera.numpyArrayForAtoms(atoms)</div><div class=""><br class=""></div><div class="">If you only really have an atom spec, let me know and I can help with how to generate a list of Atoms from that.</div><div class=""><br class=""></div><div class=""><div class="">--Eric</div><div class=""><br class=""></div><div class=""><span class="x_Apple-tab-span" style="white-space: pre;"></span>Eric Pettersen</div><div class=""><span class="x_Apple-tab-span" style="white-space: pre;"></span>UCSF Computer Graphics Lab</div><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jul 10, 2020, at 11:54 AM, Hernando J Sosa <<a href="mailto:hernando.sosa@einsteinmed.org" class="">hernando.sosa@einsteinmed.org</a>> wrote:</div><br class="x_Apple-interchange-newline"><div class=""><div class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; 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;">Dear Chimera,</div><div class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; 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 class=""></div><div class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; 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;">Is there a way to run a command within a python script equivalent to the chimera command 'define axis' to be able to retrieve the results (length,center, direction) ? Something like:</div><div class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; 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 class=""></div><div class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; 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;">(length,center,direction) = mydefineaxis(atomspec)</div><div class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; 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 class=""></div><div class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; 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;">Thanks</div><div class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; 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 class=""></div><div class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; 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;">Hernando<br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><div class=""><br class=""><br class=""></div></div><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; 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 !important;">_______________________________________________</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; 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 !important;">Chimera-users mailing list:<span class="x_Apple-converted-space"> </span></span><a href="mailto:Chimera-users@cgl.ucsf.edu" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Chimera-users@cgl.ucsf.edu</a><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; 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 !important;">Manage subscription:<span class="x_Apple-converted-space"> </span></span><a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplato.cgl.ucsf.edu%2Fmailman%2Flistinfo%2Fchimera-users&data=02%7C01%7Chernando.sosa%40einsteinmed.org%7Cdf93aa552ac3413bb97708d8251216e0%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C637300106911058025&sdata=8fjGN1Ve%2B4HNUZL4ltu41pBMDoEsEFa3nY7CeNrL%2Fio%3D&reserved=0" originalsrc="https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" shash="EoGAwGU8TBxI+4JyMyudTOUTQbg3JQGR8u2DYVMyet1qXLGjBC6CzHx+uUlUCbeTxIdmxO2swuf7AUfW4jwnkPXDvfhJ3e4wx7GQLa1JvLoQLXdxO3NrM8t8vg4cRmJnKnwUBkEgaUDaoOEmOV3tObrho0y4iA27p6P0bN7lKms=" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a></div></blockquote></div><br class=""></div></div></div></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Chimera-users mailing list:<span class="Apple-converted-space"> </span></span><a href="mailto:Chimera-users@cgl.ucsf.edu" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Chimera-users@cgl.ucsf.edu</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Manage subscription:<span class="Apple-converted-space"> </span></span><a href="https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a></div></blockquote></div><br class=""></div></body></html>