From: Norman Geist (norman.geist_at_uni-greifswald.de)
Date: Thu Jun 23 2016 - 01:22:06 CDT

Actually I don’t think so. Can you pls show us your selection text and describe in short what you expect to happen. The only thing you need to care about is, that you can only filter known macros in front of the within keyword, and need to filter the type later:

 

So wrong is:

 

element O within 10 of resid 5

 

Right is

 

(all within 10 of resid 5) and element O

 

Or define a new macro in terminal:

 

atomselect macro lol {element O}

 

Now you can do:

 

lol within 10 of resid 5

 

 

Norman Geist

 

Von: hallo_at_simonduerr.eu [mailto:hallo_at_simonduerr.eu] Im Auftrag von Simon Dürr
Gesendet: Mittwoch, 22. Juni 2016 18:18
An: Norman Geist <norman.geist_at_uni-greifswald.de>
Cc: VMD Mailing List <vmd-l_at_ks.uiuc.edu>
Betreff: Re: vmd-l: Selecting atoms of same type in a certain distance (between X and Y angstroms away)

 

Hi Norman,

i was not aware of exwithin but I does not work either unfortunately.

 

Again I think the way how the type or element attribute are setup to work with "within" is the problem.

 

 

Simon Dürr

 <mailto:info_at_simonduerr.eu> info_at_simonduerr.eu

 

 

2016-06-22 16:58 GMT+01:00 Norman Geist <norman.geist_at_uni-greifswald.de <mailto:norman.geist_at_uni-greifswald.de> >:

Have you tried „exwithin“ instead?

 

Norman Geist

 

Von: owner-vmd-l_at_ks.uiuc.edu <mailto:owner-vmd-l_at_ks.uiuc.edu> [mailto:owner-vmd-l_at_ks.uiuc.edu <mailto:owner-vmd-l_at_ks.uiuc.edu> ] Im Auftrag von Simon Dürr
Gesendet: Mittwoch, 22. Juni 2016 15:43
An: VMD list <vmd-l_at_ks.uiuc.edu <mailto:vmd-l_at_ks.uiuc.edu> >
Betreff: vmd-l: Selecting atoms of same type in a certain distance (between X and Y angstroms away)

 

Hi,

 

I'm using VMD to search through some PDB files to see if there are other atoms present in a certain distance range.

 

Unfortunately this atomselect command does not work:

atomselect top "element Zn and within 5 of type ZN and not within 2 of type ZN"

 

it seems like the atom I'm comparing to is counted also by the within select method which makes the within part of the statement useless.

 

For example "atomselect top "type ZN and within 0 of type ZN" " is the same as "atomselect top "type ZN""

I would expect the first command to return zero results as there is not another atom of this type at exact the same place as the current atom

 

Is there any method to easily use atomselect commands to select atoms that are in a certain distance range of an atom of the same type or element?

The command that I'm searching for would be "atomselect top "type ZN and within X of ANOTHER type ZN"

 

I also tried the same commands with indexes but was only partly successful:

index 123 and within 5 of index 177 (gives me a result if the ion is 5 angstroms close)

index 123 and not within 5 of index 177 (gives me a result if the ion is not 5 angstroms close)

 

index 123 and within 5 of index 177 and not within 2 of index 177 ( gives me no result although ions are 4.5 angstroms apart)

index 123 and not within 2 of index 177 and within 4 of index 177 ( gives me a result although ions are 4.5 angstroms apart)

 

I'm using VMD 1.9.2 in the LINUX_64 OpenGL, CUDA version

​. ​

 

 

Cheers,

Simon