Also, on the topic of changing rmsd, I like to bind 1-9 to the equivalent rmsd 
levels, as follows - this is helpful when scrolling large maps, particularly EM 
maps:

#The nine key bindings elow allow easy setting of map
#level by rmsd - shift + any single digit integer
#sets the currently scrollable map to that level
# in rmsd. Useful when on a laptop with touchpad,
#when changing the contour using the scrollwheel is
#not practical and using +/- is too slow.
add_key_binding("Map to 1 sigma","!",
lambda: set_contour_level_in_sigma(scroll_wheel_map(),1))

add_key_binding("Map to 2 sigma","@",
lambda: set_contour_level_in_sigma(scroll_wheel_map(),2))

add_key_binding("Map to 3 sigma","#",
lambda: set_contour_level_in_sigma(scroll_wheel_map(),3))

add_key_binding("Map to 4 sigma","$",
lambda: set_contour_level_in_sigma(scroll_wheel_map(),4))

add_key_binding("Map to 5 sigma","%",
lambda: set_contour_level_in_sigma(scroll_wheel_map(),5))

add_key_binding("Map to 6 sigma","^",
lambda: set_contour_level_in_sigma(scroll_wheel_map(),6))

add_key_binding("Map to 7 sigma","&",
lambda: set_contour_level_in_sigma(scroll_wheel_map(),7))

add_key_binding("Map to 8 sigma","*",
lambda: set_contour_level_in_sigma(scroll_wheel_map(),8))

add_key_binding("Map to 9 sigma","(",
lambda: set_contour_level_in_sigma(scroll_wheel_map(),9))
On Apr 30, 2015, at 7:26 PM, Clarke, Oliver 
<oc2...@cumc.columbia.edu<mailto:oc2...@cumc.columbia.edu>> wrote:

Yes - I have those keybindings for both maps and models - they are included in 
my custom settings file which you can download from 
cootscripts.tiddlyspace.com<http://cootscripts.tiddlyspace.com/> (and I think 
the keybindings are described there also), and I’ve also reproduced them below:

#Undisplay all models except the active one.
#If only one model is displayed, cycle through
#all available models.
def display_only_active():
  mol_id_active=active_residue()[0]
  displayed_mols_count=0
  for mol_id in model_molecule_list():
    displayed_mols_count=displayed_mols_count+mol_is_displayed(mol_id)
    if (mol_is_displayed(mol_id)==1) and (mol_id!=mol_id_active):
      set_mol_displayed(mol_id,0)
    if mol_is_displayed(mol_id):
      displayed_mol=mol_id
  if displayed_mols_count==1:
    index_displayed=model_molecule_list().index(mol_id_active)
    try:
      next_mol=model_molecule_list()[index_displayed+1]
    except IndexError:
      next_mol=model_molecule_list()[0]
    set_mol_displayed(displayed_mol,0)
    set_mol_displayed(next_mol,1)
add_key_binding("Display only the active model",")",
lambda: display_only_active())

#Undisplay all maps except the active one.
#If only one map is displayed, cycle through
#all available models.
def display_only_active_map():
  active_map=scroll_wheel_map()
  if not map_is_displayed(active_map):
    set_map_displayed(active_map,1)
  displayed_maps_count=0
  for map_id in map_molecule_list():
    displayed_maps_count=displayed_maps_count+map_is_displayed(map_id)
    if (map_is_displayed(map_id)==1) and (map_id!=active_map):
      set_map_displayed(map_id,0)
    if map_is_displayed(map_id):
      displayed_map=map_id
  if displayed_maps_count==1:
    index_displayed=map_molecule_list().index(active_map)
    try:
      next_map=map_molecule_list()[index_displayed+1]
    except IndexError:
      next_map=map_molecule_list()[0]
    set_map_displayed(active_map,0)
    set_map_displayed(next_map,1)
  for map_id in map_molecule_list():
    if map_is_displayed(map_id):
      set_scrollable_map(map_id)
add_key_binding("Display only the active map","~",
lambda: display_only_active_map())


On Apr 30, 2015, at 7:16 PM, Murpholino Peligro 
<murpholi...@gmail.com<mailto:murpholi...@gmail.com>> wrote:

Hi...
I was looking for something like this...
but I want to switch between maps...say I have my blue map, my red/green map 
and my anomalous map....can I switch between them...scroll to desire rmsd and 
change to the other map...
(I scroll a lot these three maps while doing model building...)


2014-11-13 20:53 GMT-06:00 Oliver Clarke 
<oc2...@columbia.edu<mailto:oc2...@columbia.edu>>:
Hi all,

In case it is of use to any one else, I worked out a key binding which I find 
quite handy and hadn't come across previously, so figured I'd post it here.

It undisplays all the maps you have displayed if you press it once, and then 
redisplays the same set of maps you had open previously if you press it a 
second time. (There is probably a better way of doing this already built in to 
Coot, but I hadn't been able to find it, and this seems to work.)

I find this useful for quickly toggling the maps off to take a close look at 
the model, then switching them back on, without having to use display manager 
to unselect and reselect the specific subset of maps that were open originally.

Oliver.

Script:

map_disp_flag={0:0}
map_disp_flag_cycle=0
def toggle_map_display():
  global map_disp_flag
  global map_disp_flag_cycle
  if map_disp_flag_cycle==0:
    for map_id in map_molecule_list():
      disp_value=map_is_displayed(map_id)
      map_disp_flag[map_id]=disp_value
      if disp_value==1:
        set_map_displayed(map_id,0)
    map_disp_flag_cycle=1
  elif map_disp_flag_cycle==1:
    for map_id in map_molecule_list():
      if map_id not in map_disp_flag:
        disp_value=map_is_displayed(map_id)
        map_disp_flag[map_id]=disp_value
      if map_disp_flag[map_id]==1:
        set_map_displayed(map_id,1)
    map_disp_flag_cycle=0
add_key_binding("Toggle map display","`",
lambda: toggle_map_display())



Reply via email to