Re: [COOT] Key-binding for changing active map/molecule color
Victor Alves wrote: Hi I have looked at the reference manual and can't seem to find a way to fulfill my desire to change colors of the active map or molecule at key-press. All the commands I found use imol which means you have to know the exact number. If you're launching Refmac from within Coot, its useful that Coot changes the map and molecule colors (as it does automatically) but sometimes I don't like the chosen colors and would like to change them, just by pressing a key. So, I would like to add a key binding to set the current (active) map to a certain color and likewise do the same for the active molecule. Something like: (add-key-binding Blue Map b (lambda () (set-map-colour *_active-imol_* 51 128 178)) instead of having to use imol. Hi Victor, First, to make the new maps from Refmac be the same colours as the previous one, add to your ~/.coot file: (set-keep-map-colour-after-refmac 1) Secondly, to answer your question: (add-key-binding Blueify the Latest 2foFc Map b (lambda () (let loop ((l (reverse (map-molecule-list (cond ((null? l) 'no-map) ((= (map-is-difference-map (car l)) 0) (set-map-colour (car l) 0.1 0.5 0.68) (graphics-draw)) (else (loop (cdr l))) i.e. we have to find the value of active-imol and we do that by working backwards through the list of map molecule numbers and finding the first one that is not a difference map. Note the colour scales go from 0 to 1. Paul.
Re: [COOT] Key-binding for changing active map/molecule color
2009/2/24 Victor Alves vdal...@fmv.utl.pt: Hi I have looked at the reference manual and can't seem to find a way to fulfill my desire to change colors of the active map or molecule at key-press. All the commands I found use imol which means you have to know the exact number. If you're launching Refmac from within Coot, its useful that Coot changes the map and molecule colors (as it does automatically) but sometimes I don't like the chosen colors and would like to change them, just by pressing a key. So, I would like to add a key binding to set the current (active) map to a certain color and likewise do the same for the active molecule. Something like: (add-key-binding Blue Map b (lambda () (set-map-colour active-imol 51 128 178)) instead of having to use imol. Thank you Victor Alves This message was sent using IMP, the Internet Messaging Program. This would colour the last non-difference map: (add-key-binding Blue Map b (lambda () (let loop ((map-imol-list (reverse (map-molecule-list (if (not (null? map-imol-list)) (if (= (map-is-difference-map (car map-imol-list)) 0) (set-map-colour (car map-imol-list) 51 128 178) (loop (cdr map-imol-list)))
Re: [COOT] Key-binding for changing active map/molecule color
Dear Paul and Judit Thank you so much! Its a pleasure doing business with you :-) Victor - Victor Alves, DVM, PhD Auxilliary Professor Veterinary Medicine Faculty - UTL Lisbon, Portugal Quoting Paul Emsley paul.ems...@bioch.ox.ac.uk: Hi Victor, First, to make the new maps from Refmac be the same colours as the previous one, add to your ~/.coot file: (set-keep-map-colour-after-refmac 1) Secondly, to answer your question: (add-key-binding Blueify the Latest 2foFc Map b (lambda () (let loop ((l (reverse (map-molecule-list (cond ((null? l) 'no-map) ((= (map-is-difference-map (car l)) 0) (set-map-colour (car l) 0.1 0.5 0.68) (graphics-draw)) (else (loop (cdr l))) i.e. we have to find the value of active-imol and we do that by working backwards through the list of map molecule numbers and finding the first one that is not a difference map. Note the colour scales go from 0 to 1. Paul. Quoting Judit Debreczeni judit.debrecz...@googlemail.com: This would colour the last non-difference map: (add-key-binding Blue Map b (lambda () (let loop ((map-imol-list (reverse (map-molecule-list (if (not (null? map-imol-list)) (if (= (map-is-difference-map (car map-imol-list)) 0) (set-map-colour (car map-imol-list) 51 128 178) (loop (cdr map-imol-list))) This message was sent using IMP, the Internet Messaging Program.