<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Also, this could be accomplished more directly by using an MD Movie per-frame Python script, like so:<div><br></div><div>if not hasattr(chimera, 'hbCounts'):</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># each execution of script is in new namespace,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># so store counts somewhere permanent</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>chimera.hbCounts = {}</div><div>from FindHBond import findHBonds, recDistSlop, recAngleSlop</div><div>hbs = findHBonds([mdInfo['mol']], distSlop=recDistSlop, angleSlop=recAngleSlop, cacheDA=True)</div><div>selected = set(chimera.selection.currentAtoms())</div><div>for hb in hbs:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if len([da for da in hb if da in selected]) == 1:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># exactly one end selected</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if hb[0] in selected:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ra = hb[1]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>else:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ra = hb[0]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>chimera.hbCounts[ra] = chimera.hbCounts.get(ra, 0) + 1</div><div><br></div><div>To use the above, you would delete all atoms except for the ligand and receptor from your trajectory, select the ligand, and then loop through your trajectory once. This will populate the chimera.hbCounts dictionary. To dig out the data from that dictionary you will need to open the IDLE environment (General Controls->IDLE) and type:</div><div><br></div><div>for a, count in chimera.hbCounts.items():</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>print a, count</div><div><br></div><div>If you are at all conversant with Python, it is also trivial to sort the counts or to write the hbCounts info to a file.</div><div><br></div><div>--Eric</div><div><br></div><div><div><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> Eric Pettersen</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> UCSF Computer Graphics Lab</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> <a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></div></div></span></div><div><div><br></div><div> On Sep 13, 2010, at 9:13 AM, Elaine Meng wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi George,<div>There is a FindHBond tool and findhbond command -- when you are showing a trajectory in the MD Movie tool (could be from Amber or any of several other programs), you can use the "per-frame script" feature in that tool to run the calculation at each step and save the results.</div><div><br></div><div>Please see these previous posts for more details on doing that:</div><div><<a href="http://plato.cgl.ucsf.edu/pipermail/chimera-users/2010-January/004736.html">http://plato.cgl.ucsf.edu/pipermail/chimera-users/2010-January/004736.html</a>></div><div><<a href="http://plato.cgl.ucsf.edu/pipermail/chimera-users/2010-January/004751.html">http://plato.cgl.ucsf.edu/pipermail/chimera-users/2010-January/004751.html</a>></div><div><br></div><div>It sounds like you would need to save a file listing the hbonds at each step, and then do some of your own postprocessing or analyses on these output files to determine how many times each hbond is found. Currently there is no built-in function to do that part.</div><div><br></div><div>I hope this helps,</div><div>Elaine<br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div><div>----------</div><div>Elaine C. Meng, Ph.D. </div><div>UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab</div><div>Department of Pharmaceutical Chemistry</div><div>University of California, San Francisco</div><div><br></div></div></span></div><div><div>On Sep 13, 2010, at 7:02 AM, George Tzotzos wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi everybody,<div>I wonder is there's a way that Chimera produces <b>hbond occupancy statistics from amber trajectory files</b>. </div><div>I can produce hbond information between a ligand and a receptor molecule frame by frame. As the ligand forms hbonds with different amino acid residues in the binding site during the trajectory, I'd like to work out which ones are the most frequently formed.</div><div>Thanks in advance for your advice</div><div>Best regards</div><div>George</div></div></blockquote></div><br></div></div>_______________________________________________<br>Chimera-users mailing list<br><a href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</a><br>http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users<br></blockquote></div></div><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="font-size: medium;"><br></span><br class="Apple-interchange-newline"></div></span> </div><br></body></html>