| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
" 53" -> "53", " " -> ""
consider for coot_utils
consider for coot_utils
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
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.
action is either 'gui' (then we get a gui) or 'apply-actions', then the model modifications are automatically applied.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
flash the background different colours in some uninteresting way.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
a list of tips for Coot
Function to turn off coot tips at start
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Is this true? Dont understand this
needs testing!
return True or False (None on error, maybe should return some Error!?) although if no return, then var becomes None anyway.. FIXME).
show the dialog
version_string is something like: "coot-0.6-pre-1-revision-2060"
returns latest installer version in pending-install or empty string "" if no installer for windows use only!
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
put all coot svgs in the default icon set
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
save a toolbar button to ~/.coot-preferences/coot_toolbuttons.py
remove a toolbar from ~/.coot-preferences/coot_toolbuttons.py
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] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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.
The callback from pressing the Go button in the smiles widget, an interface to run libcheck.
smiles GUI
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.
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.
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.
A demo gui to move about to molecules
A BL function to analyse the libcheck log file
old coot test
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]]
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
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
Fill an option menu with maps and return the list of maps
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.
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
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
Typically option_menu_fill_function is fill_option_menu_with_coordinates_mol_options
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.
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.
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.
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
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
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.
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.
Make an interesting things GUI for residues of molecule number imol that have alternate conformations.
Make an interesting things GUI for residues with missing atoms
Make an interesting things GUI for residues with zero occupancy atoms
Make an interesting things GUI for residues of molecule number imol for the given imol. A generalization of alt-confs gui.
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
returns a list of existing toolbar buttons [[label, toolbutton],[]...] or False if coot_python is not available
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.
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.
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.
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.
pack a hint text and a molecule chooser option menu into the given vbox.
return the option-menu and model molecule list:
Return an entry, the widget is inserted into the hbox passed to this function
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
The gui for the strand placement function
Cootaneer gui
The gui for saving views
a button is a list of [label, callback, text_description]
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
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.
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
as the dialog_box_of_buttons, but we can put in an extra widget (extra_widget)
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)
ews_dialog_vbox = False A gui showing views
nudge screen centre box. Useful when Ctrl left-mouse has been taken over by another function.
This is using the absolute coordinates
nudge screen centre box. Useful when Ctrl left-mouse has been taken over by another function.
This is using the viewing coordinates
as nudge_screen_centre_gui but with clipping and zoom control
A gui to make a difference map (from arbitrarily gridded maps (that's it's advantage))
GUI for ligand superpositioning by graph matching
Cootaneer/sequencing gui modified by BL with ideas from KC based on Paul's cootaneer gui and generic_chooser_entry_and_file_selector
a function to run a pygtk widget in a function as a thread
a master gui to set all kinds of refinement parameters
a simple window to show a progress bar return the window (to be destroyed elsewhere)
port threading helper function to push the python threads this only runs python threads for 20ms every 50ms
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
Associate the contents of a PIR file with a molecule. Select file from a GUI.
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.
Wrapper in that we test if there have been sequence(s) assigned to imol before we look for the sequence mismatches
ved_residue_ranges = []
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).
USER MODS gui
simple rename residue GUI
molecule chooser
coordination number chooser
Max dist entry
results vbox containing buttons with atom-spec labels
h-sep
close-button
return a list, or False (e.g. if not in same chain and molecule)
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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
helper function to see if a sequence has been assigned to a chain in imol return True if sequence is there, False otherwise
For Kay Diederichs, autofit without a map (find rotamer with best clash score). This ignores alt conformations and residues with insertion codes.
calculate the average of 20% lowest density at all atom_positions in fragment
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
given a number and a gtk text widget text (textbuffer!), put tip number n into the widget.
increment the tip number when the user sees a tip
decrement the tip number when the user sees a tip
run the tips gui.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Internal type conversion for LSQ fitting. Return a number according to the symbod match_type_in
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]
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.
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] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
return a string or False
loop_building_tool is either 'rapper' or 'ARP/wARP'
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
args not including the output filename
run raster3d
Run either raster3d or povray
image_type is either 'raster3d' or 'povray'
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
Tests file names for spaces. there is certainly on problem on windows not sure about other OS, yet
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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)
shelxl refinement with input text
do-shelx-lst-file
ie. create a interesting-things GUI for split (and other things?) in a shelx .lst file.
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] | [ ? ] |
args not including the output filename
Run provray using current displayed image and write .pov file to default filename
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
to be over-ridden by your favourite 3d conformer generator, if you like...
int "new prodrg_import.py"
ase_transfer_latest_time = get_file_latest_time(sbase_to_coot_tlc) FIXME: this is not a proper name
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
Why do we pass imol etc and then use active atom?
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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] | [ ? ] |
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).
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.
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
this will stop the currently running interuptible fit protein function
Continue with the interruptible fitting
use to completely stop the interruptible fit function
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).
As fit_chain, but only for a residue range from resno_start to resno_end
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)
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
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.
refine each residue with ramachandran restraints
The gui that you see after ligand finding.
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".
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!
Function for keybinding. Speaks for itself
And another one
For just one (this) residue, side-residue-offset is 0.
generic spherical refinement (use_map) (or regularization, dont use map):
Sphere refinement (around radius)
Sphere regularization (as above)
Pepflip the active residue - needs a key binding
Another cool function that needs a key binding
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] | [ ? ] |
return a filename which is clean (pisa) xml or False if there was problems not sure if needed any more if v1.06
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.
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?!?!
needs fleshing out (see notes for prep-for-pisa).
return pisa_command_exe or False
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] | [ ? ] |
first make the menu
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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] | [ ? ] |
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)
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")
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).
Return the first master chain id (usually there is only one of course) or False
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] | [ ? ] |
fe_print = thread.allocate_lock()
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.
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
return refmac_result or False
include_get_sfs_flag is either "no-sfs" or "include-sfs"
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] | [ ? ] |
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).
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] | [ ? ] |
Mutate chain-id of molecule number imol given sequence.
The number of residues in chain-id must match the length of sequence.
an internal function of mutate, This presumes a protein 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).
mutate and auto fit a residue range
This presumes a protein sequence (not nucleic acid).
The sequence is a string of one letter codes
mutate and autofit whole chain
This presumes a protein sequence (not nucleic acid).
a short-hand for mutate-and-auto-fit
return a char (well string in python), return "A" for unknown residue_type
a wrapper for mutate_single_residue_by_seqno (which uses slightly inconvenient single letter code)
Here residue-type is the 3-letter code
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.
Delete (back to the CB stub) the side change in the range resno-start to resno-end
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Return a python_mol
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
BL says:: just to be consistent with Paul's names map to scheme names:
map to scheme names:
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).
display a GUI for generic objects
return status
run molprobity (well reduce and probe) to make generic objects (and display the generic objects gui)
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.
Prepare file for probe, i.e. remove 'USER' from file
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.
Update the generic objects probe dots from residues within radius of the screen centre.
Return nothing interesting.
add in the conn files by concatting.
a toggle function for the main toolbar to switch on probe dots post refine and for chis/rotamers
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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] | [ ? ] |
obal default_ball_and_stick_selection
'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,...],...
'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,...],...
'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
Pythonize function: return a python boolean.
return a boolean
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
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.
Find the most recently created file from the given glob and dir
return False on no-such-file
Convert a residue_spec to an mmdb atom selection string. FIXME:: to be tested
Return a list of molecules that are maps
Return a list of molecules that are (coordinate) models
Return True(False) if imol is (isn't) a shelx molecule.
Set the virtual trackball behaviour.
trackball type is a string: either 'flat' or 'spherical-surface'
Is ls a list of strings? Return True or False
string concat with spaces, ls must be a list of strings.
The screen centre.
return the rotation centre as a 3 membered list of numbers is python list [...] !!!
this is actually not essentail since python has these funtion(s)
backport, so that we can replace once move to Python 2.7 is done
returns false of there is a problem running cmd
Return True or False adapted from find_exe this finds absolute file names too
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
Crude test to see of 2 floats are the same (more or less). Used in a unit test after setting the atom position.
"a.b.res" -> "a.b" file_name_sans_extension
What is the extension of file_name?
"a.pdb" -> "pdb" "" -> ""
e.g. "a.pdb" -> "a-tmp.pdb"
Same function as strip_extension, different name, as per scsh, in fact.
/a/b.t -> b.t d/e.ext -> e.ext file-name-sans-path
does s start with a "/" ? return True or False
for windows return True when drive letter, e.g. C, or even \\ (backslash):
return a string that contains the date/time e.g. "2006-01-02_2216.03"
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
return atom info or False (if atom not found).
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
read_pdb_all reads all the "*.pdb" files in the current directory.
return False if dir_name is a file or we can't do the mkdir
return the view matrix (useful for molscript, perhaps). BL says: like all matrices is a python list [...]
return the transposed view matrix (useful for molscript, perhaps). BL says: like all matrices is a python list [...]
return the view quaternion
Return the view number
Convert a view matrix to a view quaternion to set Coot view internals.
Set the view matrix using matrix->quaternion.
Useful for using a view matrix from another program, perhaps.
Miguel's molecular orientation axes
Return the molecule centre as a list of 3 numbers.
Note: mol_cen could contain values less than -9999.
Move the centre of molecule number imol to the current screen centre
(rotate_centre[2]-molecule_centre(imol)[2])) This is a short name for the above.
Return a nine-membered list of numbers.
e.g. translation('x',2) -> [2, 0, 0] Return: False on error
Rotate degrees about screen axis, where axis is either 'x', 'y' or 'z'.
Support for old toggle functions. (consider instead the raw functions use the direct set_displayed functions).
toggle the display of imol
toggle the active state (clickability) of imol
return a python (list) representation of molecule imol, or False if we can't do it (imol is a map, say)
reorder chains
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]]
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
return then NCS master of the first molecule that has ncs.
return "" on fail to find an ncs chain
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.
Make the imol-th map brighter.
Scale_factor > 1 makes brighter...
Make all maps brighter
Make all maps darker
return a list of chain ids for given molecule number imol. return empty list on error
convert from interface name to schemisch name to be equivalent to Paul's naming
return True or False
python (schemeyish) interface to eponymous scripting interface function!? return True or False
python (schemeyish) interface to eponymous scripting interface function. return True or False
convenience function (slightly less typing).
Return True or False
python (schemeyish) interface to shelx molecule test
Return True or False
python (schemeyish) interface to the function that returns whether or not a map is a difference map.
Return True or False.
Does residue resno with insertion code ins_code of chain chain_id and in molecule number imol exist?
Return True or False
Does the residue contain hetatoms? Return True or False.
Return a list of 3 float for the centre of mas of molecule number imol.
on failure return False.
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
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!
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)
Print the sequence of molecule number imol
This is not really a util, perhaps it should be somewhere else?
simple utility function to return the contents of a file as a string.
Associate the contents of a PIR file with a molecule.
Associate the contents of a fasta file with a molecule.
comma key hook
dot key hook
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.
general key press hook, not for public use!!
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.
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]
Return residue specs for all residues in imol (each spec is preceeded by True)
Return a list of all residues that have alt confs: where a residue is specified thusly: [[chain_id, resno, ins_code], [...] ]
Return a list of all the altconfs in the residue. Typically this will return [""] or ["A", "B"]
Return a list of all atoms that have zero occupancy: where an atom is specified thusly: [[chain_id, resno, ins_code, name, altconf], [...] ]
simple extraction function
simple extraction function
simple extraction function
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.
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.
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
A bit of fun
A function for Overlaying ligands. The transformation is applied to all the atoms of the molecule that contains the moving ligand.
Resets alt confs and occupancies of atoms in residue that have orphan alt-loc attributes
Resets alt confs and occupancies of atoms in residue that have orphan alt-loc attributes. Use the active-residue.
save the dialog positions to the coot_dialog_positions.py file in ./coot-preferences
saves a string to a file! if the string is already present dont do anything optional arg: overwrite False - default True - overwrite file
removes a line containg all strings of the given list from file
multiple maps of varying colour from a given map.
simple enumeration
hilight-colour is specified in degrees (round the colour wheel - starting at yellow (e.g. 230 is purple))
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).
Run libcheck to convert from SMILES string
Generate restraints from the residue at the centre of the screen using PRODRG. Delete hydrogens from the residue because PRODRG has anomalous hydrogens.
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"]
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
get revision number from string
(used in downloading new version)
for true pythonic url retrievel returns url as string or False if error
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"
convert file to string
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"
update self
keep a copy of the old directories around in a directory named after expiration time.
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
for easier switching on of GL lighting on surfaces:
and to turn it off
set B-factor to bval for molecule imol
reset B-factor for molecule imol to default value
reset B-factor for active residue to default value
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
for running online docs
to reload modules
to make print a function:
to print elements of a list:
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
python command to see if we have pygtk available return True if availabel otherwise False
python command to see if we have pygobject available return True if availabel otherwise False
function to kill a process, given the process pid return True if managed to kill the process otherwise false
some example function for the toolbutton
helper function to test for a number returns True if number, otherwise False
function to merge multiple solvent chains
helper to comvert functions to strings
simplyfy check for windows
clean up pdb file (imol) a wrapper for fix_nomenclature errors, sort chains, residues, merge solvent chains, renumber waters, etc.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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?!?
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.
based on coot_listener_idle_func_proc
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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
/a/b/c -> c
BL says: for loggraph we use a function
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.
Return True if the list of strings params_list contains a string beginning with "WEIGHT". If not return False
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.
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]]
returns the major refmac version, i.e. [5, 3] (for 5.3) or False if no refmac found
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
an americanism
an americanism
an americanism
an americanism
an americanism
an americanism
an americanism
an americanism
an americanism
an americanism
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Read in cns coeff-data (given filenames) and a pdb molecule filename to make maps.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
check the directory and get url url_string.
get url_string for data type (string actually) 'pdb' or 'sfs'
Get the pdb and sfs. id is the accession code
Return a molecule number on success or not a number (False) or -1 on error.
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] | [ ? ] |
| [Top] | [Contents] | [Index] | [ ? ] |
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.