Opened 9 years ago

Last modified 9 years ago

#420 new enhancement

Human readable atom specifiers

Reported by: tic20@… 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 Tom Goddard, 9 years ago

From: Tristan Croll
Date: September 8, 2016 at 11:48:23 AM PDT
To: Tom Goddard

dropping the word “and”

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:

  • if you need to select, say, two beta strands where each comes from a different chain, then in VMD the selection text would be: "(chain A and resid 50 to 60) or (chain B and resid 100 to 110)"
  • in some situations in iMDFF, I've found it advantageous to mobilise a contiguous stretch plus only the sidechains of surrounding residues. In VMD this could be accomplished by a couple of lines of TCL:

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.

comment:2 by Tom Goddard, 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.

Note: See TracTickets for help on using tickets.