Hi Sara,
I have the python version in my ~/.coot.py file:
<---cut--->
def key_binding_func_1():
from types import ListType
active_atom = active_residue()
if (not active_atom):
add_status_bar_text("No active residue")
else:
imol = active_atom[0]
chain_id = active_atom[1]
res_no = active_atom[2]
ins_code = active_atom[3]
atom_name = active_atom[4]
alt_conf = active_atom[5]
centred_residue = active_atom[1:4]
other_residues = residues_near_residue(imol, centred_residue, 5)
all_residues = [centred_residue]
if (type(other_residues) is ListType):
all_residues += other_residues
print "imol: %s residues: %s" %(imol, all_residues)
refine_residues(imol, all_residues)
add_key_binding("Refine residues in a sphere", "R", lambda: key_binding_func_1())
<---cut--->
In principle, if you place your scheme script in your ~/.coot file it will work next time you open coot (without having to load the script).
Having said that, it would be great if sphere refinement would take into account atoms on residues from symmetry-related molecules (perhaps it does already so? I tried a few weeks/months ago...)
HTH,
Miguel
Le 8 janv. 2010 à 17:22, Sara Züger a écrit :
> Good evening everybody,
>
> I wanted to try sphere refinement for the real space refinement of a
> glycosidic bond, however it did not work out... (Coot 0.6-pre-1/Durham
> (revision 2264))
> That's what I did:
>
> I copied this script into a text file:
>
> (add-key-binding "Refine residues in a sphere" "R"
> (lambda ()
> (let ((active-atom (active-residue)))
> (if (list? active-atom)
> (let* ((centred-residue (list-head (cdr active-atom) 3))
> (imol (car active-atom))
> (other-residues (residues-near-residue
> imol centred-residue 3.5))
> (all-residues (if (list? other-residues)
> (cons centred-residue other-residues)
> (list centred-residue))))
> (refine-residues imol all-residues))))))
>
> and then loaded into coot by using "run script". Then I centered on an atom
> of my glycan and pressed shift-r, or opened the key bindings under
> extensions/settings and used the button for my new key binding.
> Nothing happened, but I got this error message in the terminal, where I
> started coot:
>
> (graphics-general-key-press-hook 82)
> 82 not found in key_bindings
> (graphics-general-key-press-hook 114)
> 114 not found in ((82 "R" "Refine residues in a sphere" #<procedure #f ()>))
> 114 not found in key_bindings
>
> What did I miss or do wrong?
>
> Thanks for you help!
>
> Sara
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
-- Miguel
Architecture et Fonction des Macromolécules Biologiques (UMR6098)
CNRS, Universités d'Aix-Marseille I & II
Case 932, 163 Avenue de Luminy, 13288 Marseille cedex 9, France
Tel: +33(0) 491 82 55 93
Fax: +33(0) 491 26 67 20
e-mail: [log in to unmask]
Web: http://www.pangea.org/mol/spip.php?rubrique2
|