def view(self, scale=1., color=None): """Shows a graphical representation of the field using a VRML viewer. All values are multiplied by |scale|. |color| permits the choice of a color for the graphics objects.""" from Scientific.Visualization import VRML objects = self.graphicsObjects(scale=scale, color=color, graphics_module=VRML) VRML.Scene(objects).view()
def writeToFile(self, filename, scale=1., color=None): """Writes a graphical representation of the field to the VRML file named by |filename|, multiplying all values by |scale|. |color| permits the choice of a color for the graphics objects.""" from Scientific.Visualization import VRML objects = self.graphicsObjects(scale=scale, color=color, graphics_module=VRML) VRML.Scene(objects).writeToFile(filename)
chain.applyTransformation(transformation) # Let's calculate the local deformation due to the change in conformation # for each atom. Small values indicate rigid regions and large values # indicate flexible regions. The visualization requires a VRML viewer. # Reference: K. Hinsen, A. Thomas, M.J. Field: Proteins 34, 369 (1999) from MMTK.Deformation import FiniteDeformationFunction from Scientific.Visualization import VRML difference = monomer_configuration - universe.configuration() deformation_function = FiniteDeformationFunction(universe, 0.3, 0.6) deformation = deformation_function(difference) graphics = universe.graphicsObjects(color_values=deformation, graphics_module=VRML) VRML.Scene(graphics).view() # The deformation shows a small rigid region and a much larger # more flexible region. # Action: We show an animation of the two configurations. This requires # an animation-capable external viewer, e.g. VMD. from MMTK.Visualization import viewSequence viewSequence(chain, [universe.configuration(), monomer_configuration]) # Interesting: there's a floppy loop with residues Gln61, Glu62, and Glu63 # at the tip. It seems to do a funny rotation relative to a closeby helix # (His94-Lys101) when switching between the two configurations. Let's # find out what this rotation is!