From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Sep 24 2014 - 13:56:29 CDT

Hi,
  You can use the "measure minmax" command to compute the box instead of
using your awk/sed scripts. To exclude residues where at least one atom
falls outside the box, you could use a combination of boolean operators
to achieve this, such as:
  "not (same residue as (...))"
where the ... would select atoms _outside_ the box...
This selection scheme excludes residues rather than keeping them, so you
have to invert the box selection operators.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Wed, Sep 24, 2014 at 06:49:27PM +0000, Parker de Waal wrote:
> Hi John,
>
> Thank you again for your help. I was able to successfully create the box using the following steps:
>
> 1. Get dimensions of protein
> set sel [atomselect top "protein"]
> set file [open "myoutput.dat" w]
> puts $file [ $sel get {x y z} ]
> close $file
>
> 2. Clean file and calculate min/max {x y z} using awk
> sed 's: {:\n{:g' myoutput.dat | sed 's/{//' | sed 's/}//' > splitResults
>
> 3. Select box area using your script provided below and write to pdb.
>
> However I still have one question: In the final box some lipids are copied over because 1 atom was present within the selection box. Is there a way to only select atoms if the whole residue is present within the box? Or ideally even 50-75% of the atom within the box?
>
> Best,
> Parker
>
> ________________________________________
> From: John Stone [johns_at_ks.uiuc.edu]
> Sent: Tuesday, September 23, 2014 11:02 PM
> To: Parker de Waal
> Cc: vmd-l_at_ks.uiuc.edu
> Subject: Re: vmd-l: Atom Selection Rectangle
>
> Hi,
> Please read these pages of the documentation as a starting point:
> http://scanmail.trustwave.com/?c=129&d=vbSi1LMWG_bO4lRVqRlf56WNDLcVeUXzL644-fyFUA&u=http%3a%2f%2fwww%2eks%2euiuc%2eedu%2fResearch%2fvmd%2fvmd-1%2e9%2e1%2fug%2fnode88%2ehtml
> http://scanmail.trustwave.com/?c=129&d=vbSi1LMWG_bO4lRVqRlf56WNDLcVeUXzL_xspqzRVA&u=http%3a%2f%2fwww%2eks%2euiuc%2eedu%2fResearch%2fvmd%2fvmd-1%2e9%2e1%2fug%2fnode96%2ehtml
>
> You want to use a combination of coordinate based selections and
> "same residue as", e.g.:
>
> set seltext "same residue as (x > 0 and x < 30 and y > 0 and y < 30 and z > 0)"
> set sel [atomselect top $seltext]
> $sel writepdb box.pdb
>
> Cheers,
> John Stone
>
> On Wed, Sep 24, 2014 at 02:49:32AM +0000, Parker de Waal wrote:
> > Hi John,
> >
> > Thanks for the tip. Unfortunately after looking for about 30 minutes or so
> > minutes Išve been unable to find any previous mailings or any guides
> > online regarding similar tasks.
> >
> > If you could point me in a more specific direction I would greatly
> > appreciate it.
> >
> > Best,
> > Parker
> >
> > On 9/23/14, 10:00 PM, "John Stone" <johns_at_ks.uiuc.edu> wrote:
> >
> > >You can use VMD atom selections based on the atom coordinates along
> > >with "same residue as" to achieve what you're looking for. There are
> > >many examples in the user's guide and past mailing list discussions that
> > >will likely prove useful.
> > >
> > >Cheers,
> > > John Stone
> > > vmd_at_ks.uiuc.edu
> > >
> > >On Wed, Sep 24, 2014 at 01:27:08AM +0000, Parker de Waal wrote:
> > >> Hello everyone,
> > >>
> > >> I?ve recently been working with membrane protein simulations, generated
> > >>by the CHARMM-GUI membrane builder and simulated in AMBER, and am trying
> > >>to figure out a way to trim down on excess system padding (resulting
> > >>from the unoptimized GUI).
> > >>
> > >> What I would like to do is be able to take the generated
> > >>protein/membrane PDB, select a rectangular region with origin x,y,z and
> > >>dimensions a,b,c, and then delete everything else that doesn?t fall
> > >>within that selection. This way I can reduce my atom count and help get
> > >>more ns/day for the simulation.
> > >>
> > >> Does anyone know if this is possible in VMD, or perhaps another tool?
> > >>
> > >> Best,
> > >> Parker
> > >
> > >--
> > >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://scanmail.trustwave.com/?c=129&d=s6Wi1Hp7VloVfkj1Q83fK7h4d9Pv3sBKQb9
> > >kZ5A_2g&u=http%3a%2f%2fwww%2eks%2euiuc%2eedu%2f%7ejohns%2f
> > >Phone: 217-244-3349
> > >http://scanmail.trustwave.com/?c=129&d=s6Wi1Hp7VloVfkj1Q83fK7h4d9Pv3sBKQb9
> > >jYJNrhA&u=http%3a%2f%2fwww%2eks%2euiuc%2eedu%2fResearch%2fvmd%2f
> >
>
> --
> 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://scanmail.trustwave.com/?c=129&d=vrSi1GL-9z6MhEpQHzna3lrB6sMz3R7taCa2_QWpgw&u=http%3a%2f%2fwww%2eks%2euiuc%2eedu%2f%7ejohns%2f Phone: 217-244-3349
> http://scanmail.trustwave.com/?c=129&d=vrSi1GL-9z6MhEpQHzna3lrB6sMz3R7taCax-gb93Q&u=http%3a%2f%2fwww%2eks%2euiuc%2eedu%2fResearch%2fvmd%2f

-- 
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/