From: Eduardo Cruz-Chu (chucruz_at_ks.uiuc.edu)
Date: Tue Jul 22 2008 - 11:21:42 CDT

you can use equations in your selection. For instance, to select a
cylindrical region of radius R around a point (Xcenter,Ycenter) in the
frame F

set sel [ atomselect top "(x-$Xcenter)*(x-$Xcenter) +
(y-$Ycenter)*(y-$Ycenter) < $R*$R" frame $F ]

you can limit the region of the cylinder adding extra equations in the Z
direction.

If your benzene ring is moving, you should play with the equations (find
the center of the ring, can use the middle point between 2 carbons, and
the normal to the ring plane, can use three carbons).

About your selection, just try:

set xA [ atomselect 0 "index 0" frame $F ]
$xA get x

or

$xA get { x y z }

that should work

cheers;

Eduardo

On Tue, 22 Jul 2008, Ignacio Fernández Galván wrote:

> Hi all,
>
> I have a system consisting of an aromatic molecule and number of solvent molecules. I'd like to select the solvent molecules which are more or less solvating both sides of the benzene ring, that is, located perpendicular to the plane of the ring and at a distance of say 4Ĺ at most.
>
> Just using the "within" keyword is not enough, because it selects based on a spherical cutoff, and I want a kind of cylindrical region. I got more or less what I want by using "(within 4 of C1) and (within 4 of C3) and (within 4 of C5)", where C1, C3 and C5 are the atoms in the benzene ring, this somewhat limits adequately the region, but this region gets narrower the farther from the ring it is, and that's not quite it.
>
> So, I decided to take it the hard way and play with the coordinates, thinking I could select all atoms whose distance to C1 is smaller than to H1, to C2 smaller than to H2, etc. But now the problem is... how can I reference the coordinates of specific atoms dynamically (they should be updated each frame)? If that's not possible, I'd have to store the coordinates in variables, which I did with "set xA [[atomselect 0 "index 0"] get x]", for instance, and then use $xA in the selection... but I must be doing something wrong, because it does not work: it behaves as if $xA = 0, although "puts $xA" says otherwise.
>
> I must be doing something wrong now, I'd be grateful for any help.
>
> Thanks,
> Ignacio
>
>
> __________________________________________________________
> Not happy with your email address?.
> Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html
>