Hi Oliver,
On 28/12/13 15:27, Oliver Clarke wrote:
Hi all,
Just wondering what the function morph_fit_chain does exactly?
Somewhat non-trivial to answer, so I won't do it here.
And what does the radius parameter mean in this context? I could not find
documentation nor posts on the bb, so I apologize if this has been discussed
previously.
It has not.
I am guessing it does some sort of local deformation of the selected chain to
match the density,
Yes.
but is the radius kind of like a sliding window - does it step along the chain
and morph everything within a sphere of radius x?
Yes, that's more or less it, except that the RTop applied to the central
residue is the weighted tail-chopped average of the RTops of residues
with that sphere.
Also, I am a beginner when it comes to python scripting - I have tried to write
a very basic script (below) to first rigid body fit and then morph each chain
of molecule 0.
I see.
It works the first time in every session, but if I try to call it subsequently
it throws an error: ‘str’ object is not callable. This seems to be related to
the chain_ids(imol) function, but I’m puzzled as to why chain_ids(0) works when
I open the molecule initially, but not subsequently - this is probably a very
basic error due to my lack of understanding of python scripting, but if someone
more knowledgeable could shed some light on it I would be most grateful.
import fitting
for chain_id in chain_ids(0):
rigid_body_refine_by_atom_selection(0, "//%s//"%(chain_id))
accept_regularizement()
morph_fit_chain(0, "%s"%(chain_id), 11)
set_refinement_immediate_replacement(1)
for ch_id in chain_ids(0):
rigid_body_refine_by_atom_selection(0, "//%s"%(ch_id))
accept_regularizement()
morph_fit_chain(0, ch_id, 11)
I don't understand what is going wrong in your script (I don't
understand python deeply) but it has something to do with scope.
chain_id is a coot-built-in function and in your for-loop you are
changing that to a string (str) - which can't be called - which is why
you get the error when the chain_ids() function tries to do so. It works
the first time because that uses the coot version of chain_id, because
chain_id has not yet been rebound when chain_ids() is called.
In my experience 5 or more rounds are needed (more if the radius is large).
It is not clear to me if, on the whole, the rigid body refinement step
is a good idea.
Paul.
(if (defined? 'coot-main-menubar)
(let ((menu (coot-menubar-menu "Morph")))
(add-simple-coot-menu-menuitem
menu "Morph Fit This Molecule"
(lambda ()
(using-active-atom
(morph-fit-all aa-imol 10))))
(add-simple-coot-menu-menuitem
menu "Morph Fit This Chain 10"
(lambda ()
(using-active-atom
(morph-fit-chain aa-imol aa-chain-id 10))))
(add-simple-coot-menu-menuitem
menu "Morph Fit This Chain 6"
(lambda ()
(using-active-atom
(morph-fit-chain aa-imol aa-chain-id 6))))
(add-simple-coot-menu-menuitem
menu "Jiggle-fit This Molecule"
(lambda ()
(using-active-atom
(fit-molecule-to-map-by-random-jiggle aa-imol 1000 2))))
(add-simple-coot-menu-menuitem
menu "Translate by 214.4"
(lambda ()
(using-active-atom
(translate-molecule-by aa-imol 214.4 214.4 214.4))))
))