From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Jul 27 2005 - 11:47:32 CDT

You might find it easier to generate the atom selection text with a
call to the Tcl "format" proc first, something like:
  set seltext [format "resid 5 and chain %s and not name [0-9]?H.*" $names($i)]

I didn't check, but you should make sure that you're properly escaping
your regular expression there. This is discussed in the User's Guide here:
  http://www.ks.uiuc.edu/Research/vmd/vmd-1.8.3/ug/node81.html#4997

  John Stone
  vmd_at_ks.uiuc.edu

On Wed, Jul 27, 2005 at 06:18:53PM +0200, Ramon Crehuet wrote:
> Hi all,
> I have a problem writing a tcl script. The following line
>
> set sel [atomselect top "resid 5 and chain $names($i) and not name
> "[0-9]?H.*" "]
>
> gives the error:
> extra characters after close-quote
> Looking at previous e-mail from the list, I tried:
>
> set sel [atomselect top {resid 5 and chain $names($i) and not name
> "[0-9]?H.*" }]
>
> but then I get:
> ERROR) Selection terminated too early
> syntax error
> atomselect: cannot parse selection text: chain $names($i) and resid 5 to
> 114 and not name "[0-9]?H.*"
>
> It's a pity because these two work:
> set sel [atomselect top "chain $names($i) "]
> set sel [atomselect top {resid 5 and not name "[0-9]?H.*"}]
>
> but I don't know how to combine them...
> Cheers,
>
> Ramon
>
>
> PS. names is an array defined as:
> array set names {0 A 1 B 2 C 3 D 4 E 5 F}

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