From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Mon Jun 02 2008 - 11:08:16 CDT

On Mon, 2 Jun 2008, Claw Isthelaw wrote:

CI>
CI> Dear VMD Community,
CI>
CI> Given a list of integers (residue numbers) like:
CI> {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:

CI>
CI>
CI> ----------------------------------------------------------
CI> set watlist1 {1153 1134 1128 1194 1123}

set sel [atomselect top "resid 1152 1134 1128 1194 1123"]

should do fine.

a.

CI>
CI> foreach resid $watlist1 {
CI> lappend watlist2 "resid $resid"
CI> }
CI>
CI> set watlist3 [join $watlist2 " or "]
CI>
CI> animate write pdb new.pdb sel [atomselect top "protein or [puts $watlist3]"]
CI> ---------------------------------------------------------
CI>
CI>
CI> I have tried some other things too. Is there an easier way to be doing this?
CI> Thanks,
CI> Jeff Tibbitt
CI>
CI> _________________________________________________________________
CI> E-mail for the greater good. Join the i?m Initiative from Microsoft.
CI> http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ GreaterGood
CI>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.