Hydrogend bond calculated as a function of radial distance

Hi, it is me once again,
I am very interested in calculating the number of hydrogen bonds for some groups in my polymer system as a function of the radial distance. I would like to select two different shells, the first and second hydration shell which are defined based on results from the radial distribution function. That means,a) select the oxygens and calculate hydrogen bonds with water up to a distance of 4nm and b) from 4nm to 10nm.

So, I was wondering if there is any script or idea available to do this.

thank you very much
Answers 6
ST
ST 2010-07-06

Hi Javier,

Another interesting application of scripting! I don't have a script that will do this particular task but you could modify the script to calculate coordination number as a function of radial distance.

At each oxygen atom, you can go through the hydrogen bonds and calculate the distance from the atoms at the end of the hydrogen bond to the oxygen atom. You can get the atoms at the end of the hydrogen bond using something like:

foreach my $hbond (@{$doc->UnitCell->HydrogenBonds}) { my $atom1 = $hbond->Atom1; my $atom2 = $hbond->Atom2; }


From this you can get the X, Y and Z coordinates using:

 my $atom1x = $atom1->X;


Then you can simply calculate the distances and increment a counter if the distance is in within your cutoff.

You will have to watch out for periodic boundary conditions but these are dealt with in the script linked from above.

As a further enhancement, you could probably increase the speed by reading all the hydrogen bond atom detail into an array initially and then just calling it from the array.

I hope this is useful.

Cheers

Stephen

JS
JS 2007-03-01
Thanks a lot for your suggestions, they are very useful and as soon as I finish the script I will post it.


have a good day

Javier
ST
ST 2007-03-01
Hi Javier,

I just had a quick go this morning at modifying the coordination number by radial distance script to work with an array of values for the coordinating atom, and it improved performance by about 30% on my test system. There are some more improvements that I can do so will try and get them done this weekend.

The speed obviously comes at a trade-off and that is I lose the ability to change the display style of the coordinating atoms in the study table but I don't think this will matter so much for you. I think the workaround here is to store the reference to the atom in the array as well as the coordinates but I haven't tried that yet.

Cheers

Stephen
JS
JS 2007-03-01
Thanks Stephen, it sound great to me!!!
I am looking forward to see that script.

In your website where is the option to rate the posts?

thanks and have a good day
Javier
ST
ST 2007-03-01
Hi Javier,

For rating posts, if you got to the top of this thread, there is the blue bar going across the screen. On the right hand side is where you logout and on the left hand side is Rate It!

Just click on Rate It!

Cheers

Stephen
ST
ST 2007-03-02
Hi Javier,

I have finished the updates to the coordination number by radial distance script.

It is now many times faster than the original version.

Please go ahead and re-write this to work for hydrogen bonds instead of coordinating atoms!

Cheers

Stephen