From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Thu Sep 14 2006 - 13:12:56 CDT

On 9/14/06, Nitin Bhardwaj <nbhardwaj_at_gmail.com> wrote:
> Dear all,
> I am trying to find what residues of the protein form Hbonds with
> the surrounding lipids. I have the following script that counts the
> number of Hbonds. But I do not know how can I change it give me the
> resid of the residues from the protein involved.

please check out the documentation on measure hbonds.
as a result you get lists of the atom indices that are h-bond
donor, acceptors, and the hydrogen involved. with those lists
you can create a new selection using index and then
query that selection for the resid.

btw.: why do you create two sets of selections?
set nhb1 [llength [lindex [measure hbonds 3.6 60 $d1 $a1] 0]]
set nhb2 [llength [lindex [measure hbonds 3.6 60 $a1 $d1] 0]]
should work just as well.

cheers,
   axel.

>
>
> thanks a lot.
> Rgds,
> Nitin
>
>
> set d1 [atomselect $mol "protein"]
> set a1 [atomselect $mol "resname POP"]
> set d2 [atomselect $mol "resname POP"]
> set a2 [atomselect $mol "protein"]
> for {set i 0} {$i < 2} {incr i} {
> $d1 frame $i
> $a1 frame $i
> $d2 frame $i
> $a2 frame $i
> set nhb1 [llength [lindex [measure hbonds 3.6 60 $d1 $a1] 0]]
> set nhb2 [llength [lindex [measure hbonds 3.6 60 $d2 $a2] 0]]
> set nhb [expr $nhb1 +$nhb2]
> puts "number of h-bonds in frame $i : $nhb"
> }
>
>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
  Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.