From: Bennion, Brian (bennion1_at_llnl.gov)
Date: Tue Jan 13 2015 - 12:23:11 CST

Hello John and Axel
This withinbonds selection keyword does what I need it to do.
The psuedo script is also helpful in getting things straight, the double variable foreach loop didn't occur to me. With some minor tweaking it will also work.
Thank you for both your help.

I am cc'ing John in case the email gets truncated again.
Brian

________________________________________
From: John Stone [johns_at_ks.uiuc.edu]
Sent: Monday, January 12, 2015 9:42 PM
To: Bennion, Brian; vmd-l_at_ks.uiuc.edu
Subject: Re: vmd-l: Re: FW: atomselection by wildcard and distance exclusion

Brian,
  If I've read your selection question correctly, I would suggest that
you try using the "withinbonds" selection keyword to solve your problem.
What about something like this (replace "ligand" with correct selection):
  ligand and oxygen and not withinbonds 1 of carbon

Cheers,
  John

On Mon, Jan 12, 2015 at 11:25:20PM -0600, John Stone wrote:
> Brian,
> Whatever is going amiss that caused your email truncation
> seems to have occured twice in a row now. Let's see if this reply makes
> it through unscathed or not, and then we can work on the selection issue.
>
> Cheers,
> John Stone
>
> On Tue, Jan 13, 2015 at 05:12:58AM +0000, Bennion, Brian wrote:
> > Hello All, I am not sure why my last email was truncated after the first
> > sentence. The text below was want was sent to me and cc'ed to the vmd-l
> > list.
> >
> > ---------------------------------------------------------------------------
> >
> > From: Bennion, Brian
> > Sent: Monday, January 12, 2015 4:57 PM
> > To: vmd-l_at_ks.uiuc.edu
> > Subject: atomselection by wildcard and distance exclusion
> > Hello All,
> >
> > After working on this for far too long I need to know what I am doing
> > wrong.
> >
> > I have a pdb file that contains a protein and a docked ligand. I want to
> > select one or more oxygen atoms on the ligand that is not bound to a
> > carbon. My ligand has oxygen atoms bound to nitrogen, hydrogen, and/or
> > hydrogen.
> >
> > There are two possible procedures one might explore to make the
> > atomselection.
> >
> > One might look at all the oxygen atoms and get a list of index values for
> > each atom that is returned in the lists from the atomselect0 getbonds
> > command and check for whether it is a carbon or not.
> > This might be called the analytical solution because if you iterate enough
> > you should get an atomselection that contains an oxygen atom that does not
> > have any bonds with a carbon atom.
> > Honestly I got lost in the foreach recursive searches.
> >
> > Second is a numerical approach that uses a distance constraint to
> > eliminate the selection of oxygen atoms that have other atoms within 1.5
> > angstrom.
> > I concentrated on this approach and obviously need to learn something
> > because my selection text is not returning what I expect to be the correct
> > result. Obviously it is just doing what I told it to do.
> >
> > One ligand molecule has 3 oxygen atoms. One oxygen is bound to two carbon
> > atoms with bond distances of <1.45A. One oxygen double bonded to a carbon
> > and the final oxygen atom is bound to a nitrogen and hydrogen atom.
> >
> > I want to eliminate all oxygen atoms bound to carbon:
> > set oxime [atomselect top "resname LIG and name \"O.*\" and same residue
> > as not within 1.5 of name \"C.*\" "]
> >
> > The command returns three oxygen atoms.
> > My logic is flawed in the selection text.
> > Any pointers to fix this?
> >
> > Thank you
> > Brian Bennion
>
> --
> NIH Center for Macromolecular Modeling and Bioinformatics
> Beckman Institute for Advanced Science and Technology
> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> http://www.ks.uiuc.edu/~johns/ Phone: 217-244-3349
> http://www.ks.uiuc.edu/Research/vmd/

--
NIH Center for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
http://www.ks.uiuc.edu/~johns/           Phone: 217-244-3349
http://www.ks.uiuc.edu/Research/vmd/