VMD-L Mailing List
From: Vermaas, Josh (vermaasj_at_msu.edu)
Date: Fri May 28 2021 - 10:49:25 CDT
- Next message: Nathan Kern: "Re: Atom selection with asterisk atom name"
- Previous message: Vermaas, Josh: "Re: Atom selection with asterisk atom name"
- Maybe in reply to: Vermaas, Josh: "Re: Atom selection with asterisk atom name"
- Next in thread: Nathan Kern: "Re: Atom selection with asterisk atom name"
- Reply: Nathan Kern: "Re: Atom selection with asterisk atom name"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi Saikat,
Please keep the mailinglist in your replies for context. In scripts, the quotes need to be escaped, otherwise Tcl can’t determine where the strings begin and end. Try:
set sel1 [atomselect top "name \"C5.*\" \"C4.*\" \"O4.*\"”]
When answering questions of which selection is correct, you can try things like “puts [$sel2 num]”. Does it give a reasonable output? My guess is that it didn’t, since I suspect that no atoms matched the sel2 selection you wrote, since single quotes won’t use regular expressions.
-Josh
From: Saikat Pal <saikatpaliitg_at_yahoo.com>
Date: Friday, May 28, 2021 at 11:38 AM
To: "Vermaas, Josh" <vermaasj_at_msu.edu>
Subject: Re: vmd-l: Atom selection with asterisk atom name
Thank you for your kind reply. I want to use it in tcl script. So when I have tried the following command:
set sel1 [atomselect top "name "C5.*" "C4.*" "O4.*"]
It shows error:
extra characters after close-quote
But when I have used:
set sel2 [atomselect top "name 'C5.*' 'C4.*' 'O4.*'"]
There is no error. So my question is it correct?
Thanks and Regards,
Saikat Pal
On Wednesday, 26 May, 2021, 10:33:01 pm IST, Vermaas, Josh <vermaasj_at_msu.edu> wrote:
Hi Saikat,
This is in the user guide. https://www.ks.uiuc.edu/Research/vmd/current/ug/node94.html
For your selection (anything starting with C1, C4, C5, or O5), I think it would simplify to this:
name “C[145].*” “O4.*”
-Josh
From: <owner-vmd-l_at_ks.uiuc.edu> on behalf of Saikat Pal <saikatpaliitg_at_REMOVE_yahoo.com>
Date: Wednesday, May 26, 2021 at 3:53 AM
To: VMD Mailing List <vmd-l_at_ks.uiuc.edu>
Subject: vmd-l: Atom selection with asterisk atom name
Dear all,
I want to select multiple atoms with asterisks like C5* C4* O4* C1*. So what should I do?
Thanks and Regards,
Saikat Pal