Opened 9 years ago
Last modified 9 years ago
#420 new enhancement
Human readable atom specifiers
| Reported by: | Owned by: | Tom Goddard | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Command Line | Version: | |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: | ||
| Notify when closed: | Platform: | all | |
| Project: | ChimeraX |
Description
Tristan suggests allowing human-readable atom specifiers.
The user friendly syntax for specifying atoms might be pretty simple, for example “model 1.1 and chain A B and resid 1 5 10 to 20 and atom CA” would translate to #1.1/A,B:1,5,10-20@CA which amounts to just replacing “model” with “#”, “chain" with “/“, “to” with “-“, “atom” with “@“ dropping the word “and” and adding some commas, a pretty direct translation.
Begin forwarded message:
From: Tristan Croll
Subject: Re: [chimera-dev] Crystallographic symmetry
Date: September 8, 2016 at 5:32:18 AM PDT
To: Tom Goddard
Hi Tom,
...
Also, have you considered implementing a "human-readable" selection syntax (e.g. "model 1.1 and chain A B and resid 1 5 10 to 20 and name CA")? It's a small thing, but it ends up making many scripts *so* much easier to read!
Best regards,
Tristan
Change History (2)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
I understand you want boolean operators and Chimera and ChimeraX have them “&” (and), “|” (or), “~” (not). If you care about performance, in some “and” uses it is more efficient to omit them, like chain A residues 50 to 70 is most efficient to compute as /A:50-70 but it is equivalent in ChimeraX syntax to /A & :50-70. The latter computes all the chain A atoms among all open models, then computes all the residues with numbers 50 to 70, then intersects those 2 sets. So I was oversimplifying a lot when I said drop the “and” words — a smart translation might sometimes turn them into “&” and other times not.
From: Tristan Croll
Date: September 8, 2016 at 11:48:23 AM PDT
To: Tom Goddard
Not quite what I was getting at (but I didn't really explain it that well). Having the AND, OR and NOT Boolean operators available makes it much easier to build up complex selections. Examples:
set coreseltext "(chain A and resid 50 to 70)"
set mdsel [atomselect top "$coreseltext or (sidechain and same residue as within 5 of $coreseltext)"]
VMD has its idiosyncrasies and frustrations in other areas, but that core functionality can be really powerful.