# -----------------------------------------------------------------------------
# Register GRASP surface file reader.
#
def open_cb(path):
    import GraspSurface
    m = GraspSurface.read_grasp_surface(path)
    return [m]


import chimera
fi = chimera.fileInfo
fi.register('GRASP surface',
            open_cb, ['.srf'], ['graspsurf'],
            canDecompress=False,
            category=fi.SURFACE)


# -----------------------------------------------------------------------------
# Register keyboard accelerator to write surfaces as a GRASP format file.
#
def write_grasp():
    from GraspSurface.writegrasp import write_grasp_surface_file
    write_grasp_surface_file()


from Accelerators import add_accelerator
add_accelerator('wg', 'Write GRASP surface file', write_grasp)
import chimera.extension

# -----------------------------------------------------------------------------
#
class Color_Zone_EMO(chimera.extension.EMO):

  def name(self):
    return 'Color Zone'
  def description(self):
    return 'Color piece of surface near selected atoms'
  def categories(self):
    return ['Volume Data', 'Depiction']
  def icon(self):
    return None
  def activate(self):
    self.module('gui').show_color_zone_dialog()
    return None

# -----------------------------------------------------------------------------
#
chimera.extension.manager.registerExtension(Color_Zone_EMO(__file__))

# ---------------------------------------------------------------------------
#
def split_map():
  import ColorZone
  ColorZone.split_volume_by_color_zone()
    
from Accelerators import add_accelerator
add_accelerator('sm', 'Split volume by color zones.', split_map)
# -----------------------------------------------------------------------------
# Register mask command.
#
def mask_cmd(cmdname, args):
    from Mask.maskcommand import mask_command
    mask_command(cmdname, args)


import Midas.midas_text
Midas.midas_text.addCommand('mask', mask_cmd, help=True)

# -----------------------------------------------------------------------------
# Register contour surface mask shortcut.
#
from Accelerators import add_accelerator


def mask_volume():
    import Mask
    Mask.mask_volume_using_selected_surfaces()


add_accelerator('vm', 'Mask volume using selected surfaces', mask_volume)
# -----------------------------------------------------------------------------
# Register shape command.
#
def shape_cmd(cmdname, args):
    from Shape import shape_command
    shape_command(cmdname, args)
from Midas.midas_text import addCommand
addCommand('shape', shape_cmd, help = True)

# -----------------------------------------------------------------------------
# Register surface resize mouse mode keyboard shortcut.
#
def resize_mouse_mode():
    from Shape.resizemode import enable_resize_surface_mouse_mode as e
    e(one_use = True)
from Accelerators import add_accelerator
add_accelerator('sz', 'Resize selected surfaces', resize_mouse_mode)
import chimera.extension

# -----------------------------------------------------------------------------
#
class Atom_Density_EMO(chimera.extension.EMO):

  def name(self):
    return 'Values at Atom Positions'
  def description(self):
    return 'Show volume data values at atom positions.'
  def categories(self):
    return ['Volume Data']
  def icon(self):
    return None
  def activate(self):
    self.module('gui').show_atom_density_dialog()
    return None

# -----------------------------------------------------------------------------
#
chimera.extension.manager.registerExtension(Atom_Density_EMO(__file__))

# -----------------------------------------------------------------------------
#
def oa():
  import AtomDensity
  AtomDensity.select_atoms_outside_map()

from Accelerators import add_accelerator
add_accelerator('oa', 'Reduce selected atoms to those outside map contour', oa)
  def fillInUI(self, parent):

    self.default_radius = 1
    self.default_color = (1,0.6,0.8,.5)      # Pink eraser
    
    t = parent.winfo_toplevel()
    self.toplevel_widget = t
    t.withdraw()

    parent.columnconfigure(0, weight = 1)
    row = 0

    import Tkinter
    from CGLtk import Hybrid

    sh = Hybrid.Checkbutton(parent, 'Show volume-erasing sphere ', True)
    sh.button.grid(row = row, column = 0, sticky = 'w')
    row = row + 1
    self.show_sphere_var = sh.variable
    sh.callback(self.show_sphere_cb)

    crf = Tkinter.Frame(parent)
    crf.grid(row = row, column = 0, sticky = 'ew')
    crf.columnconfigure(2, weight = 1)
    row = row + 1

    cl = Tkinter.Label(crf, text = 'Color')
    cl.grid(row = 0, column = 0, sticky = 'w')
    
    from CGLtk.color import ColorWell
    sc = ColorWell.ColorWell(crf, color = self.default_color,
                             callback = self.change_sphere_color_cb)
    sc.grid(row = 0, column = 1, sticky = 'w')
    self.sphere_color = sc

    rs = Hybrid.Scale(crf, ' Radius ', 0, 30, .1, 2)
    rs.frame.grid(row = 0, column = 2, sticky = 'ew')
    row = row + 1
    rs.callback(self.change_radius_cb)
    rs.entry.bind('<KeyPress-Return>', self.change_radius_cb)
    self.sphere_radius_scale = rs
    
    mmf = Tkinter.Frame(parent)
    mmf.grid(row = row, column = 0, sticky = 'w')
    row = row + 1

    mb = Hybrid.Option_Menu(mmf, 'Use mouse ',
                            'button 1', 'button 2', 'button 3',
                            'ctrl button 1', 'ctrl button 2', 'ctrl button 3')
    mb.variable.set('button 2')
    mb.frame.grid(row = 0, column = 0, sticky = 'w')
    mb.add_callback(self.bind_mouse_button_cb)
    self.mouse_button = mb

    mbl = Tkinter.Label(mmf, text = ' to move sphere')
    mbl.grid(row = 0, column = 1, sticky = 'w')

    ka = Tkinter.Label(parent, text = 'Erase using keyboard accelerator "es".')
    ka.grid(row = row, column = 0, sticky = 'w')
    row = row + 1

    from Accelerators import add_accelerator
    add_accelerator('es', 'Erase volume data inside sphere', self.Erase)
    add_accelerator('eo', 'Erase volume data outside sphere',
                    self.erase_outside_sphere)
#
class Unit_Cell_EMO(EMO):
    def name(self):
        return 'Unit Cell'

    def description(self):
        return 'Make molecule copies to for crystal unit cell'

    def categories(self):
        return ['Higher-Order Structure']

    def icon(self):
        return None

    def activate(self):
        self.module().show_unit_cell_dialog()


manager.registerExtension(Unit_Cell_EMO(__file__))


# -----------------------------------------------------------------------------
#
def show_unit_cell_dialog():
    import UnitCell
    UnitCell.show_unit_cell_dialog()


from Accelerators import add_accelerator
add_accelerator('uc', 'Show unit cell dialog', show_unit_cell_dialog)
Beispiel #8
0
from SpaceNavigator import sn

from Accelerators import add_accelerator
add_accelerator('nd', 'Space navigator only translate/rotate',
                sn.toggle_dominant_mode)
add_accelerator('nz', 'Toggle space navigator zoom mode', sn.toggle_zoom_mode)
add_accelerator('na', 'Space navigator moves inactive models',
                sn.toggle_all_models)
add_accelerator('nf', 'Toggle space navigator fly through mode',
                sn.toggle_fly_mode)
    return None
  def activate(self):
    self.module('gui').show_crystal_contacts_dialog()
    return None

# -----------------------------------------------------------------------------
#
chimera.extension.manager.registerExtension(Crystal_Contacts_EMO(__file__))

# -----------------------------------------------------------------------------
#
def show_contacts(distance = 1.0):
    import chimera
    for m in chimera.openModels.list(modelTypes = [chimera.Molecule]):
        from CrystalContacts import show_crystal_contacts
        show_crystal_contacts(m, distance)

from Accelerators import add_accelerator
add_accelerator('xx', 'Show crystal contacts', show_contacts)

# -----------------------------------------------------------------------------
#
def crystal_contacts_command(cmdname, args):
  from CrystalContacts.command import crystal_contacts
  crystal_contacts(cmdname, args)

# -----------------------------------------------------------------------------
#
from Midas.midas_text import addCommand
addCommand('crystalcontacts', crystal_contacts_command, help = True)
Beispiel #10
0
# -----------------------------------------------------------------------------
#
chimera.extension.manager.registerExtension(Volume_Eraser_EMO(__file__))


# -----------------------------------------------------------------------------
#
def erase_box_cb():
    import VolumeEraser
    VolumeEraser.zero_volume_inside_selection_box()


def zero_boundary_cb(step=1):
    import VolumeEraser
    VolumeEraser.zero_volume_boundary(step)


# -----------------------------------------------------------------------------
#
from Accelerators import add_accelerator

add_accelerator('eb', 'Erase volume data inside subregion selection box',
                erase_box_cb)
add_accelerator('zb', 'Zero volume data boundary', zero_boundary_cb)
add_accelerator('zB2',
                'Zero volume data boundary for step size 2',
                lambda zb=zero_boundary_cb: zb(2))
add_accelerator('zB4',
                'Zero volume data boundary for step size 4',
                lambda zb=zero_boundary_cb: zb(4))
# -----------------------------------------------------------------------------
#
chimera.extension.manager.registerExtension(Fit_Map_EMO(__file__))

# -----------------------------------------------------------------------------
#
def fit_map_cb():
    import FitMap
    FitMap.move_selected_atoms_to_maximum()
def fit_map_rotation_only_cb():
    import FitMap
    FitMap.move_selected_atoms_to_maximum(optimize_translation = False)
def fit_map_shift_only_cb():
    import FitMap
    FitMap.move_selected_atoms_to_maximum(optimize_rotation = False)
def move_atoms_to_maxima():
    import FitMap
    FitMap.move_atoms_to_maxima()
	
# -----------------------------------------------------------------------------
#
from Accelerators import add_accelerator
add_accelerator('ft', 'Move model to maximize density at selected atoms',
                fit_map_cb)
add_accelerator('fr', 'Rotate model to maximize density at selected atoms',
                fit_map_rotation_only_cb)
add_accelerator('fs', 'Shift model to maximize density at selected atoms',
                fit_map_shift_only_cb)
add_accelerator('mX', 'Move selected atoms to local maxima',
                move_atoms_to_maxima)
# -----------------------------------------------------------------------------
#
def align_backbones():
    'Superimpose molecules by pairing selected atoms from identical residues'
    import MatchDomains
    MatchDomains.align_backbones_using_selected_atoms()


# -----------------------------------------------------------------------------
#
def illustrate_alignment():
    'Draw slabs to illustrate a the relative orientations of two domains'
    import MatchDomains
    MatchDomains.illustrate_backbone_alignment()


# -----------------------------------------------------------------------------
#
from Accelerators import add_accelerator
add_accelerator('ab', 'Align backbones using selected atoms', align_backbones)
add_accelerator('ai', 'Illustrate backbone alignment based on selected atoms',
                illustrate_alignment)
Beispiel #13
0
    def icon(self):
        return None
#		return self.path('gumball.png')

    def activate(self):
        self.module('gui').show_surface_volume_dialog()
        return None


# -----------------------------------------------------------------------------
#
chimera.extension.manager.registerExtension(Surface_Volume_EMO(__file__))


# -----------------------------------------------------------------------------
#
def measure_area():
    from MeasureVolume import report_selected_areas
    report_selected_areas()


def measure_volume():
    from MeasureVolume import report_selected_volumes
    report_selected_volumes()


from Accelerators import add_accelerator
add_accelerator('ma', 'Measure area of selected surfaces', measure_area)
add_accelerator('mv', 'Measure volume of selected surfaces', measure_volume)
#
def mark_cofr():
    from VolumePath import place_marker, show_volume_path_dialog
    from chimera import openModels
    place_marker(openModels.cofr.data())
    show_volume_path_dialog()


# -----------------------------------------------------------------------------
#
def place_marker_at_mouse():
    import VolumePath
    VolumePath.place_marker_at_mouse()


# -----------------------------------------------------------------------------
#
def place_markers_on_atoms():
    import VolumePath
    VolumePath.place_markers_on_atoms()


# -----------------------------------------------------------------------------
#
from Accelerators import add_accelerator
add_accelerator('mz', 'Place marker at position (0,0,0)', mark_zero)
add_accelerator('mc', 'Place marker at center of rotation', mark_cofr)
add_accelerator('mk', 'Place marker under mouse', place_marker_at_mouse)
add_accelerator('mS', 'Place markers on selected atoms',
                place_markers_on_atoms)
def select_contacts_5():
  select_contacts(5)

# -----------------------------------------------------------------------------
#
def select_sequence_copies():
  from MultiScale import multiscale_model_dialog
  d = multiscale_model_dialog()
  if d:
    d.select_sequence_copies()

# -----------------------------------------------------------------------------
#
def color_surfaces_to_match_atoms():
  import MultiScale
  MultiScale.color_surfaces_to_match_atoms()
  
# -----------------------------------------------------------------------------
#
from Accelerators import add_accelerator
add_accelerator('bu', 'Show molecule biological unit using multiscale tool',
		show_biounit)
add_accelerator('c3', 'Find 3A contacts between selected and unselected atoms',
		select_contacts_3)
add_accelerator('c5', 'Find 5A contacts between selected and unselected atoms',
		select_contacts_5)
add_accelerator('xc', 'Extend multiscale selection to sequence copies',
		select_sequence_copies)
add_accelerator('c=', 'Color multiscale surfaces to match a chain atom',
		color_surfaces_to_match_atoms)
        return 'Values at Atom Positions'

    def description(self):
        return 'Show volume data values at atom positions.'

    def categories(self):
        return ['Volume Data']

    def icon(self):
        return None

    def activate(self):
        self.module('gui').show_atom_density_dialog()
        return None


# -----------------------------------------------------------------------------
#
chimera.extension.manager.registerExtension(Atom_Density_EMO(__file__))


# -----------------------------------------------------------------------------
#
def oa():
    import AtomDensity
    AtomDensity.select_atoms_outside_map()


from Accelerators import add_accelerator
add_accelerator('oa', 'Reduce selected atoms to those outside map contour', oa)
def symmetry_copies(cmdname, args):
    import SymmetryCopies
    SymmetryCopies.symmetry_copies_command(cmdname, args)

def undo_symmetry_copies(cmdname, args):
    import SymmetryCopies
    SymmetryCopies.undo_symmetry_copies_command(cmdname, args)
    
import Midas.midas_text
Midas.midas_text.addCommand('sym', symmetry_copies, undo_symmetry_copies,
                            help = True)

def icos_volume_sym():
    import SymmetryCopies
    SymmetryCopies.set_volume_icosahedral_symmetry()

from Accelerators import add_accelerator
add_accelerator('ic', 'Assigned icosahedral symmetry to active volume',
                icos_volume_sym)
# -----------------------------------------------------------------------------
# Register shape command.
#
def shape_cmd(cmdname, args):
    from Shape import shape_command
    shape_command(cmdname, args)


from Midas.midas_text import addCommand

addCommand('shape', shape_cmd, help=True)


# -----------------------------------------------------------------------------
# Register surface resize mouse mode keyboard shortcut.
#
def resize_mouse_mode():
    from Shape.resizemode import enable_resize_surface_mouse_mode as e
    e(one_use=True)


from Accelerators import add_accelerator

add_accelerator('sz', 'Resize selected surfaces', resize_mouse_mode)
def surfdist():
  import SurfaceDistance
  SurfaceDistance.selection_surface_distance()

from Accelerators import add_accelerator
add_accelerator('sd', 'Report distance between selected atoms and displayed surfaces', surfdist)
  def activate(self):
    self.module('gui').show_volume_filter_dialog()
    return None

manager.registerExtension(Volume_Filter_EMO(__file__))

# -----------------------------------------------------------------------------
# Register vop command.
#
def vop_cmd(cmdname, args):
    from VolumeFilter.vopcommand import vop_command
    vop_command(cmdname, args)
from Midas.midas_text import addCommand
addCommand('vop', vop_cmd, help = True)

# ---------------------------------------------------------------------------
# Register keyboard shortcuts for filtering.
#
def fourier():
  from VolumeFilter import fourier_transform
  fourier_transform()
def laplace():
  from VolumeFilter import laplacian
  laplacian()

from Accelerators import add_accelerator
add_accelerator('FT', 'Fourier transform active volume', fourier)
add_accelerator('LT', 'Calculate Laplacian active volume', laplace)
from median import make_test_volume
add_accelerator('tv', 'Make test volume', make_test_volume)
    def description(self):
        return 'Calculates mean, standard deviation, and root mean square for volume data'

    def categories(self):
        return ['Volume Data']

    def icon(self):
        return None

    def activate(self):
        self.module().show_volume_statistics()
        return None


# -----------------------------------------------------------------------------
#
manager.registerExtension(Volume_Statistics_EMO(__file__))


# -----------------------------------------------------------------------------
#
def show_stats():
    from VolumeStatistics import show_volume_statistics
    show_volume_statistics(show_reply_log=False)


from Accelerators import add_accelerator
add_accelerator('md', 'Print mean and standard deviation of volume data',
                show_stats)
# -----------------------------------------------------------------------------
# Register GRASP surface file reader.
#
def open_cb(path):
    import GraspSurface
    m = GraspSurface.read_grasp_surface(path)
    return [m]

import chimera
fi = chimera.fileInfo
fi.register('GRASP surface', open_cb, ['.srf'], ['graspsurf'],
            canDecompress = False, category = fi.SURFACE)

# -----------------------------------------------------------------------------
# Register keyboard accelerator to write surfaces as a GRASP format file.
#
def write_grasp():
    from GraspSurface.writegrasp import write_grasp_surface_file
    write_grasp_surface_file()

from Accelerators import add_accelerator
add_accelerator('wg', 'Write GRASP surface file', write_grasp)
	def name(self):
		return 'Measure Volume and Area'
	def description(self):
		return 'Compute volume enclosed by a surface and surface area.'
	def categories(self):
		return ['Volume Data', 'Surface/Binding Analysis']
	def icon(self):
		return None
#		return self.path('gumball.png')
	def activate(self):
		self.module('gui').show_surface_volume_dialog()
		return None

# -----------------------------------------------------------------------------
#
chimera.extension.manager.registerExtension(Surface_Volume_EMO(__file__))


# -----------------------------------------------------------------------------
#
def measure_area():
	from MeasureVolume import report_selected_areas
	report_selected_areas()
def measure_volume():
	from MeasureVolume import report_selected_volumes
	report_selected_volumes()
from Accelerators import add_accelerator
add_accelerator('ma', 'Measure area of selected surfaces', measure_area)
add_accelerator('mv', 'Measure volume of selected surfaces', measure_volume)
def surfdist():
    import SurfaceDistance
    SurfaceDistance.selection_surface_distance()


from Accelerators import add_accelerator
add_accelerator(
    'sd', 'Report distance between selected atoms and displayed surfaces',
    surfdist)
Beispiel #25
0
# Delay importing module until function is actually called.
#
def function(name):
  def f(*args, **kw):
    from VolumeViewer import shortcuts
    getattr(shortcuts, name)(*args, **kw)
  return f

# -----------------------------------------------------------------------------
# Register keyboard shortcuts.
#
ks = (('bv', 'Make volume bounding selected atoms from periodic volume',
       'bounding_map'),
      ('cv', 'Clip volume', 'clip_volume'),
      ('ez', 'Copy map with erased zone', 'erase_zone'),
      ('fv', 'Change volume subregion to full data', 'full_volume'),
      ('Im', 'Invert map shown in volume viewer', 'invert_map'),
      ('ob', 'Toggle volume outline box', 'outline_box'),
      ('u8', 'Make MRC signed 8-bit volume unsigned',
       'mrc_signed8_to_unsigned8'),
      ('vh', 'Hide volume', 'hide_volume'),
      ('vR', 'Remove volume', 'remove_volume'),
      ('vs', 'Show volume', 'show_volume'),
      ('vv', 'Show volume viewer dialog', 'show_volume_dialog'),
      ('wv', 'Make writable copy of volume data', 'writable_volume'),
      ('zv', 'Copy map including only zone', 'zone_volume'),
      )
from Accelerators import add_accelerator
for keys, descrip, fname in ks:
  add_accelerator(keys, descrip, function(fname))
# -----------------------------------------------------------------------------
# Register mask command.
#
def mask_cmd(cmdname, args):
    from Mask.maskcommand import mask_command
    mask_command(cmdname, args)

import Midas.midas_text
Midas.midas_text.addCommand('mask', mask_cmd, help = True)

# -----------------------------------------------------------------------------
# Register contour surface mask shortcut.
#
from Accelerators import add_accelerator
def mask_volume():
    import Mask
    Mask.mask_volume_using_selected_surfaces()
add_accelerator('vm', 'Mask volume using selected surfaces', mask_volume)
Beispiel #27
0
def register_accelerators():

    accelerators = [
        ('a0', 'Activate model 0 (toggle)', activate_model_0),
        ('a1', 'Activate model 1 (toggle)', activate_model_1),
        ('a2', 'Activate model 2 (toggle)', activate_model_2),
        ('a3', 'Activate model 3 (toggle)', activate_model_3),
        ('aa', 'Activate all models', activate_all),
        ('ad', 'Accelerator dialog', show_accelerator_dialog),
        ('af', 'Accelerators off', turn_off_accelerators),
        ('ao', 'Activate only selected models', activate_only),
        ('ar', 'Activate reverse', activate_reverse),
        ('at', 'Activate toggle', activate_toggle_and_remember),
        ('bb', 'Backbone only', backbone_only),
        ('bk', 'Set background to black', set_black_background),
        ('bs', 'Ball & stick representation', ball_and_stick_representation),
        ('c2', 'Color secondary structure', color_secondary_structure),
        ('Ca', 'Close all models', close_all_models),
        ('ca', 'Adjust clip planes with mouse', clip_adjust),
        ('cc', 'Clip selected models', clip_selected_models),
        ('ce', 'Color by element', color_by_element),
        ('cl', 'Show command line', show_command_line),
        ('cm', 'Show surface color dialog', show_surface_color_dialog),
        ('cp', 'Show surface capper dialog', show_surface_capper_dialog),
        ('cr', 'Set center of rotation', set_center_of_rotation),
        ('cs', 'Clear selection', clear_selection),
        ('Cs', 'Close session', close_session),
        ('ct', 'Show chain trace only', show_chain_trace_only),
        ('da', 'Display atoms', display_atoms),
        ('Da', 'Delete atoms and bonds', delete_atoms),
        ('dc', 'Toggle depth cueing', toggle_depth_cueing),
        ('dp', 'Display path tracer markers', show_all_markers),
        ('ds', 'Display surface', show_surface),
        ('ff', 'Fetch file from web', fetch_file),
        ('fo', 'Focus', focus),
        ('gb', 'Set gray background', set_gray_background),
        ('gl', 'Toggle glossy lighting', glossy_lighting),
        ('ha', 'Hide atoms', hide_atoms),
        ('hc', 'Hide command line', hide_command_line),
        ('hp', 'Hide path tracer markers', hide_all_markers),
        ('hr', 'Hide ribbon', hide_ribbon),
        ('hs', 'Hide surface', hide_surface),
        ('ir', 'Independent center of rotation', independent_cofr),
        ('is', 'Invert selection (selected models)', invert_selection),
        ('iS', 'Invert selection (all models)', invert_selection_all_models),
        ('kl', 'Show per-model clipping dialog',
         show_per_model_clipping_dialog),
        ('lo', 'Show names of last opened files', names_of_last_opened),
        ('ls', 'Open last session file', open_last_session),
        ('mm', 'Mouse modes', show_mouse_modes),
        ('mp', 'Show model panel dialog', show_model_panel),
        ('mw', 'Molecular weight', molecular_weight),
        ('o2', 'Open last 2 files', open_last_2_files),
        ('o3', 'Open last 3 files', open_last_3_files),
        ('oc', 'Type one command', one_command),
        ('oj', 'Open 3nd to last file', open_3rd_to_last_file),
        ('ok', 'Open 2nd to last file', open_2nd_to_last_file),
        ('ol', 'Open last file', open_last_file),
        ('Op', 'Original model positions', original_positions),
        ('op', 'Open file', open_file),
        ('or', 'Orthographic projection', toggle_ortho_projection),
        ('os', 'Open session', open_session),
        ('ov', 'Open volume', open_file),
        ('Qt', 'Quit Chimera', quit),
        ('pf', 'Preferences dialog', show_preferences_dialog),
        ('ps', 'Python shell', show_python_shell),
        ('ra', 'Render by attribute', show_render_by_attribute_dialog),
        ('rc', 'Rainbow chain', rainbow_chain),
        ('re', 'Edged ribbon', edged_ribbon),
        ('rf', 'Flat ribbon', flat_ribbon),
        ('rh', 'Hide ribbon', hide_ribbon),
        ('rl', 'Reply log', show_reply_log),
        ('rr', 'Round ribbon', round_ribbon),
        ('sa', 'Select all', select_all),
        ('sc', 'Select connected atoms/bonds', select_connected),
        ('se', 'Toggle silhouette edges', toggle_silhouette_edges),
        ('sf', 'Show surface', show_surface),
        ('sF', 'Surface selected atoms', surface_selected_atoms),
        ('si', 'Save image...', save_image),
        ('sl', 'Show/Hide status line', toggle_status_line),
        ('so', 'Standard orientation', standard_orientation),
        ('sp', 'Sphere representation', sphere_representation),
        ('ss', 'Save session as...', save_session_as),
        ('Ss', 'Save session', save_session),
        ('st', 'Stick representation', stick_representation),
        ('sv', 'Show side view dialog', show_side_view),
        ('sx', 'Show side chains only', show_side_chains_only),
        ('t0', 'Transparent surface 0%', transparent_surface_0),
        ('t5', 'Transparent surface 50%', transparent_surface_50),
        ('ug', "User's guide", show_users_guide),
        ('va', 'View all models', view_all),
        ('vp', 'Show volume path tracer dialog',
         show_volume_path_tracer_dialog),
        ('wb', 'Set background to white', set_white_background),
        ('wr', 'Wire representation', wire_representation),
        ('xs', 'Export scene', export_scene),
        ('x9', 'Turn 90 degrees about x axis', turn_x_90),
        ('y9', 'Turn 90 degrees about y axis', turn_y_90),
        ('z9', 'Turn 90 degrees about z axis', turn_z_90),
        ('zn', 'Select zone using zone dialog settings', select_zone),
        ('zd', 'Show zone dialog', show_zone_dialog),
    ]

    from Accelerators import add_accelerator
    for (keys, descrip, func) in accelerators:
        add_accelerator(keys, descrip, func)
from chimera.extension import EMO, manager

# -----------------------------------------------------------------------------
#
class Unit_Cell_EMO(EMO):

  def name(self):
    return 'Unit Cell'
  def description(self):
    return 'Make molecule copies to for crystal unit cell'
  def categories(self):
    return ['Higher-Order Structure']
  def icon(self):
    return None
  def activate(self):
    self.module().show_unit_cell_dialog()

manager.registerExtension(Unit_Cell_EMO(__file__))

# -----------------------------------------------------------------------------
#
def show_unit_cell_dialog():
  import UnitCell
  UnitCell.show_unit_cell_dialog()
from Accelerators import add_accelerator
add_accelerator('uc', 'Show unit cell dialog', show_unit_cell_dialog)
Beispiel #29
0
# -----------------------------------------------------------------------------
#
def print_path_length():
    import PathLength
    PathLength.print_path_length()
def print_model_path_lengths():
    import PathLength
    PathLength.print_model_path_lengths()

# -----------------------------------------------------------------------------
#
from Accelerators import add_accelerator
add_accelerator('pl', 'Show total length of selected bonds', print_path_length)
add_accelerator('pL', 'Show total length of selected bonds for each model',
                print_model_path_lengths)
Beispiel #30
0
#
chimera.extension.manager.registerExtension(Crystal_Contacts_EMO(__file__))


# -----------------------------------------------------------------------------
#
def show_contacts(distance=1.0):
    import chimera
    for m in chimera.openModels.list(modelTypes=[chimera.Molecule]):
        from CrystalContacts import show_crystal_contacts
        show_crystal_contacts(m, distance)


from Accelerators import add_accelerator

add_accelerator('xx', 'Show crystal contacts', show_contacts)


# -----------------------------------------------------------------------------
#
def crystal_contacts_command(cmdname, args):
    from CrystalContacts.command import crystal_contacts
    crystal_contacts(cmdname, args)


# -----------------------------------------------------------------------------
#
from Midas.midas_text import addCommand

addCommand('crystalcontacts', crystal_contacts_command, help=True)
    import FitMap
    FitMap.move_selected_atoms_to_maximum()


def fit_map_rotation_only_cb():
    import FitMap
    FitMap.move_selected_atoms_to_maximum(optimize_translation=False)


def fit_map_shift_only_cb():
    import FitMap
    FitMap.move_selected_atoms_to_maximum(optimize_rotation=False)


def move_atoms_to_maxima():
    import FitMap
    FitMap.move_atoms_to_maxima()


# -----------------------------------------------------------------------------
#
from Accelerators import add_accelerator
add_accelerator('ft', 'Move model to maximize density at selected atoms',
                fit_map_cb)
add_accelerator('fr', 'Rotate model to maximize density at selected atoms',
                fit_map_rotation_only_cb)
add_accelerator('fs', 'Shift model to maximize density at selected atoms',
                fit_map_shift_only_cb)
add_accelerator('mX', 'Move selected atoms to local maxima',
                move_atoms_to_maxima)
from SpaceNavigator import sn

from Accelerators import add_accelerator
add_accelerator('nd', 'Space navigator only translate/rotate', 
                sn.toggle_dominant_mode)
add_accelerator('nz', 'Toggle space navigator zoom mode', 
                sn.toggle_zoom_mode)
add_accelerator('na', 'Space navigator moves inactive models',
                sn.toggle_all_models)
add_accelerator('nf', 'Toggle space navigator fly through mode',
                sn.toggle_fly_mode)

      place_marker(m0)
  show_volume_path_dialog()

# -----------------------------------------------------------------------------
#
def mark_cofr():
  from VolumePath import place_marker, show_volume_path_dialog
  from chimera import openModels
  place_marker(openModels.cofr.data())
  show_volume_path_dialog()

# -----------------------------------------------------------------------------
#
def place_marker_at_mouse():
  import VolumePath
  VolumePath.place_marker_at_mouse()

# -----------------------------------------------------------------------------
#
def place_markers_on_atoms():
  import VolumePath
  VolumePath.place_markers_on_atoms()
  
# -----------------------------------------------------------------------------
#
from Accelerators import add_accelerator
add_accelerator('mz', 'Place marker at position (0,0,0)', mark_zero)
add_accelerator('mc', 'Place marker at center of rotation', mark_cofr)
add_accelerator('mk', 'Place marker under mouse', place_marker_at_mouse)
add_accelerator('mS', 'Place markers on selected atoms', place_markers_on_atoms)
Beispiel #34
0
        return 'Color Zone'

    def description(self):
        return 'Color piece of surface near selected atoms'

    def categories(self):
        return ['Volume Data', 'Depiction']

    def icon(self):
        return None

    def activate(self):
        self.module('gui').show_color_zone_dialog()
        return None


# -----------------------------------------------------------------------------
#
chimera.extension.manager.registerExtension(Color_Zone_EMO(__file__))


# ---------------------------------------------------------------------------
#
def split_map():
    import ColorZone
    ColorZone.split_volume_by_color_zone()


from Accelerators import add_accelerator
add_accelerator('sm', 'Split volume by color zones.', split_map)
# -----------------------------------------------------------------------------
#
def align_backbones():
  'Superimpose molecules by pairing selected atoms from identical residues'
  import MatchDomains
  MatchDomains.align_backbones_using_selected_atoms()

# -----------------------------------------------------------------------------
#
def illustrate_alignment():
  'Draw slabs to illustrate a the relative orientations of two domains'
  import MatchDomains
  MatchDomains.illustrate_backbone_alignment()
  
# -----------------------------------------------------------------------------
#
from Accelerators import add_accelerator
add_accelerator('ab', 'Align backbones using selected atoms', align_backbones)
add_accelerator('ai', 'Illustrate backbone alignment based on selected atoms',
                illustrate_alignment)