From: Justin Gullingsrud (jgulling_at_mccammon.ucsd.edu)
Date: Mon May 03 2004 - 03:35:50 CDT

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