[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1. what_check

procedure: strip_leading_spaces (str):

" 53" -> "53", " " -> ""

procedure: go_to_residue_by_spec (imol, spec):

consider for coot_utils

procedure: residue_spec2string (spec):

consider for coot_utils

procedure: get_flip_residue (line):

make this internal

where line is something like " 53 HIS ( 53 ) A12" ignore xxxxI Cyy xxxx is 4char resno, I insertion code, C chain id, yy is model number

return a residue spec, or False

procedure: convert_to_button_info (problemed_res_list):
procedure: problem_residues2dialog (imol, problemed_res_list_list):

A problemed-res-list is improper pair where the car is a pair of string, one describing the problem, and the other being the "fix it" button label. The cdr is a list of residue specs.

A problemed_flip_list_list is a list of those things.

procedure: parse_check_db (imol, file_name, action):

action is either 'gui' (then we get a gui) or 'apply-actions', then the model modifications are automatically applied.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. background_demo

procedure: background_demo ():

flash the background different colours in some uninteresting way.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. extensions

procedure: add_coot_menu_separator (menu):

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4. tips

procedure: tip_list ():

a list of tips for Coot

procedure: no_coot_tips ():

Function to turn off coot tips at start


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5. check_for_updates

procedure: get_stable_release_from_server_string (stri):

Is this true? Dont understand this

procedure: get_stable_release_from_coot_version ():

needs testing!

procedure: new_version_on_server (stri, is_pre_release):

return True or False (None on error, maybe should return some Error!?) although if no return, then var becomes None anyway.. FIXME).

procedure: notify_of_new_version (stri, use_curl=False):

show the dialog

procedure: download_binary_dialog (version_string, use_curl=False):

version_string is something like: "coot-0.6-pre-1-revision-2060"

procedure: restart_dialog (extra_text=""):
procedure: check_for_updates_gui (use_curl=False):
procedure: get_latest_pending_version ():

returns latest installer version in pending-install or empty string "" if no installer for windows use only!


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6. coot_toolbuttons

procedure: register_coot_icons ():

put all coot svgs in the default icon set

procedure: add_coot_toolbar_separator ():

adds a SeparatorToolItem to the coot_main_toolbar (by default at the last position). Return the separator or False. If there is a separator in the last position, dont add it

procedure: save_toolbar_to_init_file (button_label, callback_functionicon=None, tooltip=None,toggle_button=False, use_button=False):

save a toolbar button to ~/.coot-preferences/coot_toolbuttons.py

procedure: remove_toolbar_from_init_file (button_label):

remove a toolbar from ~/.coot-preferences/coot_toolbuttons.py

procedure: list_of_toolbar_functions ():

returns a list with pre-defined toolbar-functions (stock-id is optional, so are a few others - almost consistent with order in coot_toolbar_button function) format: [[Group1,[toolbarname1, callbackfunction1, description1], [toolbarname2, callbackfunction2, description2(tooltip), stock-id2, toggle_button, use_button],...], [Group2]....] OBS: callbackfunction is a string! not any more exclusively


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7. brute_lsqman

procedure: brute_lsqman (pdb1_imol, pdb2_imol):

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8. coot_gui

procedure: coot_gui ():

Fire up the coot scripting gui. This function is called from the main C++ code of coot. Not much use if you don't have a gui to type functions in to start with.

procedure: handle_smiles_go (tlc_entry, smiles_entry):

The callback from pressing the Go button in the smiles widget, an interface to run libcheck.

procedure: smiles_gui ():

smiles GUI

procedure: generic_single_entry (function_label, entry_1_default_text, go_button_label, handle_go_function):

Generic single entry widget

Pass the hint labels of the entries and a function that gets called when user hits "Go". The handle-go-function accepts one argument that is the entry text when the go button is pressed.

procedure: generic_double_entry (label_1, label_2entry_1_default_text, entry_2_default_text,check_button_label, handle_check_button_function,go_button_label, handle_go_function,return_widget = False):

generic double entry widget, now with a check button ...and returns the widget if requested

pass a the hint labels of the entries and a function (handle-go-function) that gets called when user hits "Go" (which takes two string aguments and the active-state of the check button (either True of False).

if check-button-label not a string, then we don't display (or create, even) the check-button. If it *is* a string, create a check button and add the callback handle-check-button-function which takes as an argument the active-state of the the checkbutton.

procedure: generic_multiple_entries_with_check_button (entry_info_list, check_button_info, go_button_label, handle_go_function):

generic double entry widget, now with a check button

OLD

pass a the hint labels of the entries and a function (handle-go-function) that gets called when user hits "Go" (which takes two string aguments and the active-state of the check button (either True of False).

if check-button-label not a string, then we don't display (or create, even) the check-button. If it *is* a string, create a check button and add the callback handle-check-button-function which takes as an argument the active-state of the the checkbutton.

procedure: molecule_centres_gui ():

A demo gui to move about to molecules

procedure: check_libcheck_logfile (logfile_name):

A BL function to analyse the libcheck log file

procedure: old_coot_qm ():

old coot test

procedure: interesting_things_gui (title,baddie_list):

We can either go to a place (in which case the element is a list of button label (string) and 3 numbers that represent the x y z coordinates) or an atom (in which case the element is a list of a button label (string) followed by the molecule-number chain-id residue-number ins-code atom-name altconf)

e.g. interesting_things_gui( "Bad things by Analysis X", [["Bad Chiral",0,"A",23,"","CA","A"], ["Bad Density Fit",0,"B",65,"","CA",""], ["Interesting blob",45.6,46.7,87.5]]

procedure: interesting_things_with_fix_maybe (title, baddie_list):

In this case, each baddie can have a function at the end which is called when the fix button is clicked. And extra string arguments can give the name of the button and a tooltip as these two are ambigious, they can only be: 1 extra string: button name 2 extra strings: button name and tooltip

procedure: fill_option_menu_with_mol_options (menu, filter_function):

Fill an option menu with the "right type" of molecules. If filter_function returns True then add it. Typical value of filter_function is valid-model-molecule_qm

procedure: fill_option_menu_with_map_mol_options (menu):

Fill an option menu with maps and return the list of maps

procedure: fill_option_menu_with_coordinates_mol_options (menu):

Helper function for molecule chooser. Not really for users.

Return a list of models, corresponding to the menu items of the option menu.

The returned list will not contain references to map or closed molecules.

procedure: fill_option_menu_with_number_options (menu, number_list, default_option_value):
procedure: get_option_menu_active_molecule (option_menu, model_mol_list):

Helper function for molecule chooser. Not really for users.

return the molecule number of the active item in the option menu, or return False if there was a problem (e.g. closed molecule)

BL says:: we do it for gtk_combobox instead! option_menu is deprecated

procedure: get_option_menu_active_item (option_menu, item_list):

BL says:: we do it for gtk_combobox instead! option_menu is deprecated Here we return the active item in an option menu of generic items

procedure: molecule_chooser_gui_generic (chooser_label, callback_function, option_menu_fill_function):

Typically option_menu_fill_function is fill_option_menu_with_coordinates_mol_options

procedure: molecule_chooser_gui (chooser_label, callback_function):

Fire up a coordinates/model molecule chooser dialog, with a given label and on OK we call the callback_fuction with an argument of the chosen molecule number.

chooser_label is a directive to the user such as "Choose a Molecule"

callback_function is a function that takes a molecule number as an argument.

procedure: map_molecule_chooser_gui (chooser_label, callback_function):

Fire up a map molecule chooser dialog, with a given label and on OK we call the callback_fuction with an argument of the chosen molecule number.

chooser_label is a directive to the user such as "Choose a Molecule"

callback_function is a function that takes a molecule number as an argument.

procedure: generic_chooser_and_entry (chooser_label,entry_hint_text,default_entry_text,callback_function):

A pair of widgets, a molecule chooser and an entry. The callback_function is a function that takes a molecule number and a text string.

procedure: generic_chooser_entry_and_file_selector (chooser_labelchooser_filter,entry_hint_text,default_entry_text,file_selector_hint,callback_function):

Create a window

Return a pair of widgets, a chooser entry and a file selector. The callback_function is a function that takes a molecule number and a text string (e.g. chain_id and file_name)

chooser_filter is typically valid_map_molecule_qm or valid_model_molecule_qm

procedure: generic_chooser_and_file_selector (chooser_labelchooser_filter,file_selector_hint,default_file_name,callback_function):

Create a window.

Return a pair of widgets, a molecule chooser and a file selector. The callback_function is a function that takes a molecule number and a file_name

chooser_filter is typically valid_map_molecule_qm or valid_model_molecule_qm

procedure: coot_menubar_menu (menu_label):

If a menu with label menu-label is not found in the coot main menubar, then create it and return it. If it does exist, simply return it.

procedure: add_simple_coot_menu_menuitem (menu,menu_item_label,activate_function):

Given that we have a menu (e.g. one called "Extensions") provide a cleaner interface to adding something to it:

activate_function is a thunk.

procedure: alt_confs_gui (imol):

Make an interesting things GUI for residues of molecule number imol that have alternate conformations.

procedure: missing_atoms_gui (imol):

Make an interesting things GUI for residues with missing atoms

procedure: zero_occ_atoms_gui (imol):

Make an interesting things GUI for residues with zero occupancy atoms

procedure: interesting_residues_gui (imol, title, interesting_residues):

Make an interesting things GUI for residues of molecule number imol for the given imol. A generalization of alt-confs gui.

procedure: coot_toolbar_button (button_label, cb_functionicon_name=False, tooltip=False,toggle_button=False, use_button=False):

If a toolbutton with label button_label is not found in the coot main toolbar, then create it and return it. If it does exist, the icon will be overwritten. The callback function wont! [NOTE: if its a Coot internal Toolbar you can only add a function but not overwrite its internal function!!!]

return False if we cannot create the button and/or wrong no of arguments

we accept 6 arguments: button_label callback_function (can be a string or callable function, or list with first element fucntion, then args, i.e. [function, arg1, arg2, ...]) gtk-stock-item (or icon_widget, whatever that is) tooltip a text to present as tooltip toggle_button_flag toggle button instead of normal button use_button pass the button widget onto the function

procedure: toolbar_label_list ():

returns a list of existing toolbar buttons [[label, toolbutton],[]...] or False if coot_python is not available

procedure: generic_button_dialog (dialog_name, button_list):

button-list is a list of pairs (improper list) the first item of which is the button label text the second item is a lambda function, what to do when the button is pressed.

procedure: generic_interesting_things (imol,gui_title_string,residue_test_func):

Generic interesting things gui: user passes a function that takes 4 args: the chain-id, resno, inscode and residue-serial-number (should it be needed) and returns either #f or something interesting (e.g. a label/value). It is the residue-test-func of the residue-matching-criteria function.

procedure: generic_number_chooser (number_list, default_option_value, hint_textgo_button_label, go_function):

A gui that makes a generic number chooser the go function is a function that takes the value of the active menu item - as a number.

procedure: entry_do_button (vbox, hint_textbutton_label, button_press_func,entry_text=False):

vbox is the vbox to which this compound widget should be added. button-press-func is the lambda function called on pressing return or the button, which takes one argument, the entry.

Add this widget to the vbox here.

procedure: generic_molecule_chooser (hbox, hint_text):

pack a hint text and a molecule chooser option menu into the given vbox.

return the option-menu and model molecule list:

procedure: file_selector_entry (hbox, hint_text, default_file_name = False):

Return an entry, the widget is inserted into the hbox passed to this function

procedure: file_chooser_entry (hbox, hint_text, default_file_name = False):

This is the same as the file_selector_entry, but using the modern FileChooser Return an entry, the widget is inserted into the hbox passed to this function

procedure: place_strand_here_gui ():

The gui for the strand placement function

procedure: cootaneer_gui (imol):

Cootaneer gui

procedure: view_saver_gui ():

The gui for saving views

procedure: add_view_to_views_panel (view_name, view_number):
procedure: dialog_box_of_buttons (window_name, geometry, buttons, close_button_label):

a button is a list of [label, callback, text_description]

procedure: dialog_box_of_buttons_with_check_button (window_name, geometrybuttons, close_button_label,check_button_label,check_button_func,check_button_is_initially_on_flag):

geometry is an improper list of ints

return the h_box of the buttons

a button is a list of [label, callback, (optional: text_description)] where callback is a string or list of strings to be evaluated

If check_button_label is False, don't make one, otherwise create with the given label and "on" state

Note: - if label is "HSep" a horizontal separator is inserted instead of a button - the description is optional

procedure: add_button_info_to_box_of_buttons_vbox (button_info, vbox):

This is exported outside of the box-of-buttons gui because the clear_and_add_back function (e.g. from using the check button) needs to add buttons - let's not duplicate that code.

procedure: dialog_box_of_pairs_of_buttons (imol, window_name, geometry, buttons, close_button_label):

geometry is an improper list of ints buttons is a list of: [[["button_1_label, button_1_action], ["button_2_label, button_2_action]], [next pair of buttons]] The button_1_action function is a string The button_2_action function is a string

procedure: dialog_box_of_buttons_with_widget (window_name, geometrybuttons, extra_widget,close_button_label):

as the dialog_box_of_buttons, but we can put in an extra widget (extra_widget)

procedure: dialog_box_of_radiobuttons (window_name, geometry, buttonsgo_button_label, go_button_function,selected_button = 0,cancel_button_label = "",cancel_function = False):

A dialog box with radiobuttons e.g. to cycle thru loops

the button list shall be in the form of: [[button_label1, "button_function1"], [button_label2, "button_function2"]]

function happens when toggled obs: button_functions are strings, but can be tuples for multiple functions go_function is string too! selected button is the button to be toggled on (default is first)

procedure: views_panel_gui ():

ews_dialog_vbox = False A gui showing views

procedure: nudge_screen_centre_paule_gui ():

nudge screen centre box. Useful when Ctrl left-mouse has been taken over by another function.

This is using the absolute coordinates

procedure: nudge_screen_centre_gui ():

nudge screen centre box. Useful when Ctrl left-mouse has been taken over by another function.

This is using the viewing coordinates

procedure: nudge_screen_centre_extra_gui ():

as nudge_screen_centre_gui but with clipping and zoom control

procedure: make_difference_map_gui ():

A gui to make a difference map (from arbitrarily gridded maps (that's it's advantage))

procedure: cis_peptides_gui (imol):
procedure: transform_map_using_lsq_matrix_gui ():
procedure: ncs_ligand_gui ():
procedure: superpose_ligand_gui ():

GUI for ligand superpositioning by graph matching

procedure: key_bindings_gui ():
procedure: coot_news_info (*args):
procedure: whats_new_dialog ():
procedure: cootaneer_gui_bl ():

Cootaneer/sequencing gui modified by BL with ideas from KC based on Paul's cootaneer gui and generic_chooser_entry_and_file_selector

procedure: run_with_gtk_threading (function, *args):

a function to run a pygtk widget in a function as a thread

procedure: generic_check_button (vbox, label_text, handle_check_button_function):
procedure: refinement_options_gui ():

a master gui to set all kinds of refinement parameters

procedure: show_progressbar (text):

a simple window to show a progress bar return the window (to be destroyed elsewhere)

procedure: python_thread_sleeper ():

port threading helper function to push the python threads this only runs python threads for 20ms every 50ms

procedure: run_python_thread (function, args, sleep_time=20):

function to run a python thread with function using args which is a tuple optionally pass sleep time in ms (default is 20) - usefull for computationally expensive threads which may have run longer N.B. requires gobject hence in coot_gui.py

procedure: map_sharpening_gui (imol):
procedure: associate_pir_with_molecule_gui (do_alignment=False):

Associate the contents of a PIR file with a molecule. Select file from a GUI.

procedure: alignment_mismatches_gui (imol):

Make a box-of-buttons GUI for the various modifications that need to be made to match the model sequence to the assigned sequence(s).

Call this when the associated sequence(s) have been read in already.

procedure: wrapper_alignment_mismatches_gui (imol):

Wrapper in that we test if there have been sequence(s) assigned to imol before we look for the sequence mismatches

procedure: residue_range_gui (func, function_text, go_button_label):

ved_residue_ranges = []

procedure: solvent_ligand_list ():
procedure: solvent_ligands_gui ():

add solvent molecules

Change the translation jiggle-factor to 1.0, so the ligand doesn't move so far and get sucked into protein density (this is just a temporary hack, it would be better to mask the enviroment of the ligand by the surrounding atoms of the molecule to which the ligand is added - that is much harder).

procedure: user_mods_gui (imol, pdb_file_name):

USER MODS gui

procedure: rename_residue_gui_simple ():
procedure: average_map_gui ():
procedure: rename_residue_gui ():

simple rename residue GUI

procedure: water_coordination_gui ():

molecule chooser

coordination number chooser

Max dist entry

results vbox containing buttons with atom-spec labels

h-sep

close-button

procedure: min_max_residues_from_atom_specs (specs):

return a list, or False (e.g. if not in same chain and molecule)

procedure: click_protein_db_loop_gui ():
procedure: toggle_wiimote (widget=None):

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9. gap

procedure: fit_gap (imol, chain_id, start_resno, stop_resnosequence="", use_rama_restraints=1):
procedure: fit_gap_generic (imol, chain_id, start_resno, stop_resno, sequence=""):

Fit missing loop in protein.

direction is either 'forwards' or 'backwards'

start-resno is higher than stop-resno if we are building backwards

fit_gap_generic(0,"A",23,26) ; we'll build forwards

fit_gap_generic(0,"A",26,23) ; we'll build backwards

procedure: has_sequence_qm (imol, chain_id_ref):

helper function to see if a sequence has been assigned to a chain in imol return True if sequence is there, False otherwise

procedure: de_clash (imol,chain_id,resno_start,resno_end):

For Kay Diederichs, autofit without a map (find rotamer with best clash score). This ignores alt conformations and residues with insertion codes.

procedure: low_density_average (imol_map, imol, chain_id, start_resno, stop_resno):

calculate the average of 20% lowest density at all atom_positions in fragment


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10. create_server

procedure: connection_proc (port, hostname):

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11. tips_gui

procedure: show_coot_tip_from_list (n, text):

given a number and a gtk text widget text (textbuffer!), put tip number n into the widget.

procedure: increment_coot_tip_number ():

increment the tip number when the user sees a tip

procedure: decrease_coot_tip_number ():

decrement the tip number when the user sees a tip

procedure: tips_gui ():

run the tips gui.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12. bones_reader

procedure: generic_object_from_bones (bones_file):
procedure: bones_it (map_file_name):
procedure: bonesing_func (imol):

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13. group_settings


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

14. coot_lsq

procedure: lsq_match_type_symbol (match_type_in):

Internal type conversion for LSQ fitting. Return a number according to the symbod match_type_in

procedure: set_match_element (m):

Create matchers, 7 elements: [ref_start_resno, ref_end_resno, ref_chain_id, imol_ref, mov_start_resno, mov_end_resno, mov_chain_id, imol_mov, match_type]

procedure: lsq_match (imol_ref,imol_moving,match_list):

The scripting interface to LSQ matching. Pass molecule numbers for the reference (imol_ref) and moving (imol_moving) molecules and a match list. The match list format is described in the manual.

procedure: simple_lsq_match (ref_start_resno, ref_end_resno, ref_chain_id, imol_ref, mov_start_resno, mov_end_resno, mov_chain_id, imol_mov, match_type):

Simple interface to LSQ fitting. More often than not this is what you will want, I imagine, e.g. simple_lsq_match(940, 950, "A", 0, 940, 950, "A", 1, "main")


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15. test_internal


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

16. a_rapper_gui

procedure: rapper_process ():
procedure: rename_dir_by_date (dir_name):
procedure: sequence_string (imol, chain_id, resno_start, resno_end):

return a string or False

procedure: rapper_it (imol, chain_id, start_resno, end_resno, sequence, number_of_models):
procedure: stop_rapper ():
procedure: cancel_dialog_func (widget, window):
procedure: a_rapper_gui (loop_building_tool):

loop_building_tool is either 'rapper' or 'ARP/wARP'


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17. raster3d

procedure: povray_args ():

args not including the output filename

procedure: render_image ():

run raster3d

procedure: raytrace (image_type, source_file_name, image_file_name, x_size, y_size):

Run either raster3d or povray

image_type is either 'raster3d' or 'povray'

procedure: ppm2bmp (ppm_file_name):

Converts a ppm file to a bmp file (for windows users) and opens in browser or viewer actually dont use ppm any more but png, so not needed as such any more keep for backwards compatibility

procedure: check_file_names_for_space_and_move (image_file_name,source_file_name):

Tests file names for spaces. there is certainly on problem on windows not sure about other OS, yet


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18. shelx

procedure: handle_shelx_fcf_file (filename):
procedure: convert_shelx_fcf_to_cif (fcf_filename,cif_filename):
procedure: remove_time_extensions (str):
procedure: shelxl_refine (imol, hkl_file_in_maybe=False, shelxh_flag=False):

BL says: shelxl_refine can have 3 arguments here:

first: imol

second: orig hkl file

third: shelxh_flag , i.e. use shelxh instead of shelxl (in absenc of hkl inputfile this has to be written as: shelxh_flag=YOURSETTING True: use shelxh False: use shelxl (default)

procedure: shelxl_refine_primitive (imol, ins_text, hkl_file_in_maybe=False, shelxh_flag=False):

shelxl refinement with input text

procedure: shelxl_refine_inner (imol, hkl_file_in_maybe, func, shelxh_flag):
procedure: read_shelx_lst_file (file_name, imol):

do-shelx-lst-file

ie. create a interesting-things GUI for split (and other things?) in a shelx .lst file.

procedure: read_shelx_project (file_name):

Read a shelx project (i.e. the .res file, the .lst file and the .fcf.cif file (if it exists (else read the .fcf file (if it exists)))

If the file-name has an extension of .lst .res .ins .fcf .log .hkl then strip that off before adding new extensions.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

19. povray

procedure: povray_args ():

args not including the output filename

procedure: povray_image ():

Run provray using current displayed image and write .pov file to default filename


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

20. shelx_extensions

procedure: add_plugin_shelx ():
procedure: shelx_ins_strings (imol):
procedure: shelxl_refine_gui (imol, hkl_file_name_maybe=False):
procedure: editable_shelx_gui (imol, hklin_file_name):

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21. prodrg_import

procedure: import_from_3d_generator_from_mdl (file_name):

to be over-ridden by your favourite 3d conformer generator, if you like...

procedure: import_from_prodrg (minimize_mode):

int "new prodrg_import.py"

procedure: get_file_latest_time (file_name):
procedure: mdl_update_timeout_func ():

ase_transfer_latest_time = get_file_latest_time(sbase_to_coot_tlc) FIXME: this is not a proper name

procedure: prodrg_flat (imol_in, chain_id_in, res_no_in):

return False (if fail) or a list of: the molecule number of the selected residue, the prodrg output mol file_name, the prodrg output pdb file_name

procedure: prodrg_plain (mode, imol_in, chain_id_in, res_no_in):
procedure: fle_view (imol, chain_id, res_no, ins_code):

Why do we pass imol etc and then use active atom?


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

22. libcheck

procedure: monomer_molecule_from_3_let_code (code, dict_cif_libinccp4i_project_dir = ""):

Where code is e.g. "3GP" and ccp4i-project-dir is an optional arg which is the directory to which the libcheck log files and pdb file will go.

Return -2 on code is not a string Return -3 on libcheck failure Return -4 on refmac failure Return imol on success Return handle-read-draw-molecule error code on failure to read resultant pdb file

Actually, it would be nice to know if this code represented a full description - or a minimal one... perhaps we can parse the log file and call a pop-up that will tell us.

dict_cif_libin should be a string. If it is "" then it is ignored. If it is not "" then it is used to create input to libcheck (not a command line argument) so that bespoke dictionary libraries can produce coords using "Get Monomer".

might not do all above mentioned things in python, yet


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

23. fitting

procedure: fit_protein (imol):

For each residue in the protein (molecule number imol), do a rotamer fit and real-space refinement. Update the graphics and rotate the scene at each residue for eye candy goodness.

Note that residue with alt confs do not undergo auto-fit-rotamer. This is because that autofit-rotamer then refine will tend to put both rotamers into the same place. Not good. It seems a reasonable expectation that residues with an alternate conformation are already resonably well-fitted. So residues with alternate conformations undergo only real space refinement.

This is simple-minded and outdated now we have the interruptible version (below).

procedure: fit_protein_make_specs (imol, chain_specifier):

Return a list of residue specs

chain-specifier can be a string, where it is the chain of interest. or 'all-chains, where all chains are chosen.

procedure: fit_protein_fit_function (res_spec, imol_map):
procedure: fit_protein_stepped_refine_function (res_spec, imol_map, use_rama = False):
procedure: fit_protein_rama_fit_function (res_spec, imol_map):
procedure: interruptible_fit_protein (imol, func):

func is a refinement function that takes 2 args, one a residue spec, the other the imol_refinement_map. e.g. fit_protein_fit_function

procedure: stop_interruptible_fit_protein ():

this will stop the currently running interuptible fit protein function

procedure: continue_interruptible_fit_protein ():

Continue with the interruptible fitting

procedure: cancel_interruptible_fit_protein ():

use to completely stop the interruptible fit function

procedure: fit_chain (imol,chain_id):

For each residue in chain chain-id of molecule number imol, do a rotamer fit and real space refinement of each residue. Don't update the graphics while this is happening (which makes it faster than fit-protein, but much less interesting to look at).

procedure: fit_residue_range (imol, chain_id, resno_start, resno_end):

As fit_chain, but only for a residue range from resno_start to resno_end

procedure: fit_waters (imol, animate_qm = False):

For each residue in the solvent chains of molecule number imol, do a rigid body fit of the water to the density.

BL says: we pass *args where args[0]=imol and args[1]=animate_qm (if there)

procedure: fit_waters_range (imol, chain_id, start, end):

BL thingy: as fit_waters, but will only fit a range of waters (start to end). speeds things up when refining a lot of waters

procedure: stepped_refine_protein (imol, res_step = 2):

Step through the residues of molecule number imol and at each step do a residue range refinement (unlike fit-protein for example, which does real-space refinement for every residue).

The step is set internally to 2.

procedure: stepped_refine_protein_for_rama (imol):

refine each residue with ramachandran restraints

procedure: stepped_refine_protein_with_refine_func (imol, refine_func, res_step):
procedure: post_ligand_fit_gui ():

The gui that you see after ligand finding.

procedure: molecules_matching_criteria (test_func):

test_func is a function given one argument (a molecule number) that returns either False if the condition is not satisfied or something else if it is. And that "something else" can be a list like [label, x, y, z] or ["Bad Chiral", 0, "A", 23, "", "CA", "A"]

It is used in the create a button label and "what to do when the button is pressed".

procedure: refine_active_residue_generic (side_residue_offset):

This totally ignores insertion codes. A clever algorithm would need a re-write, I think. Well, we'd have at this end a function that took a chain_id res_no_1 ins_code_1 res_no_2 ins_code_2

And refine-zone would need to be re-written too, of course. So let's save that for a rainy day (days... (weeks)).

BL says:: this seems to ignore backup!

procedure: refine_active_residue ():

Function for keybinding. Speaks for itself

procedure: refine_active_residue_triple ():

And another one

procedure: manual_refine_residues (side_residue_offset):

For just one (this) residue, side-residue-offset is 0.

procedure: sphere_refine_regularize_generic (use_map=True, radius=3, expand=False):

generic spherical refinement (use_map) (or regularization, dont use map):

procedure: sphere_refine (radius=4.5, expand=False):

Sphere refinement (around radius)

procedure: sphere_refine_plus (radius=4.5):
procedure: sphere_regularize (radius=4.5, expand=False):

Sphere regularization (as above)

procedure: sphere_regularize_plus (radius=4.5):
procedure: pepflip_active_residue ():

Pepflip the active residue - needs a key binding

procedure: auto_fit_rotamer_active_residue ():

Another cool function that needs a key binding

procedure: add_extra_restraints_to_other_molecule (imol, chain_idresno_range_start, resno_range_end,atom_sel_type, imol_ref):

Restrain the atoms in imol (in give range selection) to corresponding atoms in imol_ref.

atom_sel_type is either 'all' 'main-chain' or 'ca'


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

24. parse_pisa_xml

procedure: pisa_assemblies (imol):
procedure: pisa_assemblies_xml (imol, file_name):
procedure: clean_xml_file (filename):

return a filename which is clean (pisa) xml or False if there was problems not sure if needed any more if v1.06

procedure: pisa_handle_xml_molecule (imol, molecule, pisa_results_type):

Exported to the main level. A molecule is common to assemblies and interfaces.

If pisa-result-type is 'assemblies', return a molecule number or False

If pisa-result-type is 'interfaces', return a interface-molecule record or False

If pisa-result-type is neither of the above, return False

a interface-molecule record contains information about pvalue and residues.

procedure: parse_pisa_assemblies (imol, entity):
procedure: make_pisa_config (pisa_coot_dir, config_file_name):
procedure: prep_for_pisa (mode, imol):

20100213 prep-for-pisa needs to make directory, config file, write the pdb file and the return value should be #f if there was a problem or some value where we can check that pisa -analyse ran (probably a directory). It is not clear right now where the output is going. config files has PISA_WORK_ROOT coot-pisa but things seems to be written to DATA_ROOT /home/emsley/ccp4/ccp4-6.1.3/share/pisa which seems like a bug (or something like it) in pisa. Needs rechecking

maybe santisation of xml fiel can go here too?!?!

procedure: cached_pisa_analysis (dir):

needs fleshing out (see notes for prep-for-pisa).

procedure: pisa_new_enough_qm ():

return pisa_command_exe or False

procedure: pisa_interfaces (imol):
procedure: pisa_interfaces_xml (imol, file_name):
procedure: parse_pisa_interfaces (imol, xml_entity):

pdb_entry pdb_code status n_interfaces interface id type n_occ int_area int_solv_en pvalue stab_en css overlap x-rel fixed h-bonds n_bonds bond chain-1 res-1 seqnum-1 inscode-1 atname-1 chain-2 res-2 seqnum-2 inscode-2 atname-2 dist salt-bridges n-bonds bond chain-1 res-1 seqnum-1 inscode-1 atname-1 chain-2 res-2 seqnum-2 inscode-2 atname-2 dist ss-bonds n-bonds bond chain-1 res-1 seqnum-1 inscode-1 atname-1 chain-2 res-2 seqnum-2 inscode-2 atname-2 dist cov-bonds n-bonds bond chain-1 res-1 seqnum-1 inscode-1 atname-1 chain-2 res-2 seqnum-2 inscode-2 atname-2 dist molecule id chain_id class symop symop_no cell_i cell_j cell_k rxx rxy rxz tx ryx ryy ryz ty rzx rzy rzz tz int_natoms int_nres int_area int_solv_en pvalue residues residue ser_no name seq_num ins_code bonds asa bsa solv_en


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

25. python_coot_docs

procedure: is_empty_file (file_name):
procedure: make_texi_file (python_file, doc_file):
procedure: make_section_file (section_file, base_name):
procedure: append_file (master_file_name, append_file_name):
procedure: remove_file (file_name):
procedure: make_menu (file_name):

first make the menu


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

26. user_defined_restraints

procedure: user_defined_add_single_bond_restraint ():
procedure: user_defined_add_arbitrary_length_bond_restraint ():
procedure: add_base_restraint (imol, spec_1, spec_2, atom_name_1, atom_name_2, dist):
procedure: a_u_restraints (spec_1, spec_2):
procedure: g_c_restraints (spec_1, spec_2):
procedure: user_defined_RNA_A_form ():
procedure: user_defined_add_helix_restraints ():
procedure: user_defined_delete_restraint ():
procedure: extra_restraints2refmac_restraints_file (imol, file_name):

exte dist first chain A resi 19 ins . atom N second chain A resi 19 ins . atom OG value 2.70618 sigma 0.4


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

27. with_pisa_gui


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

28. filter

procedure: filter (fn,ls):

Basic python function, filter the objects in list ls by function fn. e.g. filter(lambda x: not x%2, [0,1,2,3]) -> [0,2]


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

29. ncs

procedure: find_first_model_molecule ():
procedure: skip_to_next_ncs_chain (direction):

Skip the residue in the next chain (typically of a molecule with NCS) with the same residue number. If on the last chain, then wrap to beginning. If it can't find anything then don't move (and put a message in the status bar)

procedure: single_manual_ncs_ghosts (imol, resno_start, resno_end, ref_chain, peer_chain):

A function inspired by a question from Bill Scott. He wanted to RNA ghosts. Because RNA does not work with SSM, we need to define the matrix manually. Let's make a copy of given imol and get the rtop from that. Typical usage manual_ncs_ghosts(0, 1, 10, "A", "C")

procedure: manual_ncs_ghosts (imol, resno_start, resno_end, chain_id_list):

chain-id-list is ["A", "B", "C", "D"], i.e. the reference/target/master chain-id first and then the peers. This allows us to add many peers at the same time (unlike above function).

procedure: ncs_master_chain_id (imol):

Return the first master chain id (usually there is only one of course) or False

procedure: ncs_ligand (imol_protein, ncs_master_chain_idimol_ligand, chain_id_ligand,resno_ligand_start, resno_ligand_stop):

This was designed to create an NCS copy of a ligand (or range of residues) in the active site of one chain to the as yet unoccupied active site of another, i.e. it makes a NCS ligand "D"1 that is a NCS copy of ligand "C"1 using an NCS operator that maps protein chain "A" onto chain "B".


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

30. get_recent_pdbe

procedure: print_thread (txt):

fe_print = thread.allocate_lock()

procedure: coot_pdbe ():
procedure: get_recent_json (file_name):
procedure: dialog_box_of_buttons_with_async_ligands (window_name, geometrybuttons, close_button_label):

geometry is an improper list of ints.

return the h_box of the buttons.

a button is a list of [label, callback-thunk, text-description]

If check-button-label is False, don't make one, otherwise create with with the given label and "on" state.

procedure: cache_or_net_get_image (image_url, image_name, hbox):

Get image-name (caller doesn't care how) and when it is in place run func. This is a generally useful function, so it has been promoted outside of dig-table. mMMMmmm not sure if I want to run a lambda function here?! Let's see maybe this should be better queued, otherwise we may start lots of threads

procedure: refmac_calc_sfs_make_mtz (pdb_in_file_name, mtz_file_namemtz_refmaced_file_name):

return refmac_result or False

procedure: pdbe_get_pdb_and_sfs_cif (include_get_sfs_flagentry_id, method_string=""):

include_get_sfs_flag is either "no-sfs" or "include-sfs"

procedure: recent_structure_browser (t):
procedure: recent_entries_progress_dialog ():
procedure: pdbe_latest_releases_gui ():

Sameer Velankar says to get this file for the latest releases "http://www.ebi.ac.uk/pdbe-apps/jsonizer/latest/released/" (note the end "/")


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

31. clear_backup

procedure: delete_coot_backup_files (action_type):
procedure: clear_backup_gui ():

Make a GUI

return True or False depending on if the GUI dialog was shown (it isn't shown if there are no files to delete).

procedure: clear_backups_maybe ():

return a status, True or False, did the gui run?

Note that clear-backup-gui returns either true or False too.

If this function returns False, then coot_real_exit() just exits with coot_real_exit(). Otherwise we wait for the GUI.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

32. mutate

procedure: mutate_chain (imol,chain_id,sequence):

Mutate chain-id of molecule number imol given sequence.

The number of residues in chain-id must match the length of sequence.

procedure: multi_mutate (mutate_function,imol,start_res_no,chain_id,sequence):

an internal function of mutate, This presumes a protein sequence

procedure: mutate_residue_range (imol,chain_id,start_res_no,stop_res_no,sequence):

The stop-res-no is inclusive, so usage e.g. mutate_resiude_range(0,"A",1,2,"AC")

This presumes a protein sequence (not nucleic acid).

procedure: mutate_and_autofit_residue_range (imol,chain_id,start_res_no,stop_res_no,sequence):

mutate and auto fit a residue range

This presumes a protein sequence (not nucleic acid).

The sequence is a string of one letter codes

procedure: mutate_and_auto_fit (residue_number,chain_id,mol,mol_for_map,residue_type):

mutate and autofit whole chain

This presumes a protein sequence (not nucleic acid).

procedure: maf (*args):

a short-hand for mutate-and-auto-fit

procedure: three_letter_code2single_letter (residue_type):

return a char (well string in python), return "A" for unknown residue_type

procedure: mutate_nucleotide_range (imol, chain_id, resno_start, resno_end, sequence):
procedure: mutate_residue_redundant (residue_number,chain_id,imol,residue_type,insertion_code):

a wrapper for mutate_single_residue_by_seqno (which uses slightly inconvenient single letter code)

Here residue-type is the 3-letter code

procedure: poly_ala (imol, res_type = False):

Prompted by Tim Gruene's email to CCP4bb 20060201. Turn all residues (including GLY) of imol to ALA.

type is an optional argument. if type is 'SER' then build polySer, if type is 'GLY', build polyGly.

1 or 2 args are:

1.) imol

2.) [optional] type, if type is "SER" then build polySer, if type is "GLY", build polyGly.

procedure: delete_sidechain_range (imol, chain_id, resno_start, resno_end):

Delete (back to the CB stub) the side change in the range resno-start to resno-end


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

33. exercise_python_mol

procedure: jiggled_mol (reference_mol, current_mol, traj_frac):

Return a python_mol

procedure: disrupt (reference_mol, biggness):

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

34. generic_objects

procedure: generic_object_is_displayed_qm

BL says:: just to be consistent with Paul's names map to scheme names:

procedure: is_closed_generic_object_qm

map to scheme names:

procedure: generic_object_with_name (obj_name):

return a new generic object number for the given object obj-name. If there is no such object with name obj-name, then create a new one. (Maybe you want the generic object to be cleaned if it exists before returning, this function does not do that).

procedure: generic_objects_gui ():

display a GUI for generic objects

procedure: reduce_on_pdb_file (imol, pdb_in, pdb_out):

return status

procedure: probe (imol):

run molprobity (well reduce and probe) to make generic objects (and display the generic objects gui)

procedure: write_reduce_het_dict (imol, reduce_het_dict_file_name):

Write the connectivity for the non-standard (non-water) residues in the given molecule for which we have the dictionary.

Don't return anything interesting.

procedure: prepare_file_for_probe (file_in, file_out):

Prepare file for probe, i.e. remove 'USER' from file

procedure: interactive_probe (x_cen, y_cen, z_cen, radius, chain_id, res_no):

run "probe" interactively, which in the current implementation, means that this function can run during a edit-chi angles manipulation, or after a real space refine zone.

Thus function presumes that there are 2 pdb files in the current directory, one of which is the reference pdb file and the other is a pdb file containing the tmp/moving atom set.

The function takes arguments for the centre of the probe dots and the radius of the probe dots sphere. The chain id and residue number are also needed to pass as arguments to probe.

procedure: get_probe_dots_from (pdb_file_name, point, radius):
procedure: probe_local_sphere (imol, radius):

Update the generic objects probe dots from residues within radius of the screen centre.

Return nothing interesting.

procedure: write_pdb_file_for_molprobity (imol, pdb_name):

add in the conn files by concatting.

procedure: toggle_interactive_probe_dots (widget=None):

a toggle function for the main toolbar to switch on probe dots post refine and for chis/rotamers


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

35. test_hole


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

36. hello

procedure: first_non_trivial_name (str_list):

Primarily for Indian Names.

Say we are given str: (list "M." "D." "Albert" "Dorkins"). We want to return ""Albert" not "M.") We reject names that are one character long and names that are 2 characters long that end in ".". So, "M." is rejected, but "Ma" is not.

An excercise for the committed is to also reject run-together dotted initials such as "D.K.". I was sufficiently committed. BL says: I'll try to too! Although I dont think this is a valuable (Win)Coot function, but fun though...


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

37. coot_utils

procedure: ult_ball_and_stick_selection = "//A/1-2"

obal default_ball_and_stick_selection

procedure: with_no_backups (imol, *funcs):

'Macro' to tidy up a a setup of functions to be run with no backup for a particular molecule.

funcs is a normal set of functions (not a thunk), here i.e. a list of functions with function as a list with func name and args, e.g.: [centre_of_mass, 0], [func_name, arg1, arg2,...],...

procedure: with_auto_accept (*funcs):

'Macro' to tidy up a set of functions to be run with automatic accepting of the refinement returns the result of last function run...

funcs is a normal set of functions (not a thunk), here i.e. a list of functions with function as a list with func name and args, e.g.: [centre_of_mass, 0], [func_name, arg1, arg2,...],...

procedure: using_active_atom (*funcs):

'Macro' to run funcs on an active atom funcs is function, active_atom specifiers and extra args func, args, "aa_imol", "aa_chain_id", ..., args or list thereof [[func1, extra_arg1, ..., "aa_imol", "aa_chain_id",..., extra_arg2, extra arg3, ..], [func2,...]] returns what? The value from the last function evaluated

procedure: molecule_has_hydrogens (imol):

Pythonize function: return a python boolean.

procedure: pre_release_qm ():

return a boolean

procedure: molecule_number_list ():

return a list of molecule numbers (closed and open) The elements of the returned list need to be tested against is_valid_model_molecule_qm

procedure: directory_is_modifiable_qm (prefix_dir):

Test for prefix-dir (1) being a string (2) existing (3) being a directory (4-6) modifiable by user (ie. u+rwx). prefix_dir must be a string.

Return True or False.

procedure: most_recently_created_file (glob_str, dir):

Find the most recently created file from the given glob and dir

return False on no-such-file

procedure: residue_spec2atom_selection_string (centre_residue_spec):

Convert a residue_spec to an mmdb atom selection string. FIXME:: to be tested

procedure: spec2imol (atom_spec):
procedure: map_molecule_list ():

Return a list of molecules that are maps

procedure: model_molecule_list ():

Return a list of molecules that are (coordinate) models

procedure: shelx_molecule_qm (imol):

Return True(False) if imol is (isn't) a shelx molecule.

procedure: set_virtual_trackball_type (type):

Set the virtual trackball behaviour.

trackball type is a string: either 'flat' or 'spherical-surface'

procedure: list_of_strings_qm (ls):

Is ls a list of strings? Return True or False

procedure: string_append_with_spaces (ls):

string concat with spaces, ls must be a list of strings.

procedure: rotation_centre ():

The screen centre.

return the rotation centre as a 3 membered list of numbers is python list [...] !!!

procedure: number_list (a,b):

this is actually not essentail since python has these funtion(s)

procedure: file_n_lines (file_name):
procedure: check_output (*popenargs, **kwargs):

backport, so that we can replace once move to Python 2.7 is done

procedure: shell_command_to_string (cmd):

returns false of there is a problem running cmd

procedure: command_in_path_qm (cmd):

Return True or False adapted from find_exe this finds absolute file names too

procedure: popen_command (cmd, args, data_list, log_file, screen_flag=False):

k_thread_return_value = None Where cmd is e.g. "refmac" args is ["HKLIN","thing.mtz"] log_file_name is "refmac.log" data_list is ["HEAD","END"] screen_flag True/False to display or not in shell window

Return the exist status e.g. 0 or 1. Or False if cmd not found.

uses os.popen if python version < 2.4 otherwise subprocess

procedure: close_float_qm (x1, x2):

Crude test to see of 2 floats are the same (more or less). Used in a unit test after setting the atom position.

procedure: strip_extension (s):

"a.b.res" -> "a.b" file_name_sans_extension

procedure: file_name_extension (file_name):

What is the extension of file_name?

"a.pdb" -> "pdb" "" -> ""

procedure: add_tmp_extension_to (file_name):

e.g. "a.pdb" -> "a-tmp.pdb"

procedure: file_name_sans_extension (s):

Same function as strip_extension, different name, as per scsh, in fact.

procedure: strip_path (s):

/a/b.t -> b.t d/e.ext -> e.ext file-name-sans-path

procedure: slash_start_qm (s):

does s start with a "/" ? return True or False

for windows return True when drive letter, e.g. C, or even \\ (backslash):

procedure: unique_date_time_str ():

return a string that contains the date/time e.g. "2006-01-02_2216.03"

procedure: every_nth (ls, n):

return a list that has only every-nth members; e.g. every_nth ([0,1,2,3,4,5,6,7,8],2) -> [0,2,4,6,8] every_nth ([0,1,2,3,4,5,6,7,8],3) -> [0,3,6]

n must be positive

procedure: get_atom (imol, chain_id, resno, ins_code, atom_name, alt_conf_internal=""):

return atom info or False (if atom not found).

procedure: residue_info_dialog_displayed_qm ():
procedure: multi_read_pdb (glob_pattern, dir):

multi_read pdb reads all the files matching glob_pattern in directory dir. Typical usage of this might be: multi_read_pdb("a*.pdb",".") BL says: in windows dir needs the 'C:/' pattern, '/c/'won't work

procedure: read_pdb_all ():

read_pdb_all reads all the "*.pdb" files in the current directory.

procedure: coot_mkdir (dir_name):

return False if dir_name is a file or we can't do the mkdir

procedure: view_matrix ():

return the view matrix (useful for molscript, perhaps). BL says: like all matrices is a python list [...]

procedure: view_matrix_transp ():

return the transposed view matrix (useful for molscript, perhaps). BL says: like all matrices is a python list [...]

procedure: view_quaternion ():

return the view quaternion

procedure: add_view (position, quaternion, zoom, view_name):

Return the view number

procedure: matrix2quaternion (m00, m10, m20, m01, m11, m21, m02, m12, m22):

Convert a view matrix to a view quaternion to set Coot view internals.

procedure: set_view_matrix (m00, m10, m20, m01, m11, m21, m02, m12, m22):

Set the view matrix using matrix->quaternion.

Useful for using a view matrix from another program, perhaps.

procedure: miguels_axes ():

Miguel's molecular orientation axes

procedure: molecule_centre (imol):

Return the molecule centre as a list of 3 numbers.

Note: mol_cen could contain values less than -9999.

procedure: move_molecule_to_screen_centre (imol):

Move the centre of molecule number imol to the current screen centre

procedure: move_molecule_here

(rotate_centre[2]-molecule_centre(imol)[2])) This is a short name for the above.

procedure: identity_matrix ():

Return a nine-membered list of numbers.

procedure: translation (axis,length):

e.g. translation('x',2) -> [2, 0, 0] Return: False on error

procedure: rotate_about_screen_axis (axis,degrees):

Rotate degrees about screen axis, where axis is either 'x', 'y' or 'z'.

procedure: toggle_display_map (imol, idummy):

Support for old toggle functions. (consider instead the raw functions use the direct set_displayed functions).

procedure: toggle_display_mol (imol):

toggle the display of imol

procedure: toggle_active_mol (imol):

toggle the active state (clickability) of imol

procedure: python_representation (imol):

return a python (list) representation of molecule imol, or False if we can't do it (imol is a map, say)

procedure: reorder_chains (imol):

reorder chains

procedure: transform_coords_molecule (imol, rtop):

transform a coordinates molecule by a coot-rtop (which is a Python expression of a clipper::RTop), i.e. a list of a 9-element list and a 3 element list, e.g. [[1, 0, 0, 0, 1, 0, 0, 0, 1], [4.5, 0.4, 1.2]]

procedure: transform_map (*args):

transform_map(imol, mat, trans, about_pt, radius, space_group, cell)

where space_group is a HM-symbol and cell is a list of 6 parameters, where the cell angles are in degrees.

or transform_map(imol, trans, about_pt, radius) for a simple translation

or transform_map(imol, trans, radius) when using the default rotation-centre as the about-pt

returns new map mol number or None if no map could be transformed/created

procedure: get_first_ncs_master_chain ():

return then NCS master of the first molecule that has ncs.

return "" on fail to find an ncs chain

procedure: transform_map_using_lsq_matrix (imol_ref, ref_chain, ref_resno_start, ref_resno_endimol_mov, mov_chain, mov_resno_start, mov_resno_end,imol_map, about_pt, radius):

Define a map transformation function that obeys Lapthorn's Law of NCS Handling Programs

typical usage: transform_map_using_lsq_matrix(1, "A", 10, 30, 0, "A", 10, 30, 2, rotation_centre(), 6)

Remember, that now the about-pt is the "to" point, i.e. the maps are brought from somewhere else and generated about the about-pt.

procedure: brighten_map (imol, scale_factor):

Make the imol-th map brighter.

Scale_factor > 1 makes brighter...

procedure: brighten_maps ():

Make all maps brighter

procedure: darken_maps ():

Make all maps darker

procedure: chain_ids (imol):

return a list of chain ids for given molecule number imol. return empty list on error

procedure: is_solvent_chain_qm (imol,chain_id):

convert from interface name to schemisch name to be equivalent to Paul's naming

return True or False

procedure: valid_model_molecule_qm (imol):

python (schemeyish) interface to eponymous scripting interface function!? return True or False

procedure: valid_map_molecule_qm (imol):

python (schemeyish) interface to eponymous scripting interface function. return True or False

procedure: valid_refinement_map_qm ():

convenience function (slightly less typing).

Return True or False

procedure: shelx_molecule_qm (imol):

python (schemeyish) interface to shelx molecule test

Return True or False

procedure: is_difference_map_qm (imol_map):

python (schemeyish) interface to the function that returns whether or not a map is a difference map.

Return True or False.

procedure: residue_exists_qm (imol,chain_id,resno,ins_code):

Does residue resno with insertion code ins_code of chain chain_id and in molecule number imol exist?

Return True or False

procedure: residue_has_hetatms_qm (imol, chain_id, res_no, ins_code):

Does the residue contain hetatoms? Return True or False.

procedure: centre_of_mass (imol):

Return a list of 3 float for the centre of mas of molecule number imol.

on failure return False.

procedure: atom_specs (imol, chain_id, resno, ins_code, atom_name, alt_conf):

Return as a list the occupancy, temperature_factor, x y z coordinates of the given atom. (the x,y,z are in Cartesian Angstroms).

on error (e.g. atom not found) return False

procedure: atom_spec2residue_spec (atom_spec):
procedure: guess_refinement_map ():

return a guess at the map to be refined (usually called after imol_refinement_map returns -1)

Basically uses the first not difference map we find!

procedure: auto_weight_for_refinement ():

Set the refinement weight (matrix) by iterating the refinement and varying the weight until the chi squares (not including the non-bonded terms) reach 1.0 =/- 10%. It uses sphere refinement. The refinement map must be set!! At the end show the new weight in the status bar. Seems to take about 5 rounds. (bails out after 20)

procedure: print_sequence (imol):

Print the sequence of molecule number imol

This is not really a util, perhaps it should be somewhere else?

procedure: pir_file_name2pir_sequence (pir_file_name):

simple utility function to return the contents of a file as a string.

procedure: associate_pir_file (imol, chain_id, pir_file_name):

Associate the contents of a PIR file with a molecule.

procedure: associate_fasta_file (imol, chain_id, pir_file_name):

Associate the contents of a fasta file with a molecule.

procedure: graphics_comma_key_pressed_hook ():

comma key hook

procedure: graphics_dot_key_pressed_hook ():

dot key hook

procedure: decode_key (key_val_name):
procedure: add_key_binding (name, key, thunk):

Add a key binding

with a given name, key (e.g. "x" or "S") and the function to run (a thunk) when that key is pressed.

procedure: graphics_general_key_press_hook (key, control_flag = 0):

general key press hook, not for public use!!

procedure: read_vu_file (filename, obj_name):

Function requested by Mark White.

read XtalView (and maybe other) .vu files and convert them into generic objects.

Pass the filename and an object name e.g. read_vu_file("axes.vu", "axes")

Returns: nothing interesting.

procedure: residues_matching_criteria (imol, residue_test_func):

residue_test_func is a function that takes 4 arguments, the chain_id, resno, inscode and residue_serial_number (should it be needed) and returns either False or return something interesting (e.g. text for a button label).

Return a list of residues, each of which has a return value at the start, ie. [return_value, chain_id, res_no, ins_code]

procedure: all_residues (imol):

Return residue specs for all residues in imol (each spec is preceeded by True)

procedure: residues_with_alt_confs (imol):

Return a list of all residues that have alt confs: where a residue is specified thusly: [[chain_id, resno, ins_code], [...] ]

procedure: residue_alt_confs (imol, chain_id, res_no, ins_code):

Return a list of all the altconfs in the residue. Typically this will return [""] or ["A", "B"]

procedure: atoms_with_zero_occ (imol):

Return a list of all atoms that have zero occupancy: where an atom is specified thusly: [[chain_id, resno, ins_code, name, altconf], [...] ]

procedure: res_spec2chain_id (res_spec):

simple extraction function

procedure: res_spec2res_no (res_spec):

simple extraction function

procedure: res_spec2ins_code (res_spec):

simple extraction function

procedure: residue_spec2atom_for_centre (imol, chain_id, res_no, ins_code):

Return False if no atom can be found given the spec else return a list consisting of the atom name and alt-conf specifier.

Choose an atom that is called " CA ". Failing that choose the first atom.

procedure: set_go_to_atom (res_spec):
procedure: update_go_to_atom_from_current_atom ():
procedure: flip_active_ligand ():
procedure: delete_atom_by_active_residue ():

Typically one might want to use this on a water, but it deletes the nearest CA currently... Needs a re-think. Should active-atom just return the nearest atom and not be clever about returning a CA.

procedure: mutate_by_overlap (imol, chain_id_in, resno, tlc):

general mutate

typically:

overlay PTY onto given TYR

delete speced TYR

merge molecules PTY molecule int molecule number imol

change resno of PTY to that of the speced TYR

change chain id of PTY to that of speced TYR

change chain ids with residue range for the PTY

procedure: phosphorylate_active_residue ():

A bit of fun

procedure: overlay_my_ligands (imol_mov, chain_id_mov, resno_movimol_ref, chain_id_ref, resno_ref):

A function for Overlaying ligands. The transformation is applied to all the atoms of the molecule that contains the moving ligand.

procedure: label_all_CAs (imol):
procedure: label_all_atoms_in_residue (imol, chain_id, resno, inscode):
procedure: label_all_active_residue_atoms ():
procedure: sanitise_alt_confs (atom_info, atom_ls):

Resets alt confs and occupancies of atoms in residue that have orphan alt-loc attributes

procedure: sanitise_alt_confs_in_residue (imol, chain_id, resno, inscode):
procedure: sanitise_alt_confs_active_residue ():

Resets alt confs and occupancies of atoms in residue that have orphan alt-loc attributes. Use the active-residue.

procedure: print_molecule_names ():
procedure: save_dialog_positions_to_init_file ():

save the dialog positions to the coot_dialog_positions.py file in ./coot-preferences

procedure: save_string_to_file (string, filename, overwrite=False):

saves a string to a file! if the string is already present dont do anything optional arg: overwrite False - default True - overwrite file

procedure: remove_line_containing_from_file (remove_str_ls, filename):

removes a line containg all strings of the given list from file

procedure: multi_chicken (imol, n_colours = False):

multiple maps of varying colour from a given map.

procedure: BALL_AND_STICK (): return 2

simple enumeration

procedure: hilight_binding_site (imol, centre_residue_spec, hilight_colour, radius):

hilight-colour is specified in degrees (round the colour wheel - starting at yellow (e.g. 230 is purple))

procedure: pukka_puckers_qm (imol):

Function based on Davis et al. (2007) Molprobity: all atom contacts and structure validation for proteins and nucleic acids, Nucleic Acids Research 35, W375-W383.

"RNA sugar puckers (C3'endo or C2'endo) is strongly correlated to the perpendicular distance between the following (3') phosphate and either the plane of the base or the C1'-N1/9 glycosidic bond vector. [] .. a sugar pucker is very difficult to determine directly from the electron density at resolutions typical for RNAs."

To paraphrase: The distance of the plane of the base to the following phosphate is highly correlated to the pucker of the ribose.

An analysis of the structures in RNADB2005 shows that a critical distance of 3.3A provides a partition function to separate C2' from C3' endo puckering. Not all ribose follow this rule. There may be some errors in the models comprising RNADB2005. So we check the distance of the following phosphate to the plane of the ribose and record the riboses that are inconsitent. We also report puckers that are not C2' or C3'. The puckers are determined by the most out-of-plane atom of the ribose (the rms deviation of the 4 atoms in the plane is calculated, but not used to determine the puckering atom).

procedure: new_molecule_by_smiles_string (tlc_text, smiles_text):

Run libcheck to convert from SMILES string

procedure: prodrg_ify (imol, chain_id, res_no, ins_code):

Generate restraints from the residue at the centre of the screen using PRODRG. Delete hydrogens from the residue because PRODRG has anomalous hydrogens.

procedure: add_annotation_here (text):
procedure: add_annotation_at_click (text):
procedure: save_annotations (file_name):
procedure: load_annotations (file_name):
procedure: make_latest_version_url ():

Here we construct the url that contains the latest (pre) release info adding in "pre-release" if this binary is a pre-release. args ends up as something like: ["xxx/phone_home.py", "pre-release" "binary", "Linux-1386-fedora-10-python-gtk2" "command-line", "/home/xx/coot/bin/coot"]

procedure: run_download_binary_curl (revision, version_stringpending_install_in_place_func,set_file_name_func=False, # combine with progress_bar?!progress_bar=False,use_curl=False):

Get the binary (i.e. the action that happens when the download button is pressed). This is run in a thread, so it cant do any graphics stuff (except for updating the progress bar when passed).

return True if tar file was successfully downloaded and untared and False if not.

This is using python/urllib by default, set use_curl to True to use curl

procedure: get_revision_from_string (stri):

get revision number from string

(used in downloading new version)

procedure: get_url_as_string (my_url):

for true pythonic url retrievel returns url as string or False if error

procedure: coot_split_version_string (stri):

first generate a version string with no trailing newline. actually removes last char (\n) and everything before c/W.

e.g. input: "coot-0.6.2-pre-1-revision-2765\n" output: "coot-0.6.2-pre-1-revision-2765"

procedure: file2string (file_name):

convert file to string

procedure: load_default_sequence ():

If "default.seq" (a simple text file with the sequence (not PIR or FASTA)) exists in the current directory, then try to assign it to each chain of each molecule.

In the first case the sequence is assigned to the closest match (model sequence to target sequence), subsequently only chains without a sequence associated with them are candidates for matching. The protein sequence has to have at least 95% sequence identity with the target sequence in "default.seq"

procedure: update_self (use_curl=False):

update self

keep a copy of the old directories around in a directory named after expiration time.

procedure: use_curl_status ():
procedure: set_use_curl (status):
procedure: chiral_centre_inverter ():

Invert the chiral centre of the atom we are centred on. If not centred on a chiral atom, then give a dialog.

The restraints for this monomer type are copied and renamed (changing comp-id, 3-letter-code and name too). The monomer is regularized. Chiral Hydrogen (if needed) is enabled now in the minimizer.

This should almost all be c++ code so that Bernie doesn't have to redo it. This is temporary then

procedure: residue_is_close_to_screen_centre_qm (imol, chain_id, res_no, ins_code):
procedure: using_gui ():
procedure: GL_light_on ():

for easier switching on of GL lighting on surfaces:

procedure: GL_light_off ():

and to turn it off

procedure: set_b_factor_molecule (imol, bval):

set B-factor to bval for molecule imol

procedure: reset_b_factor_molecule (imol):

reset B-factor for molecule imol to default value

procedure: reset_b_factor_active_residue ():

reset B-factor for active residue to default value

procedure: find_exe (*args):

BL module to find exe files we need this for popen as it requires the full path of the exe file we use arguments (min 1, no max?!:

1.) program_name : name of exe to find

2-x.) path_names : path name to search (usually "PATH", then maybe CCP4_BIN, ..., can be a single path as well)

then we search everywhere

on OS where which is available we use this first, rather than searching in PATH etc. (FIXME) returns full path of exe when successful, False otherwise

procedure: open_url (url):

for running online docs

procedure: reload_module (name):

to reload modules

procedure: printf (*args):

to make print a function:

procedure: printl (ls):

to print elements of a list:

procedure: run_concurrently (cmd, args=[], data_list=None, logfile=None, screen_flag=False):

Where cmd is e.g. "bltwish" args is list, e.g. [loggraph, "refmac.log"]

in python < 2.4 (and if no logfile)

Returns the pid or False if failed.

in python >= 2.4 (and with logfile)

Returns the process and the open log file object

uses os.spawn if python version < 2.4 otherwise subprocess

procedure: coot_has_pygtk ():

python command to see if we have pygtk available return True if availabel otherwise False

procedure: coot_has_gobject ():

python command to see if we have pygobject available return True if availabel otherwise False

procedure: kill_process (pid):

function to kill a process, given the process pid return True if managed to kill the process otherwise false

procedure: stereo_mono_toggle ():

some example function for the toolbutton

procedure: side_by_side_stereo_mono_toggle ():
procedure: zalman_stereo_mono_toggle ():
procedure: switch_stereo_sides ():
procedure: isNumber (num):

helper function to test for a number returns True if number, otherwise False

procedure: merge_solvent_chains (imol):

function to merge multiple solvent chains

procedure: cmd2str (*args):

helper to comvert functions to strings

procedure: is_windows ():

simplyfy check for windows

procedure: clean_pdb (imol):

clean up pdb file (imol) a wrapper for fix_nomenclature errors, sort chains, residues, merge solvent chains, renumber waters, etc.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

38. unittest_extensions

procedure: exec_file (filename):

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

39. remote_control

procedure: open_coot_listener_socket (port_number, host_adress = "127.0.0.1"):

Open a coot listener socket, return nothing much, but do set! %coot-listener-socket.

Hmmm... why make a side-effect like that? Why not return %coot-listener-socket so that the caller can set it? There may be a reason...

And the reason is that I can then call coot-listener-idle-function-proc without having to use a c++ variable.

BL says: this almost does what it should! it breaks the scripting window however! Or for that matter all python scripting which is not comming from the socket! Baeh! May need to thread it after all, but how?!?

procedure: open_coot_listener_socket_with_timeout (port_number, host_adress = "127.0.0.1"):

yet another go to make a coot port reader work. This time, we use a gtk-timer to read stuff from the socket.

The gtk-timer function must return True to be called again. When we want to close the socket reader, simply make the function return False.

procedure: coot_socket_timeout_func ():

based on coot_listener_idle_func_proc

procedure: coot_listener_idle_function_procbbbbbb ():
procedure: coot_listener_error_handler (key, args=""):
procedure: coot_listener_idle_function_proc ():
procedure: listen_coot_listener_socket (soc):

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

40. refmac

procedure: refmac_extra_params

Extra parameters can be passed to refmac using either a file "refmac-extra-params" or by setting the variable refmac-extra-params. The LABIN line should not be part those extra parameters, of course - Coot takes care of that. refmac_extra_params should be a list, like refmac_extra_params = ['NCYC 0', 'WEIGHT 0.2']

if refmac_extra_params is given we use that! Otherwise we check for a refmac-extra-params.txt file also params given in .coot.py are considered very first, so check is:

1.) whatever is written here

2.) .coot.py (needs to include: global refmac_extra_params)

3.) refmac-extra-params.txt

procedure: split_label (label):

/a/b/c -> c

procedure: run_loggraph (logfile):

BL says: for loggraph we use a function

procedure: run_refmac_by_filename (pdb_in_filename, pdb_out_filenamemtz_in_filename, mtz_out_filename,extra_cif_lib_filename, imol_refmac_count,swap_map_colours_post_refmac_p,imol_mtz_molecule, show_diff_map_flag,phase_combine_flag, phib_fom_pair,force_n_cycles, make_molecules_flag,ccp4i_project_dir, f_col, sig_f_col, r_free_col=""):

make_molecules_flag is synonymous with continue after refmac run, i.e. read molecules, run loggraph etc., furthermore not threaded, in other words

make_molecules_flag is tested for being = 0, if not 0, then this is the main thread and we can do graphics things, like read in a pdb and mtz file to make new molecules.

procedure: post_run_refmac (imol_refmac_count, swap_map_colours_post_refmac_pshow_diff_map_flag,pdb_out_filename, mtz_out_filename, mtz_in_filename,refmac_log_file_name,phib_fom_pair, f_col, sig_f_col, r_free_col,phase_combine_flag,refmac_process, logObj=None,button = None, run_in_timer=False):
procedure: extra_params_include_weight_p (params_list):

Return True if the list of strings params_list contains a string beginning with "WEIGHT". If not return False

procedure: add_refmac_extra_params (pre_lines, force_no_cycles):

If refmac-extra-params is defined (as a list of strings), then add that, read the file "refmac-extra-params.txt" and add to the refmac parameters

Return a list a list of strings.

procedure: run_refmac_for_phases (imol, mtz_file_name, f_col, sig_f_col):
procedure: refmac_for_phases_and_make_map (mtz_file_name, f_col, sig_f_col):
procedure: read_refmac_log (imol, refmac_log_file):

This will read a refmac log file and extract information in interesting_things_gui format, i.e. a list with either coorinates or residues to be flagged as interesting

the list of extracted information may look like: [[0, "A", 43, [bond_deviations, [atom, value],[atom2, value2]], [vdw_deviation, [atoms, value]], [more deviations]], next res]

e.g. interesting_things_gui( "Bad things by Analysis X", [["Bad Chiral",0,"A",23,"","CA","A"], ["Bad Density Fit",0,"B",65,"","CA",""], ["Interesting blob",45.6,46.7,87.5]]

procedure: get_refmac_version ():

returns the major refmac version, i.e. [5, 3] (for 5.3) or False if no refmac found


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

41. local_code


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

42. americanisms

procedure: set_rotation_center

an americanism

procedure: handle_read_draw_molecule_with_recenter

an americanism

procedure: set_rotation_center_size

an americanism

procedure: center_atom_label_status

an americanism

procedure: set_last_map_color

an americanism

procedure: center_of_mass

an americanism

procedure: set_font_color

an americanism

procedure: set_dots_color

an americanism

procedure: rotation_center

an americanism

procedure: move_molecule_to_screen_center

an americanism


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

43. example_python_mol_representation


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

44. cns2coot

procedure: cns2coot (twofofc_coeffs, fofc_coeffs, model_pdb):

Read in cns coeff-data (given filenames) and a pdb molecule filename to make maps.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

45. get_ebi

procedure: check_dir_and_get_url (dir,file_name,url_string):

check the directory and get url url_string.

procedure: get_url_str (id, url_string, data_type, imol_coords_arg_list):

get url_string for data type (string actually) 'pdb' or 'sfs'

procedure: get_ebi_pdb_and_sfs (id):

Get the pdb and sfs. id is the accession code

procedure: get_ebi_pdb (id):

Return a molecule number on success or not a number (False) or -1 on error.

procedure: get_eds_pdb_and_mtz (id):

Get data and pdb for accession code id from the Electron Density Server.

id is the accession code.

returns imol of read pdb or False on error.

20050725 EDS code

return a list of 3 molecule numbers [imol, map, diff_map] or False


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

46. create_input_server

procedure: make_server_for_remote_control ():

[Top] [Contents] [Index] [ ? ]

About This Document

This document was generated by Bernhard Lohkamp on February, 9 2012 using texi2html 1.78.

The buttons in the navigation panels have the following meaning:

Button Name Go to From 1.2.3 go to
[ < ] Back Previous section in reading order 1.2.2
[ > ] Forward Next section in reading order 1.2.4
[ << ] FastBack Beginning of this chapter or previous chapter 1
[ Up ] Up Up section 1.2
[ >> ] FastForward Next chapter 2
[Top] Top Cover (top) of document  
[Contents] Contents Table of contents  
[Index] Index Index  
[ ? ] About About (help)  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:


This document was generated by Bernhard Lohkamp on February, 9 2012 using texi2html 1.78.