Re: How can I calculate the distance between two atoms frame by frame?

From: Grace Brannigan (grace_at_vitae.cmm.upenn.edu)
Date: Sun Oct 19 2008 - 01:39:03 CDT

Hi Stanley,

In general followup questions should be addressed to the list as well.

I want to monitor the H-bonds by detecting the distance between the donor
> and the acceptor with the script you modified,but not consider the impact of
> the angle.Do you think it is rational?
>

I'm not sure why you couldn't do this just by using

measure hbonds cutoff angle sel1 sel2

but where "angle" is set to a large angle - up to 180 degrees should work, I
think. Since this is the cutoff angle, you will be considering all hbonds
with distance < cutoff and angle < 180 - i.e. angle won't matter.

However, I'm not sure if it really makes sense to do this (ignore the
angle). The angle tells you that you are seeing a dipole-dipole interaction,
which is what makes it a hydrogen bond, afterall.

-grace

In general followup questions should be addressed to the list
On Sun, Oct 19, 2008 at 1:11 AM, wayj86 wayj86 <wayj86_at_gmail.com> wrote:

> Hi,Grace,thank you very much for your reply.I want to monitor the H-bonds
> by detecting the distance between the donor and the acceptor with the script
> you modified,but not consider the impact of the angle.Do you think it is
> rational?
>
>
>
>
> 2008/10/19 Grace Brannigan <grace_at_cmm.upenn.edu>
>
> Hi Stanley,
>>
>> This is best addressed to the VMD list, not the NAMD list.
>>
>> However, the problem with your script is that you do not have the "frame"
>> flag before "$i" - the correct syntax is
>>
>> puts $outfile "[measure bond {6086 2421} frame $i]"
>>
>> The $sel frame $i command does nothing because you are not passing that
>> $sel to the measure command. Also, if you just use the command
>>
>> measure bond {index1 index2} frame all
>>
>> it will return a list of the bond over all frames, so there is no need to
>> make an explicit loop the way you are doing. You can then just write that
>> list to a file.
>>
>> -Grace
>>
>>
>> On Sat, Oct 18, 2008 at 10:15 PM, wayj86 wayj86 <wayj86_at_gmail.com> wrote:
>>
>>> Dear NAMD users,
>>>
>>> I was trying to calculate the distance between two atoms frame by frame
>>> with the VMD's function bond and the scripts below was something wrong:
>>>
>>> set outfile [open distance.dat
>>> w];
>>> set nf [molinfo top get numframes]
>>> set sel [atomselect top "protein"]
>>> # rmsd calculation loop
>>> for {set i 1 } {$i < $nf } { incr i } {
>>> $sel frame $i
>>> puts $outfile "[measure bond {6086 2421} $i]"
>>> }
>>> close $outfile
>>>
>>> With this script I can only get the distance of the present frame.So
>>> could you please tell me how should I modify my script?Thank you so much for
>>> any help.
>>>
>>>
>>> Best wishes,
>>> Stanley
>>>
>>> --
>>> The future is now!
>>>
>>
>>
>
>
> --
> The future is now!
>

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 05:21:24 CST