<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="">This would be incredibly helpful Vinod,<div class="">I can see that what I need to do is learn Python for the future, but your kind offer can help me get started. </div><div class="">My understanding is that the python script can even run within Chimera under the MD/movie module’s ‘Per-Frame’ tab. Is that correct?</div><div class=""><br class=""></div><div class="">Thank you very much in advance,</div><div class="">Anne-Frances<br class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-variant-caps: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font color="#0000de" class="">- • - • - • - • - • - • - • - • -</font></div><div style="font-variant-caps: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-style: normal;" class=""><b class=""><font color="#0000d2" class="">A.-F. Miller, Ph. D. (she/elle/sie)</font></b></span></div><font color="#0000d2" class="">University Research Professor<br class=""></font><div style="font-variant-caps: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-style: normal;" class=""><font color="#0000d2" class="">Professor of Chemistry</font></span></div><span style="font-style: normal;" class=""><font color="#0000d2" class="">University of Kentucky</font></span></div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><span style="font-style: normal;" class=""><font color="#0000d2" class=""><a href="https://www.uky.edu/~afm/" class="">https://www.uky.edu/~afm/</a></font></span></div><div dir="auto" style="color: rgb(0, 0, 0); word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><span style="color: rgb(0, 0, 0); font-style: normal;" class=""><font color="#0000de" class=""><br class=""></font></span><font color="#db0000" class="">Visiting Fellow, </font></div><div dir="auto" style="color: rgb(0, 0, 0); word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><font color="#db0000" class=""> Einstein Foundation of Berlin<br class=""></font></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On Dec 10, 2021, at 6:21 PM, Batra, Vinod (NIH/NIEHS) [C] <<a href="mailto:batra1@niehs.nih.gov" class="">batra1@niehs.nih.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi Anne-Frances<br class="">I can provide you a python script to do that if you can write each trajectory as pdb file. <br class="">In the image attached, I have measured 12 distance pairs in 10 different pdb files. The plot shows that if the distance between atom pairs are similar to some reference structure they are colored black, and green if shorter, and red if longer with a predefined and customizable cutoff value eg. 0.2 or 0.3 å. The script writes these distances to a csv file also at the same time so that you can plot it in any graphic program.<br class=""><br class="">My script does not measure angles, but can be added to the script easily.<br class="">Vinod<br class=""><br class="">On 12/10/21, 11:48 AM, "Elaine Meng via Chimera-users" <<a href="mailto:chimera-users@cgl.ucsf.edu" class="">chimera-users@cgl.ucsf.edu</a>> wrote:<br class=""><br class=""> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and are confident the content is safe.<br class=""><br class=""><br class=""> Hi Anne-Frances,<br class=""> There is no way to populate the MD plots from a command script, sorry. You would just use the GUI (MD Movie menu: Analysis... Plot), select the two atoms (for a distance) or 3-4 atoms (for an angle) and then it will be plotted across the whole trajectory:<br class=""> <<a href="https://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/movie/movie.html#plotting" class="">https://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/movie/movie.html#plotting</a>><br class=""><br class=""> Once you create a distance monitor it is persistent across trajectory frames and will continue to display the updated distance while the trajectory plays. If you really wanted to do it in a per-frame command script and measure distance at each trajectory frame (each value reported in the Reply Log) you could use ~distance command at each frame to remove all the distance monitors after they are added. E.g.<br class=""><br class=""> distance :1058@O2 :741@ND1<br class=""> distance :730@OH :741@NE2<br class=""> distance :721@OG1 :1058@N5<br class=""> distance :718@O :1058@N3<br class=""> distance :721@N :1058@O4<br class=""> distance :722@N :1058@O4<br class=""> distance :720@N :1058@O4<br class=""> distance :740@O :720@N<br class=""> ~distance<br class=""><br class=""> But then you would need to save Reply Log and process its contents and then put it into some other graphing program if you wanted a plot. This would be a pain since you have lots of different distances. If you want a plot, or even the values in some convenient form for plotting with another program, then probably the way to go is using the GUI from the MD Movie menu.<br class=""><br class=""> I hope this helps,<br class=""> Elaine<br class=""> -----<br class=""> Elaine C. Meng, Ph.D.<br class=""> UCSF Chimera(X) team<br class=""> Department of Pharmaceutical Chemistry<br class=""> University of California, San Francisco<br class=""><br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On Dec 10, 2021, at 12:06 AM, Anne-Frances Miller via Chimera-users <<a href="mailto:chimera-users@cgl.ucsf.edu" class="">chimera-users@cgl.ucsf.edu</a>> wrote:<br class=""><br class="">Dear Chimera support,<br class=""><br class="">I want to extract a set of distances and one angle from each snapshot of an MD trajectory (there are 11 of them).<br class="">My plan was to have all my distances appear in one of the MD-movie analysis>plot distances windows and use ‘Dump Values’ to get my numbers out in a way I could use for other plots.<br class="">I realize angles cannot appear in the same plot, but hope I can measure an angle in the same script.<br class=""><br class="">I have a ‘per-frame’ script that runs fine on the first frame, however it returns ‘Problem in per-frame script: Distance monitor already exists’ when I step forward to a second frame.<br class=""><br class="">Nothing appears in a 'MD plots' window (such a window does not open on its own either).<br class="">Reply Log shows the correct distances for the first frame but then only repeats the error after that.<br class="">Problem in per-frame script:<br class="">Distance monitor already exists<br class=""><br class="">My work-flow:<br class="">Open MD/movie, load my trajectory<br class="">open analysis, Per-Frame<br class="">copy my script into the window (chimera commands)<br class="">click ‘apply' in the script window, click ‘play’ or step forward one frame in the MD GUI (looping disabled)<br class=""><br class="">My script:<br class="">~disp<br class="">~ribbon<br class="">disp :718,720,721,722,730,740,741,1058<br class="">distance :1058@O2 :741@ND1<br class="">distance :730@OH :741@NE2<br class="">distance :721@OG1 :1058@N5<br class="">distance :718@O :1058@N3<br class="">distance :721@N :1058@O4<br class="">distance :722@N :1058@O4<br class="">distance :720@N :1058@O4<br class="">distance :740@O :720@N<br class="">angle :1058@C2 :1058@O2 :741@HD1 :741@ND1<br class=""><br class="">Reply Log output:<br class="">Distance between FDM 1058 O2 and HID 741 ND1: 2.8<br class="">Distance between TYR 730 OH and HID 741 NE2: 2.8<br class="">Distance between THR 721 OG1 and FDM 1058 N5: 3.4<br class="">Distance between ILE 718 O and FDM 1058 N3: 3.2<br class="">Distance between THR 721 N and FDM 1058 O4: 2.9<br class="">Distance between GLY 722 N and FDM 1058 O4: 3.2<br class="">Distance between GLN 720 N and FDM 1058 O4: 3.2<br class="">Distance between GLN 740 O and GLN 720 N: 3.0<br class="">Dihedral #0:1058@C2 #0:1058@O2 #0:741@HD1 #0:741@ND1: -51.0515<br class="">Problem in per-frame script:<br class="">Distance monitor already exists<br class=""><br class="">Thank you for any assistance,<br class="">Anne-Frances<br class=""></blockquote><br class=""><br class=""> _______________________________________________<br class=""> Chimera-users mailing list: <a href="mailto:Chimera-users@cgl.ucsf.edu" class="">Chimera-users@cgl.ucsf.edu</a><br class=""> Manage subscription: <a href="https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" class="">https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a><br class=""><br class=""><span id="cid:28EDC7CFA336AA4790E249DD55F3BCDB@namprd09.prod.outlook.com"><Distances_figures.jpg></span></div></div></blockquote></div><br class=""></div></body></html>