From: Ahmet Bakan (abakan_at_ku.edu.tr)
Date: Mon May 03 2004 - 05:56:25 CDT

Hi Justin and All,

I need the index of the single atom that hydrogen is bonded to.
Like this
-NH-CH2-CO-O-
I have the index of H bonded to N, hundereds of H similar indices.
I need index of N atom in this example.

I tried this:
set HATOM [atomselect top "index 547"]
Result: H
set connected [atomselect top "same residue as ([$HATOM text])"]
Result: NH1 H CT1 HB CT2 HA HA CT2 HA HA CC O NH2 H H C O
set connected [atomselect top "same bond as ([$HATOM text])"]
Result: nothing happens

Does anyone have idea?
Thanks,

Ahmet

==========ABC==========
Ahmet Bakan
Chemistry, Junior
Koc University
abakan_at_ku.edu.tr
ICQ #86167698
http://home.ku.edu.tr/~abakan

-----Original Message-----
From: Justin Gullingsrud [mailto:jgulling_at_mccammon.ucsd.edu]
Sent: Monday, May 03, 2004 11:36 AM
To: Ahmet Bakan
Cc: VMD-L
Subject: Re: vmd-l: Selection problem on TkCon

Hi,

On Mon, May 03, 2004 at 03:55:43AM +0300, Ahmet Bakan wrote:
> Hi All,
>
>
>
> I have a selection of Hydrogen atoms and I want to get the list of atoms
> that Hydrogens in my selection are attached to. How can this be done on
> TkCon?

I assume you have a selection that you created from the text console,
something like this:

  set sel [atomselect top "hydrogen and resname ALA"]

Whatever the selection is, you can find all the atoms in the same
residue as the selection by typing the following:

  set connected [atomselect top "same residue as ([$sel text])"]

You can then write out a list of atoms in the selection to a file with:

  set fd [open connatoms.ind w]
  foreach ind [$connected list] { puts $fd $ind }
  close $fd

Note that the indicies written to the file will be one smaller than the
corresponding atom in a pdb file; i.e., they will be 0-based rather than
1-based.

Cheers,
Justin

>
>
>
> Cheers,
>
> Ahmet
>
>
>
> ==========ABC==========
>
> Ahmet Bakan
>
> Chemistry, Junior
>
> Koc University
>
> abakan_at_ku.edu.tr
>
> ICQ #86167698
>
> http://home.ku.edu.tr/~abakan
>
>
>

-- 
Tenth is 10 spots too low as far as I'm concerned.  -- George W. Bush