From: Leonardo Trabuco (ltrabuco_at_ks.uiuc.edu)
Date: Mon Jun 02 2008 - 11:15:58 CDT

On Mon, Jun 02, 2008 at 04:01:49PM +0000, Claw Isthelaw wrote:
>
> Dear VMD Community,
>
> Given a list of integers (residue numbers) like:
> {1153 1134 1128 1194 1123}, how can I create an atomselection containing all of those residues. I'm trying to write out a PDB file containing the entire protein and a list of water residues. I've tried the following:
>
>
> ----------------------------------------------------------
> set watlist1 {1153 1134 1128 1194 1123}
>
> foreach resid $watlist1 {
> lappend watlist2 "resid $resid"
> }
>
> set watlist3 [join $watlist2 " or "]
>
> animate write pdb new.pdb sel [atomselect top "protein or [puts $watlist3]"]
> ---------------------------------------------------------
>
>
> I have tried some other things too. Is there an easier way to be doing this?

Yes.

set sel [atomselect top {protein or (water and resid 1153 1134 1128 1194 1123}]
$sel writepdb new.pdb

Best,
Leo

> Thanks,
> Jeff Tibbitt
>
> _________________________________________________________________
> E-mail for the greater good. Join the i’m Initiative from Microsoft.
> http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ GreaterGood
>

-- 
Leonardo Trabuco, Ph.D. student
Theoretical and Computational Biophysics Group
University of Illinois at Urbana-Champaign