Exemplo n.º 1
0
def cmdRotamers(cmdName, args):
    from Midas.midas_text import doExtensionFunc
    from Rotamers import useBestRotamers
    doExtensionFunc(useBestRotamers,
                    args,
                    specInfo=[("spec", "targets", "residues"),
                              ("densitySpec", "density", "models")])
def cmdRotamers(cmdName, args):
	from Midas.midas_text import doExtensionFunc
	from Rotamers import useBestRotamers
	doExtensionFunc(useBestRotamers, args, specInfo=[
		("spec", "targets", "residues"),
		("densitySpec", "density", "models")
	])
Exemplo n.º 3
0
def cmd_undo_snfg(cmdName, args):
    def cmd(*args):
        for instance in SNFG._instances:
            instance.disable()
            chimera.viewer.updateCB(chimera.viewer)

    doExtensionFunc(cmd, args)
Exemplo n.º 4
0
def cmdCombine(cmdName, args):
    from Midas.midas_text import doExtensionFunc
    import Combine
    doExtensionFunc(Combine.cmdCombine,
                    args,
                    specInfo=[("spec", "mols", "molecules"),
                              ("refSpec", "refMol", "molecules")])
Exemplo n.º 5
0
def coordset(cmdname, args):

    from Midas.midas_text import doExtensionFunc
    doExtensionFunc(show_coordinates,
                    args,
                    specInfo=[('moleculeSpec', 'molecules', 'models'),
                              ('holdSteadySpec', 'holdSteady', 'atoms')])
Exemplo n.º 6
0
def mcopy_command(cmdname, args):

    from Midas.midas_text import doExtensionFunc
    doExtensionFunc(molecule_copy,
                    args,
                    specInfo=[('atomSpec', 'from_atoms', 'atoms'),
                              ('atomSpec', 'to_atoms', 'atoms')])
Exemplo n.º 7
0
def cmdAddCharge(cmdName, args):
    from AddCharge import cmdAddStdCharge, \
        cmdAddNonstdCharge, cmdAddAllCharge
    from Midas.midas_text import doExtensionFunc, MidasError
    if not args:
        mode = 'a'
    else:
        fields = args.split(None, 1)
        if len(fields) > 1:
            fullMode, args = fields
        else:
            fullMode = fields[0]
            args = ""
        mode = fullMode[0].lower()

    if mode == 's':
        func = cmdAddStdCharge
        specInfo = [("spec", "molecules", "molecules")]
    elif mode == 'n':
        func = cmdAddNonstdCharge
        specInfo = [("resSpec", "residues", "residues")]
    elif mode == 'a':
        func = cmdAddAllCharge
        specInfo = [("spec", "molecules", "molecules")]
    else:
        raise MidasError("Unknown mode for %s: %s" % (cmdName, fullMode))
    doExtensionFunc(func, args, specInfo=specInfo)
def cmdAddCharge(cmdName, args):
	from AddCharge import cmdAddStdCharge, \
					cmdAddNonstdCharge, cmdAddAllCharge
	from Midas.midas_text import doExtensionFunc, MidasError
	if not args:
		mode = 'a'
	else:
		fields = args.split(None, 1)
		if len(fields) > 1:
			fullMode, args = fields
		else:
			fullMode = fields[0]
			args = ""
		mode = fullMode[0].lower()

	if mode == 's':
		func = cmdAddStdCharge
		specInfo = [("spec", "molecules", "molecules")]
	elif mode == 'n':
		func = cmdAddNonstdCharge
		specInfo = [("resSpec", "residues", "residues")]
	elif mode == 'a':
		func = cmdAddAllCharge
		specInfo = [("spec", "molecules", "molecules")]
	else:
		raise MidasError("Unknown mode for %s: %s" % (cmdName,fullMode))
	doExtensionFunc(func, args, specInfo=specInfo)
Exemplo n.º 9
0
def commandLine(cmd, args):
	if args.lower().startswith("co"):
		# Handle "color" command differently
		from chimera import LimitationError
		raise LimitationError("intersurf color not available yet")
	from Midas.midas_text import doExtensionFunc
	doExtensionFunc(cmdSurface, args, specInfo=[("refSpec", "refSel", None),
                                        ("matchSpec", "matchSel", None)])
def crystal_contacts(cmdname, args):

    from Midas.midas_text import doExtensionFunc
    doExtensionFunc(show_contacts,
                    args,
                    specInfo=[
                        ('moleculeSpec', 'molecules', 'models'),
                    ])
def unclip_command(cmdname, args):

    if len(args) == 0:
        from chimera import openModels as om
        unclip_models(om.list())
    else:
        from Midas.midas_text import doExtensionFunc
        doExtensionFunc(unclip_models, args)
Exemplo n.º 12
0
def doLabel2DCmd(cmdName, args):
    from Midas.midas_text import doExtensionFunc
    from Midas import MidasError
    import Ilabel

    try:
        doExtensionFunc(Ilabel.processLabel2DCmd, args)
    except MidasError, what:
        raise
Exemplo n.º 13
0
def doMovieCmd(cmdName, args):
    from Midas.midas_text import doExtensionFunc
    from Midas import MidasError
    import MovieRecorder

    try:
        doExtensionFunc(MovieRecorder.processMovieCmd, args)
    except MidasError, what:
        raise
Exemplo n.º 14
0
def run(cmdName, args):
    from Midas.midas_text import doExtensionFunc
    if cmdName[0] == "b":
        f = blast
    elif cmdName[0] == "p":
        f = psiblast
    else:
        from chimera import UserError
        raise UserError("unknown command: \"%s\"" % cmdName)
    doExtensionFunc(f, args, specInfo=[("spec", "molecules", "molecules")])
Exemplo n.º 15
0
def run(cmdName, args):
	from Midas.midas_text import doExtensionFunc
	if cmdName[0] == "b":
		f = blast
	elif cmdName[0] == "p":
		f = psiblast
	else:
		from chimera import UserError
		raise UserError("unknown command: \"%s\"" % cmdName)
	doExtensionFunc(f, args, specInfo=[("spec", "molecules", "molecules")])
def process(cmdName, args):
	from Midas.midas_text import doExtensionFunc
	try:
		func, kwargs = _cmdTable[cmdName]
	except KeyError:
		# We only get here if the command was registered
		# in ChimeraExtension.py but is not in our command table.
		# Assume that registration is correct and that we
		# just haven't implemented the function yet.
		import chimera
		raise chimera.UserError("%s: unimplemented command" % cmdName)
	doExtensionFunc(func, args, **kwargs)
Exemplo n.º 17
0
def cmd_snfg(cmdName, args):
    def cmd(models=None, method='icon', size=None, **kwargs):
        methods = ('icon', 'full', 'fullred', 'fullshown')
        if method not in methods:
            chimera.statusline.show_message(
                'Method {} not supported. Try with: {}'.format(
                    method, ', '.join(methods)),
                color='red')
        if models or models is None:
            snfg = getattr(SNFG, 'as_' + method)(molecules=models,
                                                 size=size,
                                                 **kwargs)

    doExtensionFunc(cmd, args, specInfo=[("spec", "models", 'molecules')])
Exemplo n.º 18
0
def mainchainCmd(cmdName, args):
    # Import the module's workhorse function.
    # It is imported inside the function definition so that
    # it does not slow down Chimera startup with extra imports
    # in the main scope.
    from ToolbarButtonCommand import mainchain

    # Import and use the Midas.midas_text doExtensionFunc procedure
    # to process typed arguments and call the mainchain() function
    # appropriately.  For a simple function like mainchain(), which
    # takes no arguments, using doExtensionFunc is probably overkill.
    # One could instead use the approach applied in the revMainchainCmd
    # function below and simply test for the presence of any
    # arguments (raising MidasError if any are found) and directly calling
    # the mainchain() function otherwise.  As implemented here, using
    # doExtensionFunc, if the user does provide arguments then
    # doExtensionFunc will raise an error complaining that there
    # were unknown keyword arguments supplied.
    from Midas.midas_text import doExtensionFunc
    doExtensionFunc(mainchain, args)
def mainchainCmd(cmdName, args):
	# Import the module's workhorse function.
	# It is imported inside the function definition so that
	# it does not slow down Chimera startup with extra imports
	# in the main scope.
	from ToolbarButtonCommand import mainchain

	# Import and use the Midas.midas_text doExtensionFunc procedure
	# to process typed arguments and call the mainchain() function
	# appropriately.  For a simple function like mainchain(), which
	# takes no arguments, using doExtensionFunc is probably overkill.
	# One could instead use the approach applied in the revMainchainCmd
	# function below and simply test for the presence of any
	# arguments (raising MidasError if any are found) and directly calling
	# the mainchain() function otherwise.  As implemented here, using
	# doExtensionFunc, if the user does provide arguments then
	# doExtensionFunc will raise an error complaining that there
	# were unknown keyword arguments supplied.
	from Midas.midas_text import doExtensionFunc
	doExtensionFunc(mainchain, args)
Exemplo n.º 20
0
def cmd_cone(cmdName, args):
    from Midas.midas_text import doExtensionFunc
    from Chimera_BILD import cone
    doExtensionFunc(cone, args)
Exemplo n.º 21
0
def cmd_box(cmdName, args):
    from Midas.midas_text import doExtensionFunc
    from Chimera_BILD import box
    doExtensionFunc(box, args)
Exemplo n.º 22
0
def hkcage_command(cmdname, args):

    from Midas.midas_text import doExtensionFunc
    doExtensionFunc(hkcage, args)
Exemplo n.º 23
0
def _cmd_unplip(cmdName, args):
    doExtensionFunc(cmd_unplip, args)
Exemplo n.º 24
0
def cmdHBonds(cmdName, args):
	from Midas.midas_text import doExtensionFunc
	from FindHBond import createHBonds
	doExtensionFunc(createHBonds, args,
				specInfo=[("spec", "models", "molecules")])
Exemplo n.º 25
0
def cmdUnaniso(cmdName, args):
    import Aniso
    from Midas.midas_text import doExtensionFunc
    doExtensionFunc(Aniso.unaniso,
                    args,
                    specInfo=[("spec", "targets", "atoms")])
Exemplo n.º 26
0
def midasCmd(cmdName, typedArgs):
	from Midas.midas_text import doExtensionFunc
	doExtensionFunc(writeSel, typedArgs)
Exemplo n.º 27
0
def topography_command(cmdname, args):

    from Midas.midas_text import doExtensionFunc
    doExtensionFunc(make_surface,
                    args,
                    specInfo=[('volumeSpec', 'volumes', 'models')])
Exemplo n.º 28
0
def cmd_vector(cmdName, args):
    from Midas.midas_text import doExtensionFunc
    from Chimera_BILD import vector
    doExtensionFunc(vector, args)
Exemplo n.º 29
0
def mcopy_command(cmdname, args):

    from Midas.midas_text import doExtensionFunc
    doExtensionFunc(molecule_copy, args,
                    specInfo = [('atomSpec','from_atoms','atoms'),
                                ('atomSpec','to_atoms','atoms')])
Exemplo n.º 30
0
def coordset(cmdname, args):

  from Midas.midas_text import doExtensionFunc
  doExtensionFunc(show_coordinates, args,
                  specInfo = [('moleculeSpec','molecules','models'),
                              ('holdSteadySpec','holdSteady','atoms')])
def mclip_command(cmdname, args):

    if len(args) == 0:
        args = 'all'
    from Midas.midas_text import doExtensionFunc
    doExtensionFunc(mclip, args)
Exemplo n.º 32
0
def cmd_cylinder(cmdName, args):
    from Midas.midas_text import doExtensionFunc
    from Chimera_BILD import cylinder
    doExtensionFunc(cylinder, args)
Exemplo n.º 33
0
def topography_command(cmdname, args):

  from Midas.midas_text import doExtensionFunc
  doExtensionFunc(make_surface, args,
                  specInfo = [('volumeSpec','volumes','models')])
Exemplo n.º 34
0
def cmd_sphere(cmdName, args):
    from Midas.midas_text import doExtensionFunc
    from Chimera_BILD import sphere
    doExtensionFunc(sphere, args)
Exemplo n.º 35
0
def crystal_contacts(cmdname, args):

    from Midas.midas_text import doExtensionFunc
    doExtensionFunc(show_contacts, args,
                    specInfo = [('moleculeSpec','molecules','models'),])
Exemplo n.º 36
0
def cmdAddAttr(cmdName, args):
	from AddAttr import addAttributes
	from Midas.midas_text import doExtensionFunc
	doExtensionFunc(addAttributes, args,
				specInfo=[("spec", "models", "molecules")])
def cmdAddAttr(cmdName, args):
    from AddAttr import addAttributes
    from Midas.midas_text import doExtensionFunc
    doExtensionFunc(addAttributes,
                    args,
                    specInfo=[("spec", "models", "molecules")])
def cmd_subrmsd(cmdName, args):
    from Midas.midas_text import doExtensionFunc
    from subalign.core import cmd_rmsd
    doExtensionFunc(cmd_rmsd, args, specInfo=[("refSpec", "reference_sel", None),
                                               ("probeSpec", "probe_sel", None)])
Exemplo n.º 39
0
	def cmdMMMD(self, cmdName, args):
		from Midas.midas_text import doExtensionFunc
		func = getattr(self.module('cmdline'), cmdName)
		doExtensionFunc(func, args,
				specInfo=[("spec", "molecules", "molecules")])
Exemplo n.º 40
0
def run(cmdName, args):
	from Midas.midas_text import doExtensionFunc
	doExtensionFunc(mol2diagram, args,
				specInfo=[("spec", "molecules", "molecules")])
Exemplo n.º 41
0
def cmdDetectClash(cmdName, args):
	import DetectClash
	from Midas.midas_text import doExtensionFunc
	doExtensionFunc(DetectClash.cmdDetectClash, args,
				specInfo=[("atomSpec", "testAtoms", "atoms")])
Exemplo n.º 42
0
def run(cmdName, args):
	fields = args.split(None, 1)
	if len(fields) > 1:
		opt, args = fields
	else:
		opt = fields[0]
		args = ""
	from util import findBestMatch
	try:
		bestMatch = findBestMatch(opt, _optArgsTable.iterkeys())
	except ValueError, s:
		from chimera import UserError
		raise UserError("bad option: %s" % s)
	func, kw = _optArgsTable[bestMatch]
	from Midas.midas_text import doExtensionFunc
	doExtensionFunc(func, args, **kw)

def startCommand(molecule, name="default", method="corkscrew",
			rate="linear", frames=20, cartesian=False):
	from chimera import UserError
	if len(molecule) != 1:
		raise UserError("You must specify exactly one molecule")
	m = molecule[0]

	try:
		ms = _find(name)
	except UserError:
		pass
	else:
		raise UserError("You already defined \"%s\"" % name)
	kw = {
Exemplo n.º 43
0
def cmdUnaniso(cmdName, args):
	import Aniso
	from Midas.midas_text import doExtensionFunc
	doExtensionFunc(Aniso.unaniso, args,
				specInfo=[("spec", "targets", "atoms")])
Exemplo n.º 44
0
def _cmd_plip(cmdName, args):
    doExtensionFunc(cmd_plip, args, specInfo=[("selSpec", "selection", None)])
Exemplo n.º 45
0
def cmd_arrow(cmdName, args):
    from Midas.midas_text import doExtensionFunc
    from Chimera_BILD import arrow
    doExtensionFunc(arrow, args)
def cmdMatchMaker(cmdName, args):
	from MatchMaker import cmdMatch
	from Midas.midas_text import doExtensionFunc
	doExtensionFunc(cmdMatch, args, specInfo=[("refSpec", "refSel", None),
					("matchSpec", "matchSel", None)])
Exemplo n.º 47
0
def cmdCombine(cmdName, args):
        from Midas.midas_text import doExtensionFunc
	import Combine
        doExtensionFunc(Combine.cmdCombine, args,
                                specInfo=[("spec", "mols", "molecules"),
					("refSpec", "refMol", "molecules")])
def hkcage_command(cmdname, args):

    from Midas.midas_text import doExtensionFunc
    doExtensionFunc(hkcage, args)
def run(cmdName, args):
    from Midas.midas_text import doExtensionFunc
    doExtensionFunc(mol2diagram,
                    args,
                    specInfo=[("spec", "molecules", "molecules")])