
Hello, I was just searching the archieves and I understand now that my last question was alittle dumb (i.e. the x,y,z rotation angles are not helpful). In this case does the "Rotation angle" and the " Axis" define a single rotation that transforms the "Fit map" to the "with in" map. Can I draw the axis using a .bild file (i.e .arrow with start and end coords given by axis and axis point). if I want to compare several maps to one reference, is it possible to define a single axis for them all? such that i can compare them all just by the magnitude of the rotation? does this make sense? thanks in advance sean

Hi Sean, If you fit multiple maps to a single map they will probably not all have the same rotation axis. Attached is a Python script to make arrows showing the rotation axes of models relative to a reference model as BILD arrows. First you open and fit your models, then open this script (with File/Open) to create the axis arrows. Tom # ---------------------------------------------------------------------------- # Chimera script to show rotation of models relative to the model with lowest # id number using graphical arrows. The length of the arrows corresponds to # the magnitude of the rotation angle, with maximum length (180 degrees) # equaling the size of the box containing the model with lowest id. # def make_arrow(model, ref_model): if hasattr(model, 'rotation_axis'): return # Don't display the rotation of a rotation axis BILD model. # Determine maximum arrow length has_box, rbox = ref_model.bbox() # Bounding box of ref_model if not has_box: return max_arrow_length = max((rbox.urb - rbox.llf).data()) # Size of ref_model arrow_radius = .02 * max_arrow_length # Determine arrow base position has_box, box = model.bbox() if not has_box: return arrow_base = box.center() # Center of model # Find rotation axis and angle xf = ref_model.openState.xform.inverse() xf.premultiply(model.openState.xform) axis, angle = xf.getRotation() # Rotation axis and angle if abs(angle) < 0.01: return # Don't show zero rotation # Determine arrow color from _surface import Surface_Model if hasattr(model, 'color'): color = model.color.rgba() elif isinstance(model, Surface_Model): color = model.surface_groups()[0].color() else: color = (0,0,1) # blue # Create BILD commands arrow_tip = arrow_base + (angle/180.0) * max_arrow_length * axis bild = ('.color %f %f %f\n' % color[:3] + '.arrow %f %f %f' % arrow_base.data() + ' %f %f %f' % arrow_tip.data() + ' %f' % arrow_radius) # Must use a temporary file to open a BILD model. from tempfile import mkstemp f, path = mkstemp('.bld', 'rot') from os import write, close, remove write(f, bild) close(f) m = openModels.open(path, type = 'Bild', sameAs = model)[0] m.name = '%s rotation axis' % model.name m.rotation_axis = True remove(path) # Select arrow to make it more visible. from chimera.selection import addCurrent addCurrent(m) return m # ---------------------------------------------------------------------------- # from chimera import openModels mlist = openModels.list() mlist = [m for m in mlist if m.bbox()[0]] # Use only models with bounding box for m in mlist[1:]: make_arrow(m, mlist[0])
participants (2)
-
src9697
-
Tom Goddard