Re: [Chimera-users] How to use a colour-valued attribute?

On Dec 3, 2014, at 1:30 AM, Mungo Carstairs (Staff) <g.m.carstairs@dundee.ac.uk> wrote:
Thanks all. Tom, your suggestion of comma- instead or or-delimiter improves speed several times! Elaine, your point about specifying the chain is noted.
Conrad, I didn't explain too clearly: my 'real' command is the 'non-contiguous' example (think Zappo colouring with some custom features colours on top). The 'contiguous' example was just what I was using to explore behaviour of setattr / defattr / rangecolor. (Also by the way the REST API is working fine for me.)
Instead of 'color' I am now using 'setattr' followed by 'rangecolor'. I tried both 'setattr' and 'defattr' (passing a temporary file) and didn't see any significant performance difference between them, at the scales I am testing so far (up to 3 models of 1600 residues).
So I have what I need for now. But I'm still curious to know if / how you get Chimera to 'act on' (display) a colour-valued attribute.
Best regards, Mungo
Hi Mungo, Setting the color attribute with setattr or defattr does change the color immediately. The problem in what you sent earlier: setattr r color green #0:1-84.B … is that there is no residue attribute named “color". There are atom and molecule-model attributes by that name (setattr a color …) but the only per-residue color setting is ribbon color, name “ribbonColor” … thus you would want something like: setattr r ribbonColor green #0:54.a,76.a … and that would only color the ribbon, not the atoms/bonds. <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/atom_spec.html#resprops> Actually I am mystified as to why this would be any faster than using the color command with the same atomspec (#0:54.a,76.a in the example above), but maybe the others who know more about the “guts” of Chimera can comment. Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco

Hi Elaine, Thanks for that. Having gone round the houses with setattr/defattr, I went back yesterday to retry the original 'color' command (incorporating tips for a better atomspec) and it is now as performant as the alternatives! It seemed to 'degrade' a lot faster when I was using the original, naive atomspec with 'or' delimiters and a model specified for every position. So I've gone round in a circle and ended up almost where I started, but wiser ;-). Regards Mungo Division of Computational Biology University of Dundee http://www.jalview.org ________________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: 03 December 2014 18:07 To: Mungo Carstairs (Staff) Cc: chimera-users BB Subject: Re: [Chimera-users] How to use a colour-valued attribute? On Dec 3, 2014, at 1:30 AM, Mungo Carstairs (Staff) <g.m.carstairs@dundee.ac.uk> wrote:
Thanks all. Tom, your suggestion of comma- instead or or-delimiter improves speed several times! Elaine, your point about specifying the chain is noted.
Conrad, I didn't explain too clearly: my 'real' command is the 'non-contiguous' example (think Zappo colouring with some custom features colours on top). The 'contiguous' example was just what I was using to explore behaviour of setattr / defattr / rangecolor. (Also by the way the REST API is working fine for me.)
Instead of 'color' I am now using 'setattr' followed by 'rangecolor'. I tried both 'setattr' and 'defattr' (passing a temporary file) and didn't see any significant performance difference between them, at the scales I am testing so far (up to 3 models of 1600 residues).
So I have what I need for now. But I'm still curious to know if / how you get Chimera to 'act on' (display) a colour-valued attribute.
Best regards, Mungo
Hi Mungo, Setting the color attribute with setattr or defattr does change the color immediately. The problem in what you sent earlier: setattr r color green #0:1-84.B … is that there is no residue attribute named “color". There are atom and molecule-model attributes by that name (setattr a color …) but the only per-residue color setting is ribbon color, name “ribbonColor” … thus you would want something like: setattr r ribbonColor green #0:54.a,76.a … and that would only color the ribbon, not the atoms/bonds. <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/atom_spec.html#resprops> Actually I am mystified as to why this would be any faster than using the color command with the same atomspec (#0:54.a,76.a in the example above), but maybe the others who know more about the “guts” of Chimera can comment. Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco The University of Dundee is a registered Scottish Charity, No: SC015096
participants (2)
-
Elaine Meng
-
Mungo Carstairs (Staff)