coot

More Coot scripts

Continuation from How to customize coot:

On this site there is a whole list of incredible useful scripts for Coot. I have selected some that I am especially fond of, as they make every day building in Coot much more effective (for me at least) as you can minimize the amount time that is wasted clicking through various menus etc. Should be noted that you can download all of the scripts from the site in one single file here NB I am not the author to any of these, you can contact the author on: olibclarke at gmail dot com.

Undo active

Undoes modification to active molecule (getting the mol id from the atom you are centered on).
Avoids having to manually change the undo molecule. Currently bound to “z”.

Undo on active mol
def undo_visible():
  set_undo_molecule(active_residue()[0])
  apply_undo()
add_key_binding("Undo","z",
lambda: undo_visible())

Clear distances and labels
Bound to “Z”. Useful if you have a linux machine affected by the issue where the graphics slow down immensely when labels are present.

Clear labels 
def clear_distances_and_labels():
  remove_all_atom_labels()
  clear_simple_distances()
add_key_binding("Clear distances and labels","Z",
lambda: clear_distances_and_labels())

Merge two molecules by clicking:

Click two molecules. The second molecule will be merged into the first. At present, if the second molecule has the same chain name as the first, it will be renumbered such that it is consecutive in numbering from the end of the first molecule. This function is most useful when merging coot-placed helices and strands into a single molecule.

Merge two mol by click
def merge_fragments():
  def merge_2_fragments(res1,res2):
    mol_daughter=[res2[1]]
    mol_ref=res1[1]
    merge_molecules(mol_daughter,mol_ref)
    toggle_display_mol(mol_ref)
    toggle_display_mol(mol_ref)
  user_defined_click(2,merge_2_fragments)
add_simple_coot_menu_menuitem(menu,
"Merge two mols (click two)", lambda func: merge_fragments()) 

Forced addition of terminal residue:
Adds terminal residue, ignoring density. Useful when density is visible, but Coot cannot automatically add a terminal residue. Phi and Psi set to alpha-helical defaults.

Forced addition of term resi 
def force_add_terminal_residue():
def force_addition(res1):
mol_id=res1[1]
ch_id=res1[2]
res_no=res1[3]
res_type="auto"
add_terminal_residue_using_phi_psi(mol_id,ch_id,res_no,
res_type,-64,-41)
sort_residues(mol_id)
user_defined_click(1,force_addition)
add_simple_coot_menu_menuitem(menu,
"Forced addition of terminal residue (click terminus)",
lambda func: force_add_terminal_residue())

Add a key binding to toggle map display
This will turn all currently displayed maps off if pressed once, then turn the same set of maps on if pressed again.
Useful for quickly examining geometry of model in absence of maps, then redisplaying the same set of maps without having to open the display manager.
In this example it is bound to the “`” key.

Toggle map keybind  
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()) 

Build poly-ala in selected gap

Build a polyala loop in the selected gap (User clicks start and end point):
Useful for quickly fitting the backbone trace of a loop, which can then be mutated to the desired sequence.

Build poly-ala 
 def fit_polyala_gui(): def fit_polyala(res1,res2): length=abs(res1[3]-res2[3])-1 loop_seq=length*"A" fit_gap(res1[1],res1[2],res1[3],res2[3],loop_seq,1) user_defined_click(2,fit_polyala) add_simple_coot_menu_menuitem(menu, "Fit polyala loop (click start and end)", lambda func: fit_polyala_gui())

Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/molecularart.dk/public_html/wp-includes/class-wp-comment-query.php on line 405

Leave a Reply

Your email address will not be published. Required fields are marked *