[Chimera-users] MD trajectory hbond analysis

Eric Pettersen pett at cgl.ucsf.edu
Mon Sep 13 11:09:30 PDT 2010

Also, this could be accomplished more directly by using an MD Movie  
per-frame Python script, like so:

if not hasattr(chimera, 'hbCounts'):
	# each execution of script is in new namespace,
	# so store counts somewhere permanent
	chimera.hbCounts = {}
from FindHBond import findHBonds, recDistSlop, recAngleSlop
hbs = findHBonds([mdInfo['mol']], distSlop=recDistSlop,  
angleSlop=recAngleSlop, cacheDA=True)
selected = set(chimera.selection.currentAtoms())
for hb in hbs:
	if len([da for da in hb if da in selected]) == 1:
		# exactly one end selected
		if hb[0] in selected:
			ra = hb[1]
			ra = hb[0]
		chimera.hbCounts[ra] = chimera.hbCounts.get(ra, 0) + 1

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:

for a, count in chimera.hbCounts.items():
	print a, count

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.


                         Eric Pettersen
                         UCSF Computer Graphics Lab

On Sep 13, 2010, at 9:13 AM, Elaine Meng wrote:

> Hi George,
> 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.
> Please see these previous posts for more details on doing that:
> <http://plato.cgl.ucsf.edu/pipermail/chimera-users/2010-January/004736.html 
> >
> <http://plato.cgl.ucsf.edu/pipermail/chimera-users/2010-January/004751.html 
> >
> 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.
> I hope this helps,
> Elaine
> ----------
> Elaine C. Meng, Ph.D.
> UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
> Department of Pharmaceutical Chemistry
> University of California, San Francisco
> On Sep 13, 2010, at 7:02 AM, George Tzotzos wrote:
>> Hi everybody,
>> I wonder is there's a way that Chimera produces hbond occupancy  
>> statistics from amber trajectory files.
>> 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.
>> Thanks in advance for your advice
>> Best regards
>> George
> _______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20100913/f39ef55b/attachment.html>

More information about the Chimera-users mailing list