コード例 #1
0
ファイル: base.py プロジェクト: davem22101/semanticscience
def setup():
	import StdTools
	preferences.addCategory("Tools", ToolsCategory, aliases=["Extensions"],
				manager=manager)
	manager.loadDirectory(chimera.pathFinder().dataRoot)
	StdTools.registerStandardTools()
	if chimera.nogui:
		return
	manager.createMenu()
	manager.showToolbarButtons()
コード例 #2
0
def setup():
    import StdTools
    preferences.addCategory("Tools",
                            ToolsCategory,
                            aliases=["Extensions"],
                            manager=manager)
    manager.loadDirectory(chimera.pathFinder().dataRoot)
    StdTools.registerStandardTools()
    if chimera.nogui:
        return
    manager.createMenu()
    manager.showToolbarButtons()
コード例 #3
0
ファイル: base.py プロジェクト: davem22101/semanticscience
def initialize(setCurrent=1):
	global pref
	if pref is not None:
		return
	from chimera import preferences
	pref = preferences.addCategory("Ribbon Styles",
					preferences.HiddenCategory)

	try:
		# Cannot use "setdefault" here since we need to
		# check for old preference name and save to
		# new preference name
		p = pref[PREF_SCALING]
	except KeyError:
		try:
			p = pref[PREF_OLD_SCALING]
		except KeyError:
			p = {}
		pref[PREF_SCALING] = p
	import scaling
	scaling.initialize(p)

	p = pref.setdefault(PREF_XSECTION, {})
	import xsection
	xsection.initialize(p)

	p = pref.setdefault(PREF_ATOMS, {})
	import atoms
	atoms.initialize(p)

	import chimera
	import SimpleSession
	chimera.triggers.addHandler(SimpleSession.SAVE_SESSION, saveSession,
					None)
コード例 #4
0
	def __init__(self, model):
		self.title = 'PDB Headers for %s' % model.name
		self.model = model
		from chimera import preferences
		self.prefs = preferences.addCategory("PDB headers dialog",
				preferences.HiddenCategory,
				optDict={"ordering": "Alphabetical"})
		ModelessDialog.__init__(self)
コード例 #5
0
 def __init__(self, model):
     self.title = 'PDB Headers for %s' % model.name
     self.model = model
     from chimera import preferences
     self.prefs = preferences.addCategory(
         "PDB headers dialog",
         preferences.HiddenCategory,
         optDict={"ordering": "Alphabetical"})
     ModelessDialog.__init__(self)
コード例 #6
0
def volume_menu_preferences():

    global vmpref
    if vmpref is None:
        from chimera import preferences
        vmpref = preferences.addCategory('Volume Menu',
                                         preferences.HiddenCategory,
                                         optDict = {'shown': False})
    return vmpref
コード例 #7
0
def volume_menu_preferences():

    global vmpref
    if vmpref is None:
        from chimera import preferences
        vmpref = preferences.addCategory('Volume Menu',
                                         preferences.HiddenCategory,
                                         optDict={'shown': False})
    return vmpref
コード例 #8
0
def initialize():
	global pref, userStyles, prefStyles
	from chimera import preferences
	pref = preferences.addCategory(PREF_CATEGORY,
						preferences.HiddenCategory)
	prefStyles = pref.setdefault(PREF_SLAB_STYLES, {})
	import copy
	userStyles = copy.deepcopy(prefStyles)
	chimera.triggers.addTrigger(TRIGGER_SLAB_STYLES)
コード例 #9
0
	def __init__(self):
		self.prefs = preferences.addCategory("write PDB dialog",
				preferences.HiddenCategory,
				optDict={"multiSavePDB": "multiple"})
		self.haveTraj = False
		SaveModeless.__init__(self, clientPos='s', clientSticky='ewns',
			filters=[("PDB", "*.pdb", ".pdb")])
		openModels.addAddHandler(self._modelsChange, None),
		openModels.addRemoveHandler(self._modelsChange, None)
		self._modelsChange()
コード例 #10
0
ファイル: gui.py プロジェクト: davem22101/semanticscience
  def fillInUI(self, parent):

    self.plot = None

    t = parent.winfo_toplevel()
    self.toplevel_widget = t
    t.withdraw()

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

    from chimera.preferences import addCategory, HiddenCategory
    prefs = addCategory("SAXS", HiddenCategory,
                        optDict = {'saxs executable': ''})
    self.preferences = prefs

    import Tkinter
    from CGLtk import Hybrid

    from chimera import widgets as w
    mm = w.ExtendedMoleculeOptionMenu(parent, label_text = 'Molecule ',
                                      labelpos = 'w',
                                      labels = ['selected atoms','all molecules'])
    mm.grid(row = row, column = 0, sticky = 'w')
    row += 1
    self.molecule_menu = mm

    ep = Hybrid.Entry(parent, 'Experimental profile ', 25, browse = True)
    ep.frame.grid(row = row, column = 0, sticky = 'ew')
    row += 1
    self.experimental_profile = ep.variable

    op = Hybrid.Popup_Panel(parent)
    opf = op.frame
    opf.grid(row = row, column = 0, sticky = 'news')
    opf.grid_remove()
    opf.columnconfigure(0, weight=1)
    self.options_panel = op.panel_shown_variable
    row += 1
    orow = 0

    cb = op.make_close_button(opf)
    cb.grid(row = orow, column = 1, sticky = 'e')

    np = Hybrid.Checkbutton(opf, 'Use new plot window', False)
    np.button.grid(row = orow, column = 0, sticky = 'w')
    orow += 1
    self.new_plot = np.variable

    ex = Hybrid.Entry(opf, 'Executable ', 25,
                      initial = prefs['saxs executable'], browse = True)
    ex.frame.grid(row = orow, column = 0, sticky = 'ew')
    orow += 1
    ex.entry.xview('end')
    self.executable = ex.variable
コード例 #11
0
	def __init__(self, groupPanel):
		self.groupPanel = groupPanel
		options = {
			"shownButs": {},
			"executionList": ['attributes...'],
			"shownColumns": {}
		}
		self.prefs = preferences.addCategory("Pseudobond Group Panel",
						preferences.HiddenCategory,
						optDict=options)
		ModelessDialog.__init__(self)
コード例 #12
0
	def __init__(self):
		self.prefs = preferences.addCategory("write Mol2 dialog",
				preferences.HiddenCategory,
				optDict={"multiSaveMol2": "multiple",
					"hydrogen naming": "sybyl",
					"residue numbers": True})
		SaveModeless.__init__(self, clientPos='s', clientSticky='ewns',
			filters=[("Mol2", "*.mol2", ".mol2")])
		openModels.addAddHandler(self._modelsChange, None)
		openModels.addRemoveHandler(self._modelsChange, None)
		self._modelsChange()
コード例 #13
0
 def __init__(self, groupPanel):
     self.groupPanel = groupPanel
     options = {
         "shownButs": {},
         "executionList": ['attributes...'],
         "shownColumns": {}
     }
     self.prefs = preferences.addCategory("Pseudobond Group Panel",
                                          preferences.HiddenCategory,
                                          optDict=options)
     ModelessDialog.__init__(self)
コード例 #14
0
 def __init__(self, modelPanel):
     self.modelPanel = modelPanel
     options = {
         "freqButs": {},
         "executionList": ['attributes...'],
         "shownColumns": {},
         "showColor": False,
         "lastUse": None
     }
     self.prefs = preferences.addCategory("Model Panel",
                                          preferences.HiddenCategory,
                                          optDict=options)
     ModelessDialog.__init__(self)
コード例 #15
0
	def __init__(self, modelPanel):
		self.modelPanel = modelPanel
		options = {
			"freqButs": {},
			"executionList": ['attributes...'],
			"shownColumns": {},
			"showColor": False,
			"lastUse": None
		}
		self.prefs = preferences.addCategory("Model Panel",
						preferences.HiddenCategory,
						optDict=options)
		ModelessDialog.__init__(self)
コード例 #16
0
def accelerator_preferences_category():

    global prefcat
    if prefcat is None:
        options = {
            'path': default_accelerator_file(),
            'time out': '2',
            'enable at startup': None,
        }
        from chimera import preferences as preferences
        prefcat = preferences.addCategory('Accelerators',
                                          preferences.HiddenCategory,
                                          optDict=options)
    return prefcat
コード例 #17
0
def accelerator_preferences_category():

  global prefcat
  if prefcat is None:
    options = {
      'path': default_accelerator_file(),
      'time out': '2',
      'enable at startup': None,
      }
    from chimera import preferences as preferences
    prefcat = preferences.addCategory('Accelerators',
                                      preferences.HiddenCategory,
                                      optDict=options)
  return prefcat
コード例 #18
0
 def __init__(self, singleton=True):
     from chimera import preferences
     self.dialog = None
     self.master = None
     self.trackLights = None
     self.trackViewers = None
     self.trackMaterials = None
     self.saveKey = None
     self.saveFill = None
     self.restoreShinyBrightness = None
     self.prefs = preferences.addCategory("Lighting",
                                          preferences.HiddenCategory)
     self.light = None
     if singleton:
         global _singleton
         _singleton = self
コード例 #19
0
    def __init__(self):

        options = self.factory_defaults()
        from chimera import preferences
        self.saved_prefs = preferences.addCategory('Volume Viewer',
                                                   preferences.HiddenCategory,
                                                   optDict=options)
        self.current_prefs = options.copy()
        self.change_callbacks = []

        #
        # Fix values from old preferences files (<= 1.2154) which were written
        # as strings instead of floats.
        #
        cp = self.current_prefs
        for name in ('box_padding', 'data_cache_size', 'voxel_limit',
                     'voxel_limit_for_open'):
            if name in cp and type(cp[name]) is str:
                cp[name] = float(cp[name])
コード例 #20
0
  def __init__(self):

    options = self.factory_defaults()
    from chimera import preferences
    self.saved_prefs = preferences.addCategory('Volume Viewer',
                                               preferences.HiddenCategory,
                                               optDict = options)
    self.current_prefs = options.copy()
    self.change_callbacks = []

    #
    # Fix values from old preferences files (<= 1.2154) which were written
    # as strings instead of floats.
    #
    cp = self.current_prefs
    for name in ('box_padding', 'data_cache_size', 'voxel_limit',
                 'voxel_limit_for_open'):
      if name in cp and type(cp[name]) is str:
        cp[name] = float(cp[name])
コード例 #21
0
from chimera import replyobj
from DelPhiGlobals import *
from DelPhiHelp import *

# preferences
from chimera import preferences
SURF_RGBA_POS = "surf rgba pos"
SURF_RGBA_MID = "surf rgba mid"
SURF_RGBA_NEG = "surf rgba neg"
prefOptions = {
    "executable": "",
    "radii": "",
    "charges": "",
}
prefs = preferences.addCategory("DelphiController",
                                preferences.HiddenCategory,
                                optDict=prefOptions)
Executable = prefs["executable"]
if not Executable:
    import os, os.path
    execNames = ["delphi", "delphi.exe"]
    path = os.getenv("PATH", os.defpath)
    pathList = path.split(os.pathsep)
    for p in pathList:
        for e in execNames:
            filename = os.path.join(p, e)
            if os.access(filename, os.X_OK):
                Executable = filename
                break
        if Executable:
            break
コード例 #22
0
ファイル: prefs.py プロジェクト: davem22101/semanticscience
from chimera import preferences

BOND_COLOR = 'bondColor'
RELAX_COLOR = 'relaxColor'
LINE_WIDTH = 'line width'

defaults = {
	BOND_COLOR: (0.0, 0.8, 0.9, 1.0),
	RELAX_COLOR: (0.95, 0.5, 0.0, 1.0),
	LINE_WIDTH: 1.0,
}
prefs = preferences.addCategory("FindHBonds", preferences.HiddenCategory,
						optDict=defaults.copy())
コード例 #23
0
# --- UCSF Chimera Copyright ---

import os
import math
import Tkinter

import chimera
from chimera import selection
from chimera import chimage
from chimera import tkgui
from chimera import match
from chimera import preferences
from chimera.baseDialog import ModelessDialog
import Midas

prefs = preferences.addCategory("EnsembleCluster", preferences.HiddenCategory)


class EnsembleMatch(ModelessDialog):
    """Display a table for manipulating one ensemble relative to another.

	The two ensembles should consist of conformers of the same model.
	Table rows correspond to conformers in the reference ensemble.
	Table columns correspond to conformers in the alternative ensemble.
	A conformer in the alternative ensemble will be matched onto
	a conformer in the reference ensemble when a table entry is
	clicked.  The table entry label is the RMSD between the two
	conformers."""

    title = "Ensemble Match"
    help = "ContributedSoftware/ensemblematch/ensemblematch.html"
コード例 #24
0
ファイル: prefs.py プロジェクト: davem22101/semanticscience
# --- UCSF Chimera Copyright ---
# Copyright (c) 2000 Regents of the University of California.
# All rights reserved.  This software provided pursuant to a
# license agreement containing restrictions on its disclosure,
# duplication and use.  This notice must be embedded in or
# attached to all copies, including partial copies, of the
# software or any revisions or derivations thereof.
# --- UCSF Chimera Copyright ---
#
# $Id: prefs.py 26655 2009-01-07 22:02:30Z gregc $

from chimera import preferences

PRESETS = "user presets"

defaults = {
	PRESETS: []
}
prefs = preferences.addCategory("Aniso", preferences.HiddenCategory,
							optDict=defaults.copy())
コード例 #25
0
# --- UCSF Chimera Copyright ---
# Copyright (c) 2000 Regents of the University of California.
# All rights reserved.  This software provided pursuant to a
# license agreement containing restrictions on its disclosure,
# duplication and use.  This notice must be embedded in or
# attached to all copies, including partial copies, of the
# software or any revisions or derivations thereof.
# --- UCSF Chimera Copyright ---
#
# $Id: prefs.py 26655 2009-01-07 22:02:30Z gregc $

from chimera import preferences

CHARGE_METHOD = "charge method"

options = {
	CHARGE_METHOD: "AM1-BCC"
}
prefs = preferences.addCategory("AddCharge", preferences.HiddenCategory,
							optDict=options)
コード例 #26
0
ファイル: base.py プロジェクト: davem22101/semanticscience
# --- UCSF Chimera Copyright ---

import os
import math
import Tkinter

import chimera
from chimera import selection
from chimera import chimage
from chimera import tkgui
from chimera import match
from chimera import preferences
from chimera.baseDialog import ModelessDialog
import Midas

prefs = preferences.addCategory("EnsembleCluster", preferences.HiddenCategory)

class EnsembleMatch(ModelessDialog):
	"""Display a table for manipulating one ensemble relative to another.

	The two ensembles should consist of conformers of the same model.
	Table rows correspond to conformers in the reference ensemble.
	Table columns correspond to conformers in the alternative ensemble.
	A conformer in the alternative ensemble will be matched onto
	a conformer in the reference ensemble when a table entry is
	clicked.  The table entry label is the RMSD between the two
	conformers."""

	title = "Ensemble Match"
	help = "ContributedSoftware/ensemblematch/ensemblematch.html"
	buttons = ("Hide", "Quit")
コード例 #27
0
from chimera import preferences

BOND_COLOR = 'bondColor'
RELAX_COLOR = 'relaxColor'
LINE_WIDTH = 'line width'

defaults = {
    BOND_COLOR: (0.0, 0.8, 0.9, 1.0),
    RELAX_COLOR: (0.95, 0.5, 0.0, 1.0),
    LINE_WIDTH: 1.0,
}
prefs = preferences.addCategory("FindHBonds",
                                preferences.HiddenCategory,
                                optDict=defaults.copy())
コード例 #28
0
ファイル: prefs.py プロジェクト: davem22101/semanticscience
# --- UCSF Chimera Copyright ---
# Copyright (c) 2000 Regents of the University of California.
# All rights reserved.  This software provided pursuant to a
# license agreement containing restrictions on its disclosure,
# duplication and use.  This notice must be embedded in or
# attached to all copies, including partial copies, of the
# software or any revisions or derivations thereof.
# --- UCSF Chimera Copyright ---
#
# $Id: prefs.py 26655 2009-01-07 22:02:30Z gregc $

from chimera import preferences

COLOR = "color"

options = {
	COLOR: (1, 1, 1, 1), # white
}
prefs = preferences.addCategory("ReadMS", preferences.HiddenCategory,
							optDict=options)
コード例 #29
0
# --- UCSF Chimera Copyright ---
# Copyright (c) 2000 Regents of the University of California.
# All rights reserved.  This software provided pursuant to a
# license agreement containing restrictions on its disclosure,
# duplication and use.  This notice must be embedded in or
# attached to all copies, including partial copies, of the
# software or any revisions or derivations thereof.
# --- UCSF Chimera Copyright ---
#
# $Id: prefs.py 29678 2009-12-23 21:26:15Z pett $

from chimera import preferences
from Rotamers.prefs import defaults as rotamerDefaults
from Rotamers.prefs import LIBRARY as ROTAMER_LIBRARY

INCOMPLETE_SC = "incomplete side chains"
MEMORIZED_SETTINGS = "memorized settings"

defaults = {
    INCOMPLETE_SC: rotamerDefaults[ROTAMER_LIBRARY],
    MEMORIZED_SETTINGS: {}
}
# so the defaults above can be used elsewhere, send a copy of the dictionary...
prefs = preferences.addCategory("DockPrep",
                                preferences.HiddenCategory,
                                optDict=defaults.copy())
コード例 #30
0
ファイル: prefs.py プロジェクト: insilichem/tangram_nciplot
        dat = ''
        if 'NCIPLOT_HOME' in os.environ:
            dat = os.path.join(os.environ['NCIPLOT_HOME'], 'dat')
        preferences.set('tangram_nciplot', 'nciplot_bin', binary)
        preferences.set('tangram_nciplot', 'nciplot_dat', dat)
        preferences.save()
    return binary, dat


def set_preferences(binary, dat):
    assert_preferences()
    if os.path.isfile(binary) and os.path.isdir(dat):
        preferences.set('tangram_nciplot', 'nciplot_bin', binary)
        preferences.set('tangram_nciplot', 'nciplot_dat', dat)
        preferences.save()
    else:
        raise ValueError('One or more of the specified paths do not exist.')


def get_preferences():
    return preferences.get('tangram_nciplot', 'nciplot_bin'), \
           preferences.get('tangram_nciplot', 'nciplot_dat')


def test_preferences():
    binary, dat = get_preferences()
    return os.path.isfile(binary) and os.path.isdir(dat)


preferences.addCategory('tangram_nciplot', preferences.HiddenCategory)
assert_preferences()
コード例 #31
0
#
def atom_rgba(atom):

    c = atom.color
    if c == None:
        c = atom.molecule.color
    rgba = c.rgba()
    return rgba


# -----------------------------------------------------------------------------
#
from chimera.preferences import addCategory, HiddenCategory
bzone_prefs = addCategory('BondZone',
                          HiddenCategory,
                          optDict={
                              'active': False,
                              'spacing': 1.0
                          })


# -----------------------------------------------------------------------------
#
def use_bond_zone(use=None, bond_point_spacing=None):

    if use == None:
        return bzone_prefs['active']

    bzone_prefs['active'] = use

    if bond_point_spacing != None:
        bzone_prefs['spacing'] = bond_point_spacing
コード例 #32
0
__version__ = '1.1.2beta'


def get_gui():
    for insta in chimera.extension.manager.instances:
        if hasattr(insta, 'name') and insta.name == 'Xlink Analyzer':
            return insta


def getConfig():
    for insta in chimera.extension.manager.instances:
        if hasattr(insta, 'name') and insta.name == 'Xlink Analyzer':
            return insta.configFrame.config


prefs = preferences.addCategory("xlinkanalyzer", preferences.HiddenCategory)


def pushRecentToPrefs(path):
    otherPaths = [p for p in getRecentPaths() if p != path]
    prefs["path1"] = path
    for i, p in zip(range(2, 11), otherPaths):
        prefs["path{0}".format(i)] = p


def getRecentPaths():
    ret = []
    for s in ["path" + str(i) for i in range(1, 11)]:
        if s in prefs:
            ret.append(prefs[s])
    return ret
コード例 #33
0
ファイル: prefs.py プロジェクト: davem22101/semanticscience
# --- UCSF Chimera Copyright ---
# Copyright (c) 2000 Regents of the University of California.
# All rights reserved.  This software provided pursuant to a
# license agreement containing restrictions on its disclosure,
# duplication and use.  This notice must be embedded in or
# attached to all copies, including partial copies, of the
# software or any revisions or derivations thereof.
# --- UCSF Chimera Copyright ---
#
# $Id: prefs.py 29678 2009-12-23 21:26:15Z pett $

from chimera import preferences
from Rotamers.prefs import defaults as rotamerDefaults
from Rotamers.prefs import LIBRARY as ROTAMER_LIBRARY

INCOMPLETE_SC = "incomplete side chains"
MEMORIZED_SETTINGS = "memorized settings"

defaults = {
	INCOMPLETE_SC: rotamerDefaults[ROTAMER_LIBRARY],
	MEMORIZED_SETTINGS: {}
}
# so the defaults above can be used elsewhere, send a copy of the dictionary...
prefs = preferences.addCategory("DockPrep", preferences.HiddenCategory,
						optDict=defaults.copy())
コード例 #34
0
        activity = None
        for m in chimera.openModels.list(modelTypes=[chimera.Molecule]):
            if activity is None:
                activity = m.openState.active
            elif activity != m.openState.active:
                updateDistance()
                return

    distanceHandlers['OpenState'] = chimera.triggers.addHandler(
        'OpenState', openStateCB, None)


from chimera import preferences
_pref = preferences.addCategory("Distance Monitors",
                                preferences.HiddenCategory,
                                optDict={
                                    'precision': 3,
                                    'show units': True
                                })


def precision():
    return _pref['precision']


def setPrecision(p):
    if not isinstance(p, int):
        raise TypeError, "precision must be integer"
    if p < 0:
        raise ValueError, "precision must be non-negative"
    _pref['precision'] = p
    updateDistance()
コード例 #35
0
ファイル: prefs.py プロジェクト: davem22101/semanticscience
# software or any revisions or derivations thereof.
# --- UCSF Chimera Copyright ---
#
# $Id: prefs.py 26899 2009-02-13 01:19:04Z pett $

from chimera import preferences

DIST_CUTOFF = "distance cutoff"
CIRCULAR = "circular permutation"
ANYALL = "match type"
GAPCHAR = "gap character"
ITERATE = "iterate"
ITER_CONVERGE = "iter until convergence"
ITER_AMOUNT = "iter amount"
ITER_ALL_COLS = "iter all columns"
ITER_CONSECUTIVE_COLS = "iter stretch"

defaults = {
	DIST_CUTOFF: 5.0,
	CIRCULAR: False,
	ANYALL: "any",
	GAPCHAR: ".",
	ITERATE: False,
	ITER_CONVERGE: False,
	ITER_AMOUNT: 3,
	ITER_ALL_COLS: False,
	ITER_CONSECUTIVE_COLS: 3
}
prefs = preferences.addCategory("StructSeqAlign", preferences.HiddenCategory,
						optDict=defaults.copy())
コード例 #36
0
	SHOW_SEL: 1,
	NEW_REGION_BORDER: None,
	NEW_REGION_INTERIOR: "white",
	SEL_REGION_BORDER: None,
	SEL_REGION_INTERIOR: "green",
	SEQ_NAME_ELLIPSIS: 30,
	REGION_NAME_ELLIPSIS: 25,
	MATRIX: mmDefaults[MATRIX],
	GAP_OPEN: mmDefaults[GAP_OPEN],
	GAP_EXTEND: mmDefaults[GAP_EXTEND],
	MATCH_REG_ACTIVE: False,
	MATCH_REG_EDGE: "black",
	MATCH_REG_FILL: None,
	ERROR_REG_ACTIVE: True,
	ERROR_REG_EDGE: None,
	ERROR_REG_FILL: "red",
	GAP_REG_ACTIVE: True,
	GAP_REG_EDGE: "red",
	GAP_REG_FILL: None,
	USE_SS: mmDefaults[USE_SS],
	SS_MIXTURE: mmDefaults[SS_MIXTURE],
	SS_SCORES: mmDefaults[SS_SCORES],
	HELIX_OPEN: mmDefaults[HELIX_OPEN],
	STRAND_OPEN: mmDefaults[STRAND_OPEN],
	OTHER_OPEN: mmDefaults[OTHER_OPEN],
}

from copy import deepcopy
prefs = preferences.addCategory("MultAlignViewer",
		preferences.HiddenCategory, optDict=deepcopy(defaults))
コード例 #37
0
    def fillInUI(self, parent):

        self.plot = None

        t = parent.winfo_toplevel()
        self.toplevel_widget = t
        t.withdraw()

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

        from chimera.preferences import addCategory, HiddenCategory
        prefs = addCategory("SAXS",
                            HiddenCategory,
                            optDict={'saxs executable': ''})
        self.preferences = prefs

        import Tkinter
        from CGLtk import Hybrid

        from chimera import widgets as w
        mm = w.ExtendedMoleculeOptionMenu(
            parent,
            label_text='Molecule ',
            labelpos='w',
            labels=['selected atoms', 'all molecules'])
        mm.grid(row=row, column=0, sticky='w')
        row += 1
        self.molecule_menu = mm

        ep = Hybrid.Entry(parent, 'Experimental profile ', 25, browse=True)
        ep.frame.grid(row=row, column=0, sticky='ew')
        row += 1
        self.experimental_profile = ep.variable

        op = Hybrid.Popup_Panel(parent)
        opf = op.frame
        opf.grid(row=row, column=0, sticky='news')
        opf.grid_remove()
        opf.columnconfigure(0, weight=1)
        self.options_panel = op.panel_shown_variable
        row += 1
        orow = 0

        cb = op.make_close_button(opf)
        cb.grid(row=orow, column=1, sticky='e')

        np = Hybrid.Checkbutton(opf, 'Use new plot window', False)
        np.button.grid(row=orow, column=0, sticky='w')
        orow += 1
        self.new_plot = np.variable

        ex = Hybrid.Entry(opf,
                          'Executable ',
                          25,
                          initial=prefs['saxs executable'],
                          browse=True)
        ex.frame.grid(row=orow, column=0, sticky='ew')
        orow += 1
        ex.entry.xview('end')
        self.executable = ex.variable
コード例 #38
0
ファイル: prefs.py プロジェクト: davem22101/semanticscience
from chimera.preferences import addCategory, HiddenCategory
defaults = {
	CHAIN_PAIRING: CP_BEST,
	SEQUENCE_ALGORITHM: SA_NEEDLEMAN_WUNSCH,
	SHOW_SEQUENCE: False,
	MATRIX: "BLOSUM-62",
	GAP_OPEN: 12,
	GAP_EXTEND: 1,
	USE_SS: True,
	SS_MIXTURE: 0.3,
	SS_SCORES: {
		('H', 'H'): 6,
		('S', 'S'): 6,
		('O', 'O'): 4,
		('S', 'H'): -9,
		('H', 'S'): -9,
		('S', 'O'): -6,
		('O', 'S'): -6,
		('H', 'O'): -6,
		('O', 'H'): -6
	},
	ITERATE: True,
	ITER_CUTOFF: 2.0,
	HELIX_OPEN: 18,
	STRAND_OPEN: 18,
	OTHER_OPEN: 6,
	COMPUTE_SS: True,
}
from copy import deepcopy
prefs = addCategory("MatchMaker", HiddenCategory, optDict=deepcopy(defaults))
コード例 #39
0
# delphi/chimera-related modules
from chimera import replyobj
from DelPhiGlobals import *
from DelPhiHelp import *

# preferences
from chimera import preferences
SURF_RGBA_POS = "surf rgba pos"
SURF_RGBA_MID = "surf rgba mid"
SURF_RGBA_NEG = "surf rgba neg"
prefOptions = {
	"executable": "",
	"radii": "",
	"charges": "",
}
prefs = preferences.addCategory("DelphiController",
			preferences.HiddenCategory, optDict=prefOptions)
Executable = prefs["executable"]
if not Executable:
	import os, os.path
	execNames = [ "delphi", "delphi.exe" ]
	path = os.getenv("PATH", os.defpath)
	pathList = path.split(os.pathsep)
	for p in pathList:
		for e in execNames:
			filename = os.path.join(p, e)
			if os.access(filename, os.X_OK):
				Executable = filename
				break
		if Executable:
			break
	import sys
コード例 #40
0
ファイル: gui.py プロジェクト: davem22101/semanticscience
from base import readPBinfo
import Pmw

ui = None

def showUI():
	global ui

	if not ui:
		ui = PBreaderDialog()
	ui.enter()

from chimera import preferences

options = { "line width": 1.0 }
prefs = preferences.addCategory("pseudobond reader", preferences.HiddenCategory,
							optDict=options)

class PBreaderDialog(OpenModeless):
	title = "Pseudobond Reader"
	help = "ContributedSoftware/pbreader/pbreader.html"

	def __init__(self):
		OpenModeless.__init__(self, title="Pseudobond File to Read",
				historyID="PBReader open", clientPos='s')

	def fillInUI(self, parent):
		OpenModeless.fillInUI(self, parent)

		group = Pmw.Group(self.clientArea, tag_text='Further info')
		group.grid(row=0, column=0, sticky='nsew')
		self.catName = StringOption(group.interior(), 0,
コード例 #41
0
ファイル: prefs.py プロジェクト: davem22101/semanticscience
ROT_LABEL = "rot label"
ROT_DIAL_SIZE = "dial size"
ANGLE_PRECISION = "angle precision"
TORSION_PRECISION = "torsion precision"
SHOW_DEGREE_SYMBOL = "show degree symbol"
AXIS_RADIUS = "axis radius"
AXIS_SEL_OBJ = "axis sel obj"
AXIS_SEL_ATOMS = "axis sel atoms"
OBJ_SEL_AXIS = "obj sel axis"
ATOMS_SEL_AXIS = "atoms sel axis"
PLANE_THICKNESS = "plane thickness"

defaults = {
	ROT_LABEL: 'None',
	ROT_DIAL_SIZE: 1,
	ANGLE_PRECISION: 3,
	TORSION_PRECISION: 3,
	SHOW_DEGREE_SYMBOL: True,
	AXIS_RADIUS: 1,
	AXIS_SEL_OBJ: True,
	AXIS_SEL_ATOMS: False,
	OBJ_SEL_AXIS: True,
	ATOMS_SEL_AXIS: False,
	PLANE_THICKNESS: 0.1
}

# so the defaults above can be used elsewhere, send a copy of the dictionary...
prefs = preferences.addCategory("Struct Measure", preferences.HiddenCategory,
						optDict=defaults.copy())
コード例 #42
0
		if 'transformation change' not in changes.reasons:
			return
		activity = None
		for m in chimera.openModels.list(modelTypes=[chimera.Molecule]):
			if activity is None:
				activity = m.openState.active
			elif activity != m.openState.active:
				updateDistance()
				return
	distanceHandlers['OpenState'] = chimera.triggers.addHandler(
					'OpenState', openStateCB, None)

from chimera import preferences
_pref = preferences.addCategory("Distance Monitors",
				preferences.HiddenCategory,
				optDict={
					'precision': 3,
					'show units': True
				})

def precision():
	return _pref['precision']

def setPrecision(p):
	if not isinstance(p, int):
		raise TypeError, "precision must be integer"
	if p < 0:
		raise ValueError, "precision must be non-negative"
	_pref['precision'] = p
	updateDistance()

def showUnits(val=None):
コード例 #43
0
# --- UCSF Chimera Copyright ---
#
# $Id: prefs.py 26899 2009-02-13 01:19:04Z pett $

from chimera import preferences

DIST_CUTOFF = "distance cutoff"
CIRCULAR = "circular permutation"
ANYALL = "match type"
GAPCHAR = "gap character"
ITERATE = "iterate"
ITER_CONVERGE = "iter until convergence"
ITER_AMOUNT = "iter amount"
ITER_ALL_COLS = "iter all columns"
ITER_CONSECUTIVE_COLS = "iter stretch"

defaults = {
    DIST_CUTOFF: 5.0,
    CIRCULAR: False,
    ANYALL: "any",
    GAPCHAR: ".",
    ITERATE: False,
    ITER_CONVERGE: False,
    ITER_AMOUNT: 3,
    ITER_ALL_COLS: False,
    ITER_CONSECUTIVE_COLS: 3
}
prefs = preferences.addCategory("StructSeqAlign",
                                preferences.HiddenCategory,
                                optDict=defaults.copy())
コード例 #44
0
VOLUME_RESOLUTION = "volume resolution"

RECORDER_FORMAT = "animation format"
RECORDER_RECORD_ARGS = "record args"
RECORDER_ENCODE_ARGS = "encode args"
RECORDER_SUPERSAMPLE = "supersample"
RECORDER_SAMPLES = "samples"
RECORDER_ROUNDTRIP = "roundtrip"
RECORDER_RAYTRACE = "raytrace"

options = {
	SCRIPT_TYPE: SCRIPT_PYTHON,
	DICT_NAME: "mdInfo",
	FRAME_TEXT: "<FRAME>",
	ZERO_PAD: True,
	RMSD_MIN: 0.5,
	RMSD_MAX: 3.0,
	RMSD_AUTOCOLOR: True,
	VOLUME_CUTOFF: 10.0,
	VOLUME_RESOLUTION: 1.0,
	RECORDER_FORMAT: -1,
	RECORDER_RECORD_ARGS: "",
	RECORDER_ENCODE_ARGS: "",
	RECORDER_SUPERSAMPLE: True,
	RECORDER_SAMPLES: 3,
	RECORDER_ROUNDTRIP: False,
	RECORDER_RAYTRACE: False
}
prefs = preferences.addCategory("MD Movie", preferences.HiddenCategory,
							optDict=options)
コード例 #45
0
ファイル: __init__.py プロジェクト: crosslinks/XlinkAnalyzer
DEBUG_MODE = False

__version__ = '1.1.2beta'

def get_gui():
    for insta in chimera.extension.manager.instances:
        if hasattr(insta, 'name') and insta.name == 'Xlink Analyzer':
            return insta


def getConfig():
    for insta in chimera.extension.manager.instances:
        if hasattr(insta, 'name') and insta.name == 'Xlink Analyzer':
            return insta.configFrame.config

prefs = preferences.addCategory("xlinkanalyzer", preferences.HiddenCategory)

def pushRecentToPrefs(path):
    otherPaths = [p for p in getRecentPaths() if p != path]
    prefs["path1"]=path
    for i, p in zip(range(2,11), otherPaths):
        prefs["path{0}".format(i)] = p

def getRecentPaths():
    ret = []
    for s in ["path"+str(i) for i in range(1,11)]:
        if s in prefs:
            ret.append(prefs[s])
    return ret

def activateByName(name, chainIds=None):  # this is for testing only
コード例 #46
0
# --- UCSF Chimera Copyright ---
# Copyright (c) 2000 Regents of the University of California.
# All rights reserved.  This software provided pursuant to a
# license agreement containing restrictions on its disclosure,
# duplication and use.  This notice must be embedded in or
# attached to all copies, including partial copies, of the
# software or any revisions or derivations thereof.
# --- UCSF Chimera Copyright ---
#
# $Id: prefs.py 26655 2009-01-07 22:02:30Z gregc $

from chimera import preferences

HELIX_COLOR = "helix color"
SHEET_COLOR = "sheet color"
OTHER_COLOR = "other color"

defaultColors = {
    HELIX_COLOR: 'orange red',
    SHEET_COLOR: 'purple',
    OTHER_COLOR: 'gray'
}
options = {}
options.update(defaultColors)
prefs = preferences.addCategory("ColorSS",
                                preferences.HiddenCategory,
                                optDict=options)
コード例 #47
0
ファイル: prefs.py プロジェクト: davem22101/semanticscience
# --- UCSF Chimera Copyright ---
# Copyright (c) 2000 Regents of the University of California.
# All rights reserved.  This software provided pursuant to a
# license agreement containing restrictions on its disclosure,
# duplication and use.  This notice must be embedded in or
# attached to all copies, including partial copies, of the
# software or any revisions or derivations thereof.
# --- UCSF Chimera Copyright ---
#
# $Id: prefs.py 26655 2009-01-07 22:02:30Z gregc $

from chimera import preferences

FORMAT = "format"
INPUT_FILES = "input files"
GROMOS_SCALING = "Gromos coord scaling"
PDB_STYLE = "PDB input scheme"

options = {
	FORMAT: 'Amber',
	INPUT_FILES: {},
	GROMOS_SCALING: 10.0,
	PDB_STYLE: "multiple files"
}

prefs = preferences.addCategory("Trajectory",
				preferences.HiddenCategory,
				optDict=options)
コード例 #48
0
MIDAS_CATEGORY = "Command Line"
preferences.register(MIDAS_CATEGORY, {
    STARTUP_FILES:
    (tkoptions.OrderedFileListOption, ["~/.chimera/midasrc", ".chmidasrc"
                                       ], None, {
                                           'height': 4
                                       }),
    SES_MEMORY: (tkoptions.IntOption, 60, None, {
        'min': 0
    })
},
                     aliases=["Midas"])

PREV_COMMANDS = "remembered commands"
prefs = preferences.addCategory("command line gui",
                                preferences.HiddenCategory,
                                optDict={PREV_COMMANDS: []})

triggerName = "typed Midas command"
chimera.triggers.addTrigger(triggerName)


class MidasUI:
    "Class for presenting a Midas command line"

    recordLabel = "Command History..."
    hideLabel = "Hide Command Line"

    def __init__(self):
        from chimera import tkgui
        self.frame = Tkinter.Frame(tkgui.app)
コード例 #49
0
ファイル: prefs.py プロジェクト: davem22101/semanticscience
LIBRARY = "rotamer library"
CLASH_METHOD = "clash type"
CLASH_PBS = "show clash pseudobonds"
CLASH_COLOR = "clash pb color"
CLASH_WIDTH = "clash pb width"
HBOND_COLOR = "hbond pb color"
RELAX_COLOR = "hbond pb relaxation color"
HBOND_WIDTH = "hbond pb width"
DRAW_HBONDS = "draw hbonds"
CLASH_IGNORE_OTHERS = "Ignore clashes with other models"
HBOND_IGNORE_OTHERS = "Ignore hbonds with other models"

defaults = {
	LIBRARY: "Dunbrack",
	CLASH_THRESHOLD: clashDefaults[CLASH_THRESHOLD],
	HBOND_ALLOWANCE: clashDefaults[HBOND_ALLOWANCE],
	CLASH_METHOD: "num",
	CLASH_PBS: False,
	CLASH_COLOR: clashDefaults[PB_COLOR],
	CLASH_WIDTH: clashDefaults[PB_WIDTH],
	HBOND_COLOR: hbondDefaults[BOND_COLOR],
	RELAX_COLOR: hbondDefaults[FHB_RELAX_COLOR],
	HBOND_WIDTH: hbondDefaults[LINE_WIDTH],
	DRAW_HBONDS: True,
	CLASH_IGNORE_OTHERS: False,
	HBOND_IGNORE_OTHERS: False
}
# so the defaults above can be used elsewhere, send a copy of the dictionary...
prefs = preferences.addCategory("Rotamers", preferences.HiddenCategory,
						optDict=defaults.copy())
コード例 #50
0
# encoding: utf-8
"""
This is the preferences file for the extension. All default values
should be listed here for reference and easy reuse.
"""

from __future__ import print_function, division
from distutils.spawn import find_executable
import os
# Chimera
from chimera.preferences import preferences, addCategory, HiddenCategory
from core import SNFG


def _defaults():
    return dict(
        zip(SNFG.__init__.im_func.func_code.co_varnames[1:],
            SNFG.__init__.im_func.func_defaults))


DEFAULTS = _defaults()
DEFAULTS['icon_size'] = DEFAULTS['size'] / 2.5
DEFAULTS['full_size'] = DEFAULTS['size']

prefs = addCategory("tangram_snfg", HiddenCategory, optDict=DEFAULTS.copy())
try:
    with open(preferences._filename) as f:
        d = eval(f.read())
    prefs.update(d.get('tangram_snfg', {}))
except Exception as e:
    print('Problem loading saved preferences:', e)
コード例 #51
0
NONCLASH_COLOR = "non-clash color"
HBOND_ALLOWANCE = "h-bond allowance"
ACTION_PSEUDOBONDS = "make pseudobonds"
PB_COLOR = "pseudobond color"
PB_WIDTH = "pseudobond width"
BOND_SEPARATION = "bond separation"
ACTION_WRITEINFO = "write info"
IGNORE_INTRA_RES = "ignore intra-residue clashes"
ACTION_REPLYLOG = "log info"

defaults = {
    CLASH_THRESHOLD: 0.6,
    ACTION_ATTR: False,
    ACTION_SELECT: False,
    ACTION_COLOR: False,
    CLASH_COLOR: "red",
    NONCLASH_COLOR: None,
    HBOND_ALLOWANCE: 0.4,
    ACTION_PSEUDOBONDS: True,
    PB_COLOR: "yellow",
    PB_WIDTH: 2.0,
    BOND_SEPARATION: 4,
    ACTION_WRITEINFO: False,
    IGNORE_INTRA_RES: True,
    ACTION_REPLYLOG: False
}
# so that defaults dict stays unmodified, send a copy...
prefs = preferences.addCategory("DetectClash",
                                preferences.HiddenCategory,
                                optDict=defaults.copy())
コード例 #52
0
ファイル: prefs.py プロジェクト: davem22101/semanticscience
# --- UCSF Chimera Copyright ---
# Copyright (c) 2000 Regents of the University of California.
# All rights reserved.  This software provided pursuant to a
# license agreement containing restrictions on its disclosure,
# duplication and use.  This notice must be embedded in or
# attached to all copies, including partial copies, of the
# software or any revisions or derivations thereof.
# --- UCSF Chimera Copyright ---
#
# $Id: prefs.py 26655 2009-01-07 22:02:30Z gregc $

from chimera import preferences

HELIX_COLOR = "helix color"
SHEET_COLOR = "sheet color"
OTHER_COLOR = "other color"

defaultColors = {
	HELIX_COLOR: 'orange red',
	SHEET_COLOR: 'purple',
	OTHER_COLOR: 'gray'
}
options = {}
options.update(defaultColors)
prefs = preferences.addCategory("ColorSS", preferences.HiddenCategory,
							optDict=options)
コード例 #53
0
# --- UCSF Chimera Copyright ---
# Copyright (c) 2000 Regents of the University of California.
# All rights reserved.  This software provided pursuant to a
# license agreement containing restrictions on its disclosure,
# duplication and use.  This notice must be embedded in or
# attached to all copies, including partial copies, of the
# software or any revisions or derivations thereof.
# --- UCSF Chimera Copyright ---
#
# $Id: prefs.py 26655 2009-01-07 22:02:30Z gregc $

from chimera import preferences

SOLVENT_MODEL = "solvent model"

options = {SOLVENT_MODEL: "TIP3PBOX"}
prefs = preferences.addCategory("Solvate",
                                preferences.HiddenCategory,
                                optDict=options)
コード例 #54
0
# --- UCSF Chimera Copyright ---
# Copyright (c) 2000 Regents of the University of California.
# All rights reserved.  This software provided pursuant to a
# license agreement containing restrictions on its disclosure,
# duplication and use.  This notice must be embedded in or
# attached to all copies, including partial copies, of the
# software or any revisions or derivations thereof.
# --- UCSF Chimera Copyright ---
#
# $Id: prefs.py 26655 2009-01-07 22:02:30Z gregc $

from chimera import preferences

PRESETS = "user presets"

defaults = {PRESETS: []}
prefs = preferences.addCategory("Aniso",
                                preferences.HiddenCategory,
                                optDict=defaults.copy())