From: peter.schmidtke_at_fr.netgrs.com
Date: Wed May 30 2012 - 02:00:24 CDT

Dear Axel and other respondents,

Thanks a lot for your hint. Indeed the equation of the sphere is the most elegant solution for what I need.

Cheers.

Peter

-----Message d'origine-----
De : owner-vmd-l_at_ks.uiuc.edu [mailto:owner-vmd-l_at_ks.uiuc.edu] De la part de Pawel Kedzierski
Envoyé : jeudi 24 mai 2012 19:45
À : vmd-l_at_ks.uiuc.edu
Objet : Re: vmd-l: TR: VMD atomselect with cartesian reference

W dniu 24.05.2012 16:13, Axel Kohlmeyer pisze:
> On Thu, May 24, 2012 at 9:16 AM,<peter.schmidtke_at_fr.netgrs.com> wrote:
>> Dear VMD users/developers,
>>
>>
>>
>> I’d like to create a selection of atoms that is within a given
>> distance from a point in 3D cartesian space (not a molecular object, atom or whatsoever).
>>
>>
>>
>> How can this be achieved in VMD/tcl? I’ve been searching around for
>> documentation but was fairly unsuccessful.
>>
>> Basically I’d like to do something like :
>>
>> atomselect top “protein within 20.0 of {-1 1 0}”
>>
>>
>>
>> Where {-1 1 0} is the cartesian coordinate from which I’d like to do
>> the measure.
> nope. you can't do this. "within X of Y" requires Y to be a selection
> of atoms. please see the documentation. computer software is brutally
> literal.
> it doesn't know how to do "the reasonable thing(tm)".
>
> what you *can* do is math with the coordinates.
> for example you can try this (untested):
>
> atomselect top "protein and ( ((x+1.0)*(x+1.0)+(y-1.0)*(y-1.0) + z*z)< 400.0)"
Or:
1. Add to your system, for example to the PDB file, a residue X with single atom X positioned where you want it; 2. Of course you will want to omit this atom from display with 'not resname X' or 'not name X' in the selection; 3. Then you simply use selection 'within 20 of name X and not name X' or so; 4. And using the move command for selection, you can position your reference atom X wherever you want.
HTH,
Pawel

>
> cheers,
> axel.
>
>>
>>
>> Thanks in advance for your help.
>>
>>
>>
>> Best regards.
>>
>>
>>
>> Peter Schmidtke
>
>