<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<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);">
Perfect! Thank you very much Eric.</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);">
All the best,</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);">
Isabel</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> Eric Pettersen <pett@cgl.ucsf.edu><br>
<b>Sent:</b> Monday, May 30, 2022 23:58<br>
<b>To:</b> Moya Clark, I.O. de (Isabel) <i.o.demoyaclark@students.uu.nl><br>
<b>Cc:</b> ChimeraX Users Help <chimerax-users@cgl.ucsf.edu><br>
<b>Subject:</b> Re: [chimerax-users] ChimeraX - XMAS pluggin modification questions</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="left" style="border:0; display:table; width:100%; table-layout:fixed; border-collapse:seperate; float:none">
<tbody>
<tr>
<td valign="middle" width="1px" bgcolor="#A6A6A6" cellpadding="7px 2px 7px 2px" style="padding:7px 2px 7px 2px; background-color:#A6A6A6">
</td>
<td valign="middle" width="100%" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 15px" color="#212121" style="width:100%; background-color:#EAEAEA; padding:7px 5px 7px 15px; font-family:wf_segoe-ui_normal,Segoe UI,Segoe WP,Tahoma,Arial,sans-serif; font-size:12px; font-weight:normal; color:#212121; text-align:left; word-wrap:break-word">
<div>You don't often get email from pett@cgl.ucsf.edu. <a href="https://aka.ms/LearnAboutSenderIdentification">
Learn why this is important</a></div>
</td>
<td valign="middle" align="left" width="75px" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 5px" color="#212121" style="width:75px; background-color:#EAEAEA; padding:7px 5px 7px 5px; font-family:wf_segoe-ui_normal,Segoe UI,Segoe WP,Tahoma,Arial,sans-serif; font-size:12px; font-weight:normal; color:#212121; text-align:left; word-wrap:break-word">
</td>
</tr>
</tbody>
</table>
<div>Hi Isabel,
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>You add attributes to pseudobonds simply by setting an attribute on the pseudobonds.  For example, if you have a pseudobond group named 'pbg' and wanted to set a "likelihood" attribute
 on each of them to 1:</div>
<div class=""><br class="">
</div>
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>for pb in pbg.pseudobonds:</div>
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>pb.likelihood = 1</div>
<div class=""><br class="">
</div>
<div class="">The session-saving mechanism does not know about attributes created this way, but you can alert it about the attribute by "registering" it.  Each atomic class has a register_attr(session, attr_name, registerer) method.  The attr_name should be
 a string containing the attribute name, The registerer argument should identify the source of the registration, usually the bundle the registration comes from, which is used to compose reasonably informative error messages when there is a registration conflict
 for the same attribute.  So in your case the registration might be:</div>
<div class=""><br class="">
</div>
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>from chimerax.atomic import PseudoBond</div>
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>PseudoBond.register_attr(session, "likelihood", "XMAS")</div>
<div class=""><br class="">
</div>
<div class="">register_attr() accepts two optional keyword arguments.  'attr_type' can be provided with an argument of a built-in type (<i class="">e.g.</i> int, float, str) that values of the attribute should all be.  'can_return_none' should be set to True
 if None is also a valid value for the attribute (defaults to False).</div>
<div class=""><br class="">
</div>
<div class="">--Eric</div>
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On May 30, 2022, at 6:12 AM, Moya Clark, I.O. de (Isabel) via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</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">
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt">Dear Eric, </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt"> </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt">I had a question regarding Pseudobonds in ChimeraX. I was wondering if there is a way to add an attribute to pseudobond. Let’s say you have a group of pseudobonds for a model, how can I add an attribute to each individual
 pseudobond (for example the likelihood of each pseudobond)? Also, how can I do it in a way that this attribute stays saved in the session? </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt"> </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt">I hope you are having a good day, </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt"> </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt">Kind regards, </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt"> </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt">Isabel de Moya Clark </span></div>
<br class="">
</div>
<div id="x_appendonsend" 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>
<hr tabindex="-1" 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; display:inline-block; width:511.546875px">
<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>
<div id="x_divRplyFwdMsg" dir="ltr" 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">
<font face="Calibri, sans-serif" class="" style="font-size:11pt"><b class="">From:</b><span class="x_Apple-converted-space"> </span>Moya Clark, I.O. de (Isabel) <<a href="mailto:i.o.demoyaclark@students.uu.nl" class="">i.o.demoyaclark@students.uu.nl</a>><br class="">
<b class="">Sent:</b><span class="x_Apple-converted-space"> </span>Tuesday, April 26, 2022 10:23<br class="">
<b class="">To:</b><span class="x_Apple-converted-space"> </span>ChimeraX Users Help <<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a>><br class="">
<b class="">Subject:</b><span class="x_Apple-converted-space"> </span>Re: [chimerax-users] ChimeraX - XMAS pluggin modification questions</font>
<div class=""> </div>
</div>
<div dir="ltr" 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="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Good morning Eric,</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Thank you very much for the information. I'll take a look at it and see if I can make it work.</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
I hope you have a good week,</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Kind regards,</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Isabel de Moya Clark</div>
<div id="x_x_appendonsend" class=""></div>
<hr tabindex="-1" class="" style="display:inline-block; width:511.546875px">
<div id="x_x_divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" class="" style="font-size:11pt"><b class="">From:</b><span class="x_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="x_Apple-converted-space"> </span>Monday, April 25, 2022 18:23<br class="">
<b class="">To:</b><span class="x_Apple-converted-space"> </span>Moya Clark, I.O. de (Isabel) <<a href="mailto:i.o.demoyaclark@students.uu.nl" class="">i.o.demoyaclark@students.uu.nl</a>><br class="">
<b class="">Cc:</b><span class="x_Apple-converted-space"> </span><a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a><span class="x_Apple-converted-space"> </span><<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a>><br class="">
<b class="">Subject:</b><span class="x_Apple-converted-space"> </span>Re: [chimerax-users] ChimeraX - XMAS pluggin modification questions</font>
<div class=""> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="left" class="" style="border:0px; display:table; width:522px; table-layout:fixed; float:none">
<tbody class="">
<tr class="">
<td valign="middle" width="1px" bgcolor="#A6A6A6" cellpadding="7px 2px 7px 2px" class="" style="padding:7px 2px; background-color:rgb(166,166,166)">
</td>
<td valign="middle" width="100%" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 15px" class="" style="width:412px; background-color:rgb(234,234,234); padding:7px 5px 7px 15px; font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size:12px; font-weight:normal; color:rgb(33,33,33); text-align:left; word-wrap:break-word">
<div class="">You don't often get email from<span class="x_Apple-converted-space"> </span><a href="mailto:pett@cgl.ucsf.edu" class="">pett@cgl.ucsf.edu</a>.<span class="x_Apple-converted-space"> </span><a href="http://aka.ms/LearnAboutSenderIdentification" class="">Learn
 why this is important</a></div>
</td>
<td valign="middle" align="left" width="75px" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 5px" class="" style="width:75px; background-color:rgb(234,234,234); padding:7px 5px; font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size:12px; font-weight:normal; color:rgb(33,33,33); text-align:left; word-wrap:break-word">
</td>
</tr>
</tbody>
</table>
<div class="">Hi Isabel,
<div class=""><span class="x_x_x_Apple-tab-span" style="white-space:pre"></span>Yes, CoordSets are the way to go.  Assuming you want to extract these distances without necessarily playing through the trajectory/morph, the plan would be:</div>
<div class=""><br class="">
</div>
<div class="">(1) Get the coordinate set IDs from the structure</div>
<div class="">(2) Loop through IDs to get coordinate sets</div>
<div class="">(3) For each set, compute the distance</div>
<div class=""><br class="">
</div>
<div class="">If your structure was in a variable named 's' and the atoms you wanted to measure the distance between were 'a1' and 'a2' then the code would be:</div>
<div class=""><br class="">
</div>
<div class="">a1_index = a1.coord_index</div>
<div class="">a2_index = a2.coord_index</div>
<div class="">from chimerax.geometry import distance</div>
<div class="">for cid in s.coordset_ids:</div>
<div class=""><span class="x_x_x_Apple-tab-span" style="white-space:pre"></span>cs = s.coordset(cid)</div>
<div class=""><span class="x_x_x_Apple-tab-span" style="white-space:pre"></span>d = distance(cs[a1_index], cs[a2_index])</div>
<div class=""><span class="x_x_x_Apple-tab-span" style="white-space:pre"></span><i class="">do something with the 'd' you just computed</i></div>
<div class=""><span class="" style="font-style:normal"><br class="">
</span></div>
<div class="">Glad to hear you are going to continue improving the already excellent XMAS bundle!</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">--Eric</div>
<div class=""><br class="">
</div>
<div class=""><span class="x_x_x_Apple-tab-span" style="white-space:pre"></span>Eric Pettersen</div>
<div class=""><span class="x_x_x_Apple-tab-span" style="white-space:pre"></span>UCSF Computer Graphics Lab</div>
</div>
<div class=""><br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Apr 25, 2022, at 3:12 AM, Moya Clark, I.O. de (Isabel) via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a>> wrote:</div>
<br class="x_x_x_Apple-interchange-newline">
<div class="">
<div class="x_x_x_elementToProof" 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">
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt">Good morning, </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt"> </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt">I am a student intern at the Richard Scheltema Laboratory, and I am going to be continuing with the modification of the XMAS bundle submitted to ChimeraX recently. </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt"> </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt">Right now, we are trying to extend the bundle to be able to extract specific distances between specific amino acids for two different proteins but for a molecular dynamics simulation. Either by loading a trajectory coordinates
 +<span class=""> </span>topology files or by using the “morph” command and then “coordset slider”. </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt"> </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt">So, the idea would be to extract the distances between the alpha carbons, of a set of pre-selected amino acids, in each frame of the simulation. Do you have any suggestions about any modules or methods that I should look
 into to extract this information in each frame? I saw there is a CooordSets class but I do not know if this would be the right way to go about it. </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt"> </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt">Kind regards, </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt"> </span></div>
<div class="" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
<span class="" style="font-size:12pt">Isabel de Moya Clark </span></div>
<br class="">
</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">ChimeraX-users
 mailing list</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">
<a href="mailto:ChimeraX-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">ChimeraX-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><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">
<a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" 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://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</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">ChimeraX-users
 mailing list</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">
<a href="mailto:ChimeraX-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; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">ChimeraX-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><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">
<a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" class="" 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">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>