From: Josh Vermaas (vermaas2_at_illinois.edu)
Date: Tue Feb 25 2014 - 21:44:09 CST

Hi Jacob,
Argh. Well, I guess a single atomselection isn't the way to go. Having
made enough of a fool of myself, this is code I've actually tested.
It'll work, but its a tkcon solution, not an atomselection one (so you
can't directly visualize it).

set lists [measure contacts 0.5 [atomselect top "noh"]]
foreach i [lindex $lists 0] j [lindex $lists 1] {
puts "Atom $i clashes with atom $j"
}

Alternatively, this will give you all the ids that are part of clashes
(which you can then visualize with "index")
lsort -unique -increasing -integer [join [measure contacts 0.5
[atomselect top "noh"]]]

The real solution would be to hack together something very similar to
within ("cwithin" or "contactwithin") that takes advantage of gridsearch
so it doesn't need to calculate O(n^2) distances to detect clashes. It
may already exist within the atomselection language, but I'm unaware of
it. :(

Hope this is more useful than my tautologically empty selections. :D
-Josh

On 02/25/2014 08:56 PM, Jacob Durrant wrote:
> Thanks for your help with this, Josh. Unfortunately, that selection
> didn't identify the steric clashes either. The selection was again
> empty. If I'm not mistaken, these are all equivalent:
>
> noh and within 0.5 of noh and not within 0.00000000001 of noh
> noh and (within 0.5 of noh) and (not within 0.00000000001 of noh)
> noh and noh and (not within 0.00000000001 of noh)
> noh and noh and (not noh)
> noh and not noh
>
> Which is why the selection was empty.
>
> I'd really appreciate any other ideas. Detecting steric clashes is a
> pretty common task. It would be wonderful if I didn't have to write my
> own code to detect them, especially since VMD's selection code is so
> fast, even on large systems.
>
> Thanks,
>
> Jacob
>
>
>
>
> On Tue, Feb 25, 2014 at 7:28 PM, Josh Vermaas <vermaas2_at_illinois.edu
> <mailto:vermaas2_at_illinois.edu>> wrote:
>
> Hi Jacob,
>
> Ahh... Right. I use exwithin on single residues, so in that case
> it works as I explained, however the exwithin line I gave you is
> logically equivalent to "noh and within 0.5 of noh and not noh",
> which will always yield an empty selection. :( How about "noh and
> within 0.5 of noh and not within 0.00000000001 of noh"? This
> detects steric clashes where the atoms are not literally on top of
> one another. This is probably good enough for most instances, so
> long as you remember that if psfgen can't guess a position, it
> puts the atom at the origin, and so you should also make sure the
> number of atoms at the origin isn't greater than 1.
>
> -Josh
>
>
> On 02/25/2014 12:28 AM, Jacob Durrant wrote:
>> Hi all. Thanks for your help with this. I'm still having some
>> troubles. To test these selections, I downloaded a PDB and
>> intentionally moved the atom of one residue so it's very close to
>> an atom of another (a steric clash).
>>
>> The selection ((noh within 0.5 of noh) and not same residue as
>> 'residue') gave an error (atom selection could not be
>> understood). Same with ((noh within 0.5 of noh) and not same
>> residue as residue).
>>
>> The selection (noh and exwithin 0.5 of noh) didn't give an error,
>> but it didn't select anything, not even the two atoms that were
>> only 0.25 apart.
>>
>> In case it's helpful, I'm attaching the PDB with the steric clash
>> for testing. Thanks for your help!
>>
>> ~Jacob
>>
>>
>> On Sat, Feb 22, 2014 at 4:49 PM, Josh Vermaas
>> <vermaas2_at_illinois.edu <mailto:vermaas2_at_illinois.edu>> wrote:
>>
>> You are very close. noh and exwithin 0.5 of noh. "exwithin"
>> is basically the "within" keyword, but an atom is excluded
>> from its own within list.
>> -Josh Vermaas
>>
>>
>> On 02/21/2014 09:56 PM, Jacob Durrant wrote:
>>> Hi all. Is there an atom selection to identify steric
>>> clashes? At first I thought something like "noh within 0.5
>>> of noh" might work, but each atom is identified as being
>>> very near itself, so this section ends up being equivalent
>>> to "all".
>>>
>>> Thanks,
>>>
>>> Jacob
>>>
>>> --
>>> ==============================
>>> Jacob D. Durrant <https://amarolab.ucsd.edu/%7Ejdurrant/>, PhD
>>> Rommie E. Amaro Research Group <https://amarolab.ucsd.edu/>
>>> University of California, San Diego
>>>
>>> Connect with me on LinkedIn
>>> <http://www.linkedin.com/profile/view?id=94290749>
>>> jacobdurrant_at_gmail.com <mailto:jacobdurrant_at_gmail.com>
>>> jdurrant_at_ucsd.edu <mailto:jdurrant_at_ucsd.edu>
>>
>>
>>
>>
>> --
>> ==============================
>> Jacob D. Durrant <https://amarolab.ucsd.edu/%7Ejdurrant/>, PhD
>> Rommie E. Amaro Research Group <https://amarolab.ucsd.edu/>
>> University of California, San Diego
>>
>> Connect with me on LinkedIn
>> <http://www.linkedin.com/profile/view?id=94290749>
>> jacobdurrant_at_gmail.com <mailto:jacobdurrant_at_gmail.com>
>> jdurrant_at_ucsd.edu <mailto:jdurrant_at_ucsd.edu>
>
>
>
>
> --
> ==============================
> Jacob D. Durrant <https://amarolab.ucsd.edu/%7Ejdurrant/>, PhD
> Rommie E. Amaro Research Group <https://amarolab.ucsd.edu/>
> University of California, San Diego
>
> Connect with me on LinkedIn
> <http://www.linkedin.com/profile/view?id=94290749>
> jacobdurrant_at_gmail.com <mailto:jacobdurrant_at_gmail.com>
> jdurrant_at_ucsd.edu <mailto:jdurrant_at_ucsd.edu>