Пример #1
0
 def __init__(self, session, gid=None, group_editor=None):
     self.session = session
     self.gid = gid
     self.group_editor = group_editor
     
     tkutil.Dialog.__init__(self, session.tk, 'Group editor -- ???')
     
     e1 = tkutil.entry_field(self.top, 'GSS type:', '', 20)
     e1.frame.pack(side='top', anchor='w')
     self.aatype = e1.variable
 
     e2 = tkutil.entry_field(self.top, 'Next GSS:', '', 20)
     e2.frame.pack(side='top', anchor='w')
     self.next_ = e2.variable
 
     e3 = tkutil.entry_field(self.top, 'Residue:', '', 20)
     e3.frame.pack(side='top', anchor='w')
     self.residue = e3.variable
 
     br = tkutil.button_row(self.top,
                 ('Apply', self.update),
                 ('Merge resonances', self.merge_resonances),
                 ('Close', self.close_cb),
                 )
     br.frame.pack(side = 'top', anchor = 'w')
    def __init__(self, session):
        """ Initialization
        """
        self.session = session
        tkutil.Dialog.__init__(self, session.tk,
                               'Open & Autoreload Multiple Spectra')
        
        proj = session.project
        mfs = tkutil.multiple_file_selection(self.top, proj.sparky_directory)
        mfs.frame.pack(side = 'top', anchor = 'nw', fill = 'both', expand = 1)
        self.files = mfs

        r = Tkinter.Label(self.top, justify = 'left')
        r.pack(side = 'top', anchor = 'nw')

        self.result = r
        br = tkutil.button_row(self.top,
                               ('Open', self.open_cb),
                               ('Set Timer', self.set_timer),
                               ('Toggle Autoreload', self.toggle_autoreload),
                               ('Cancel', self.close_cb),
                               ('Help',
                                sputil.help_cb(session,
                                               'OpenAutoreloadSpectra')),
                               )
        br.frame.pack(side = 'top', anchor = 'nw')

        self.autoreload = True  # if the spectrum files should be autoreloaded
        self.paths      = None  # list of spectrum files to open
        self.tslist     = None  # list of timestamps for the spectrum files
        self.tth        = None  # threading.Timer instance
        self.q = Queue.Queue(1)
Пример #3
0
    def __init__(self, session):
        self.session = session
        self.title = 'Group dialog'
        
        tkutil.Dialog.__init__(self, session.tk, self.title)

        # modify things
        #   gid
        #     aatype, next, residue
        #   resonance
        #     merge
        #     atomtype
        
        # use group_data.listbox.bind to add my own callbacks (see peaklist for an example)
        self.group_data = tkutil.scrolling_list(self.top, 'Group data', 5)
        self.group_data.frame.pack(side = 'top', fill = 'both', expand = 1)
        self.group_data.listbox.bind('<ButtonRelease-1>', self.click_on_listbox)

        # display things
        #   aatype, next, residue
        #   resonances in group
        #     aatype
        #     shift
        #     low, high shifts of peak dimensions
        
        # when peak selection is changed, if the peak's resonances are all
        #   only assigned to a single group, make that the active group

        br = tkutil.button_row(self.top,
                    ('Refresh', self.reset),
                    ('Close', self.close_cb),
                    )
        br.frame.pack(side = 'top', anchor = 'w')
        
        self.reset()
Пример #4
0
  def __init__(self, session):

    self.session = session
    self.assignments = None
    self.spin_graph_dialog = None
    self.current_resonance = None
    self.extender = None
    self.shown_group_atoms = None
    
    tkutil.Dialog.__init__(self, session.tk, 'Assignment Graph')

    lb = self.peak_list_box(self.top)
    lb.pack(side = 'top', fill = 'both', expand = 1)
    
    progress_label = Tkinter.Label(self.top, anchor = 'nw')
    progress_label.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
			   ('Assign', self.assign_cb),
                           ('Unassign', self.unassign_cb),
                           ('Strips...', self.strip_cb),
                           ('Update', self.update_cb),
			   ('Setup...', self.setup_cb),
                           ('Stop', self.stop_cb),
                           ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'AssignGraph')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[5])
Пример #5
0
    def __init__(self, session):

        tkutil.Dialog.__init__(self, session.tk, 'Read Peak List')

        plp = tkutil.file_field(self.top, 'Peak file: ', 'peaklist')
        plp.frame.pack(side='top', anchor='w')
        self.peak_list_path = plp

        sc = sputil.spectrum_menu(session, self.top, 'Spectrum: ')
        sc.frame.pack(side='top', anchor='w')
        self.spectrum_choice = sc

        sl = tkutil.scrolling_list(self.top, 'Unreadable lines', 5)
        sl.frame.pack(side='top', anchor='w', fill='both', expand=1)
        self.unreadable = sl

        progress_label = Tkinter.Label(self.top, anchor='nw')
        progress_label.pack(side='top', anchor='w')

        br = tkutil.button_row(
            self.top,
            ('Create peaks', self.read_cb),
            ('Stop', self.stop_cb),
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'ReadPeaks')),
        )
        br.frame.pack(side='top', anchor='w')

        tkutil.Stoppable.__init__(self, progress_label, br.buttons[1])
Пример #6
0
    def __init__(self, session):

        self.session = session
        self.assignments = None
        self.spin_graph_dialog = None
        self.current_resonance = None
        self.extender = None
        self.shown_group_atoms = None

        tkutil.Dialog.__init__(self, session.tk, 'Assignment Graph')

        lb = self.peak_list_box(self.top)
        lb.pack(side='top', fill='both', expand=1)

        progress_label = Tkinter.Label(self.top, anchor='nw')
        progress_label.pack(side='top', anchor='w')

        br = tkutil.button_row(
            self.top,
            ('Assign', self.assign_cb),
            ('Unassign', self.unassign_cb),
            ('Strips...', self.strip_cb),
            ('Update', self.update_cb),
            ('Setup...', self.setup_cb),
            ('Stop', self.stop_cb),
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'AssignGraph')),
        )
        br.frame.pack(side='top', anchor='w')

        tkutil.Stoppable.__init__(self, progress_label, br.buttons[5])
Пример #7
0
  def __init__(self, session):

    self.session = session
    self.view_to_center = None
    self.selection_notice = None
    
    tkutil.Dialog.__init__(self, session.tk, 'View Center')

    explain = ('Specify a view window to be centered\n' +
               'by the cm or cp commands.  The cm command\n' +
               'centers the view at the point under the mouse\n'
               'when the command is invoked in any window.\n' +
               'The cp command centers the view on the selected\n' +
               'peak.')
    w = Tkinter.Label(self.top, text = explain, justify = 'left')
    w.pack(side = 'top', anchor = 'w')

    add_command = pythonshell.add_command
    add_command('cm', '', 'centerview', 'center_view_on_mouse', session)
    add_command('cp', '', 'centerview', 'center_view_on_peak', session)

    self.center_view = sputil.view_menu(session, self.top, 'View to center: ')
    self.center_view.frame.pack(side = 'top', anchor = 'w')

    ps = tkutil.checkbutton(self.top, 'Center when peak selected?', 0)
    ps.button.pack(side = 'top', anchor = 'w')
    self.peak_select = ps

    br = tkutil.button_row(self.top,
			   ('Ok', self.ok_cb),
                           ('Apply', self.apply_cb),
                           ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'CenterViews')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')
Пример #8
0
  def __init__(self, session):

    tkutil.Dialog.__init__(self, session.tk, 'Place HC Peaks from Resonances')

    explain = ('Create and label peaks on a 2D C13 HSQC spectrum\n' +
               'for all protons attached to carbons, if both proton\n' +
               'and carbon resonances are assigned and labeled\n'
               'correctly.\n')
    w = Tkinter.Label(self.top, text = explain, justify = 'left')
    w.pack(side = 'top', anchor = 'w')

    m = sputil.spectrum_menu(session, self.top, 'Spectrum: ')
    m.frame.pack(side = 'top', anchor = 'w')
    self.spectrum_menu = m

    progress_label = Tkinter.Label(self.top, anchor = 'nw')
    progress_label.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
			   ('Place peaks', self.place_cb),
			   ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'HCPeaks')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[1])
Пример #9
0
  def __init__(self, session):

    self.session = session
    self.peak = None
    
    tkutil.Dialog.__init__(self, session.tk, 'Peak Resonance Mover')

    self.spectrum_menu = sputil.spectrum_menu(session, self.top, 'Spectrum: ')
    self.spectrum_menu.frame.pack(side = 'top', anchor = 'w')

    cb = tkutil.checkbutton(self.top, 'On / Off', 0)
    cb.button.pack(side = 'top', anchor = 'w')
    cb.add_callback(self.onoff_cb)
    self.onoff = cb
    self.will_drag_notice = None
    self.dragged_notice = None

    self.message = Tkinter.Label(self.top)
    self.message.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'ShiftRes')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')
Пример #10
0
  def __init__(self, session):

    self.session = session
    self.title = 'Peak List'
    self.spectrum = None
    self.peaks = ()
    self.settings = peak_list_settings()

    tkutil.Dialog.__init__(self, session.tk, self.title)

    pl = sputil.peak_listbox(self.top)
    pl.frame.pack(side = 'top', fill = 'both', expand = 1)
    pl.listbox.bind('<ButtonRelease-1>', pl.select_peak_cb)
    pl.listbox.bind('<ButtonRelease-2>', pl.goto_peak_cb)
    pl.listbox.bind('<Double-ButtonRelease-1>', pl.goto_peak_cb)
    self.peak_list = pl

    progress_label = Tkinter.Label(self.top, anchor = 'nw')
    progress_label.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
			   ('Update', self.update_cb),
			   ('Setup...', self.setup_cb),
			   ('Save...', self.peak_list.save_cb),
			   ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'PeakListPython')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[3])
Пример #11
0
  def __init__(self, session):
    
    tkutil.Settings_Dialog.__init__(self, session.tk,
                                    'Strip Matching Parameters')

    t = tkutil.entry_row(self.top, 'Tolerances ',
                         (' 1H', '.02', 5),
                         (' 13C', '.2', 5),
                         (' 15N', '.2', 5))
    t.frame.pack(side = 'top', anchor = 'w')
    self.tolerances = {'1H': t.variables[0],
                       '13C': t.variables[1],
                       '15N': t.variables[2]}

    e = tkutil.entry_field(self.top, 'Allow ', '0', 3, ' unmatched peaks')
    e.frame.pack(side = 'top', anchor = 'w')
    self.max_unmatched = e.variable
    
    br = tkutil.button_row(self.top,
                           ('Ok', self.ok_cb),
			   ('Apply', self.apply_cb),                           
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'StripPlot')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')
Пример #12
0
  def __init__(self, session):

    tkutil.Settings_Dialog.__init__(self, session.tk, 'Peak List Settings')

    fb = Tkinter.Frame(self.top, borderwidth = 3, relief = 'groove')
    fb.pack(side = 'top', fill = 'x')

    #
    # Create the checkbutton and extra widgets for each possible field
    #
    self.field_widgets = {}
    for fc in field_classes:
      self.field_widgets[fc] = fc.field_widgets(self.top, fc.name)

    opt = Tkinter.Frame(self.top, borderwidth = 3, relief = 'groove')
    opt.pack(side = 'top', fill = 'x')

    cb = tkutil.checkbutton(opt, 'Sort by assignment?', 1)
    self.assignmentsort = cb.variable
    cb.button.pack(side = 'top', anchor = 'w')

    cb = tkutil.checkbutton(opt, 'Pair crossdiagonal peaks?', 0)
    self.crosspair = cb.variable
    cb.button.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
                           ('Ok', self.ok_cb),
			   ('Apply', self.apply_cb),
			   ('Close', self.close_cb),
			   )
    br.frame.pack(side = 'top', anchor = 'w')
Пример #13
0
  def __init__(self, session):

    self.session = session
    
    tkutil.Dialog.__init__(self, session.tk, 'Pick Atoms')

    cb = tkutil.checkbutton(self.top, 'Show atom labels?', 0)
    self.show_label = cb.variable
    cb.button.pack(side = 'top', anchor = 'w')

    cb = tkutil.checkbutton(self.top, 'Show distances?', 0)
    self.show_distance = cb.variable
    cb.button.pack(side = 'top', anchor = 'w')

    cb = tkutil.checkbutton(self.top, 'Show peaks?', 0)
    self.show_peak = cb.variable
    cb.button.pack(side = 'top', anchor = 'w')

    cb = tkutil.checkbutton(self.top, 'Show assigned atoms?', 0)
    self.show_assigned = cb.variable
    cb.button.pack(side = 'top', anchor = 'w')
    cb.add_callback(pyutil.precompose(color_assigned_atoms, session))

    self.status_line = Tkinter.Label(self.top, anchor = 'nw')
    self.status_line.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'MidasPick')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    self.pick_cb = self.atom_pick_cb
    midas.process(self.session).add_atom_pick_callback(self.pick_cb)
Пример #14
0
    def __init__(self, session):
        """ Initialization
        """
        self.session = session
        tkutil.Dialog.__init__(self, session.tk, "Open & Reload Multiple Spectra")

        proj = session.project
        mfs = tkutil.multiple_file_selection(self.top, proj.sparky_directory)
        mfs.frame.pack(side="top", anchor="nw", fill="both", expand=1)
        self.files = mfs

        r = Tkinter.Label(self.top, justify="left")
        r.pack(side="top", anchor="nw")

        self.result = r
        br = tkutil.button_row(
            self.top,
            ("Open", self.open_cb),
            ("Reload", self.reload_spectra),
            ("Cancel", self.close_cb),
            ("Help", sputil.help_cb(session, "OpenAutoreloadSpectra")),
        )
        br.frame.pack(side="top", anchor="nw")

        self.paths = []  # list of spectrum files to open
        self.spectra = []  # spectra already opened

        # if there are opened windows, get the paths
        for v in proj.view_list():
            self.paths.append(v.spectrum.save_path)
            self.spectra.append(v.spectrum)
Пример #15
0
    def __init__(self, session):

        tkutil.Settings_Dialog.__init__(self, session.tk, 'Peak List Settings')

        fb = Tkinter.Frame(self.top, borderwidth=3, relief='groove')
        fb.pack(side='top', fill='x')

        #
        # Create the checkbutton and extra widgets for each possible field
        #
        self.field_widgets = {}
        for fc in field_classes:
            self.field_widgets[fc] = fc.field_widgets(self.top, fc.name)

        opt = Tkinter.Frame(self.top, borderwidth=3, relief='groove')
        opt.pack(side='top', fill='x')

        cb = tkutil.checkbutton(opt, 'Sort by assignment?', 1)
        self.assignmentsort = cb.variable
        cb.button.pack(side='top', anchor='w')

        cb = tkutil.checkbutton(opt, 'Pair crossdiagonal peaks?', 0)
        self.crosspair = cb.variable
        cb.button.pack(side='top', anchor='w')

        br = tkutil.button_row(
            self.top,
            ('Ok', self.ok_cb),
            ('Apply', self.apply_cb),
            ('Close', self.close_cb),
        )
        br.frame.pack(side='top', anchor='w')
Пример #16
0
    def __init__(self, session):

        self.session = session

        tkutil.Settings_Dialog.__init__(self, session.tk,
                                        'Assignment Graph Setup')

        sc = self.spectrum_choice_table(self.top)
        sc.pack(side='top', anchor='w')

        te = self.tolerance_entry(self.top)
        te.pack(side='top', anchor='w')

        progress_label = Tkinter.Label(self.top, anchor='nw')
        progress_label.pack(side='top', anchor='w')

        br = tkutil.button_row(
            self.top,
            ('Ok', self.ok_cb),
            ('Apply', self.apply_cb),
            ('Stop', self.stop_cb),
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'AssignGraph')),
        )
        br.frame.pack(side='top', anchor='w')

        tkutil.Stoppable.__init__(self, progress_label, br.buttons[2])
Пример #17
0
    def __init__(self, session):

        self.session = session
        self.peak = None

        tkutil.Dialog.__init__(self, session.tk, 'Peak Resonance Mover')

        self.spectrum_menu = sputil.spectrum_menu(session, self.top,
                                                  'Spectrum: ')
        self.spectrum_menu.frame.pack(side='top', anchor='w')

        cb = tkutil.checkbutton(self.top, 'On / Off', 0)
        cb.button.pack(side='top', anchor='w')
        cb.add_callback(self.onoff_cb)
        self.onoff = cb
        self.will_drag_notice = None
        self.dragged_notice = None

        self.message = Tkinter.Label(self.top)
        self.message.pack(side='top', anchor='w')

        br = tkutil.button_row(
            self.top,
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'ShiftRes')),
        )
        br.frame.pack(side='top', anchor='w')
Пример #18
0
    def __init__(self, session):

        self.session = session

        tkutil.Dialog.__init__(self, session.tk, 'Atom Name Translations')

        self.trans_name = tkutil.option_menu(self.top, 'Atom set: ', ())
        self.trans_name.frame.pack(side='top', anchor='w')
        self.trans_name.add_callback(self.show_translation_cb)

        st = tkutil.scrolling_list(self.top, 'Select applicable translations',
                                   5)
        st.frame.pack(side='top', anchor='w')
        st.listbox['selectmode'] = 'multiple'
        self.standard_trans = st

        for t in standard_translations():
            self.standard_trans.listbox.insert('end', t.name)

        self.bad_names = tkutil.scrolling_list(self.top, 'Non standard names',
                                               5)
        self.bad_names.frame.pack(side='top', anchor='w', fill='y', expand=1)

        br = tkutil.button_row(
            self.top,
            ('Update', self.update_cb),
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'AtomNameTrans')),
        )
        br.frame.pack(side='top', anchor='w')
Пример #19
0
    def __init__(self, session):

        self.session = session
        self.title = 'Peak List'
        self.spectrum = None
        self.peaks = ()
        self.settings = peak_list_settings()

        tkutil.Dialog.__init__(self, session.tk, self.title)

        pl = sputil.peak_listbox(self.top)
        pl.frame.pack(side='top', fill='both', expand=1)
        pl.listbox.bind('<ButtonRelease-1>', pl.select_peak_cb)
        pl.listbox.bind('<ButtonRelease-2>', pl.goto_peak_cb)
        pl.listbox.bind('<Double-ButtonRelease-1>', pl.goto_peak_cb)
        self.peak_list = pl

        progress_label = Tkinter.Label(self.top, anchor='nw')
        progress_label.pack(side='top', anchor='w')

        br = tkutil.button_row(
            self.top,
            ('Update', self.update_cb),
            ('Setup...', self.setup_cb),
            ('Save...', self.peak_list.save_cb),
            ('Stop', self.stop_cb),
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'PeakListPython')),
        )
        br.frame.pack(side='top', anchor='w')

        tkutil.Stoppable.__init__(self, progress_label, br.buttons[3])
Пример #20
0
  def __init__(self, session):

    self.session = session
    self.drag_notice = None
    
    tkutil.Dialog.__init__(self, session.tk, 'Region RMSD')

    self.top.columnconfigure(0, weight = 1)

    import Tkinter
    explain = ('Dragging a box calculates the mean and RMSD\n'
               'of data values for that spectrum region.')
    w = Tkinter.Label(self.top, text = explain, justify = 'left')
    w.grid(row = 0, column = 0, sticky = 'nw')

    r = Tkinter.Label(self.top, justify = 'left')
    r.grid(row = 1, column = 0, sticky = 'nw')
    self.result_label = r

    br = tkutil.button_row(self.top,
                           ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'RegionRMSD')),
			   )
    br.frame.grid(row = 2, column = 0, sticky = 'nw')

    self.register_callback(1)
    self.top.bind('<Map>', lambda e, s=self: s.register_callback(1))
    self.top.bind('<Unmap>', lambda e, s=self: s.register_callback(0))
Пример #21
0
  def __init__(self, session):

    self.session = session

    tkutil.Settings_Dialog.__init__(self, session.tk, 'Assignment Graph Setup')

    sc = self.spectrum_choice_table(self.top)
    sc.pack(side = 'top', anchor = 'w')

    te = self.tolerance_entry(self.top)
    te.pack(side = 'top', anchor = 'w')
    
    progress_label = Tkinter.Label(self.top, anchor = 'nw')
    progress_label.pack(side = 'top', anchor = 'w')
    
    br = tkutil.button_row(self.top,
                           ('Ok', self.ok_cb),
			   ('Apply', self.apply_cb),
                           ('Stop', self.stop_cb),
                           ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'AssignGraph')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[2])
Пример #22
0
  def __init__(self, session):

    self.session = session

    tkutil.Dialog.__init__(self, session.tk, 'ncIDP Repositioning Tool 1.2b/2nd DEC 2010')
    
    cm = sputil.condition_menu(session, self.top, 'Condition: ')
    cm.frame.pack(side = 'top', anchor = 'w')
    self.condition_menu = cm

    rr = tkutil.entry_row(self.top, 'Residues ',
                          ('from', '', 3), ('to', '', 3))
    self.range_variables = rr.variables
    rr.frame.pack(side = 'top', anchor = 'w')

    ol = tkutil.scrolling_list(self.top, '', 5)
    ol.frame.pack(side = 'top', fill = 'both', expand = 1)
    ol.listbox.bind('<ButtonRelease-1>', self.select_cb)
    self.offset_list = ol

    progress_label = Tkinter.Label(self.top, anchor = 'nw')
    progress_label.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
			   ('Positions', self.positions_cb),
			   ('Move', self.move_cb),
                           ('Shifts', self.shifts_cb),
			   ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'Reposition'))
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[3]) 
Пример #23
0
  def __init__(self, session):

    self.session = session
    
    tkutil.Dialog.__init__(self, session.tk, 'View Constraints')

    self.pdb_file = tkutil.file_field(self.top, 'PDB File: ', 'pdb')
    self.pdb_file.frame.pack(side = 'top', anchor = 'w')

    self.mardi_file = tkutil.file_field(self.top,
					'Mardigras Constraint File: ',
					'mardigras')
    self.mardi_file.frame.pack(side = 'top', anchor = 'w')

    cb = tkutil.checkbutton(self.top, 'Show satisfied constraints?', 0)
    self.satisfied = cb.variable
    cb.button.pack(side = 'top', anchor = 'w')

    cb = tkutil.checkbutton(self.top, 'Show violated constraints?', 1)
    self.violated = cb.variable
    cb.button.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
			   ('Show', self.show_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session,
                                                   'MidasConstraints')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')
Пример #24
0
  def __init__(self, session):

    tkutil.Dialog.__init__(self, session.tk, 'Read Peak List')

    plp = tkutil.file_field(self.top, 'Peak file: ', 'peaklist')
    plp.frame.pack(side = 'top', anchor = 'w')
    self.peak_list_path = plp
    
    sc = sputil.spectrum_menu(session, self.top, 'Spectrum: ')
    sc.frame.pack(side = 'top', anchor = 'w')
    self.spectrum_choice = sc

    sl = tkutil.scrolling_list(self.top, 'Unreadable lines', 5)
    sl.frame.pack(side = 'top', anchor = 'w', fill = 'both', expand = 1)
    self.unreadable = sl
    
    progress_label = Tkinter.Label(self.top, anchor = 'nw')
    progress_label.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
			   ('Create peaks', self.read_cb),
			   ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'ReadPeaks')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[1])
Пример #25
0
    def __init__(self, session):

        self.session = session

        tkutil.Dialog.__init__(self, session.tk, 'Pick Atoms')

        cb = tkutil.checkbutton(self.top, 'Show atom labels?', 0)
        self.show_label = cb.variable
        cb.button.pack(side='top', anchor='w')

        cb = tkutil.checkbutton(self.top, 'Show distances?', 0)
        self.show_distance = cb.variable
        cb.button.pack(side='top', anchor='w')

        cb = tkutil.checkbutton(self.top, 'Show peaks?', 0)
        self.show_peak = cb.variable
        cb.button.pack(side='top', anchor='w')

        cb = tkutil.checkbutton(self.top, 'Show assigned atoms?', 0)
        self.show_assigned = cb.variable
        cb.button.pack(side='top', anchor='w')
        cb.add_callback(pyutil.precompose(color_assigned_atoms, session))

        self.status_line = Tkinter.Label(self.top, anchor='nw')
        self.status_line.pack(side='top', anchor='w')

        br = tkutil.button_row(
            self.top,
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'MidasPick')),
        )
        br.frame.pack(side='top', anchor='w')

        self.pick_cb = self.atom_pick_cb
        midas.process(self.session).add_atom_pick_callback(self.pick_cb)
Пример #26
0
    def __init__(self, session, gid=None, group_editor=None):
        self.session = session
        self.gid = gid
        self.group_editor = group_editor

        tkutil.Dialog.__init__(self, session.tk, 'Group editor -- ???')

        e1 = tkutil.entry_field(self.top, 'GSS type:', '', 20)
        e1.frame.pack(side='top', anchor='w')
        self.aatype = e1.variable

        e2 = tkutil.entry_field(self.top, 'Next GSS:', '', 20)
        e2.frame.pack(side='top', anchor='w')
        self.next_ = e2.variable

        e3 = tkutil.entry_field(self.top, 'Residue:', '', 20)
        e3.frame.pack(side='top', anchor='w')
        self.residue = e3.variable

        br = tkutil.button_row(
            self.top,
            ('Apply', self.update),
            ('Merge resonances', self.merge_resonances),
            ('Close', self.close_cb),
        )
        br.frame.pack(side='top', anchor='w')
Пример #27
0
  def __init__(self, session):

    self.session = session
    
    tkutil.Dialog.__init__(self, session.tk, 'Atom Name Translations')

    self.trans_name = tkutil.option_menu(self.top, 'Atom set: ', ())
    self.trans_name.frame.pack(side = 'top', anchor = 'w')
    self.trans_name.add_callback(self.show_translation_cb)
      
    st = tkutil.scrolling_list(self.top, 'Select applicable translations', 5)
    st.frame.pack(side = 'top', anchor = 'w')
    st.listbox['selectmode'] = 'multiple'
    self.standard_trans = st
    
    for t in standard_translations():
      self.standard_trans.listbox.insert('end', t.name)

    self.bad_names = tkutil.scrolling_list(self.top, 'Non standard names', 5)
    self.bad_names.frame.pack(side = 'top', anchor = 'w',
                              fill = 'y', expand = 1)

    br = tkutil.button_row(self.top,
			   ('Update', self.update_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'AtomNameTrans')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')
Пример #28
0
  def __init__(self, session):

    tkutil.Settings_Dialog.__init__(self, session.tk, 'Relaxation Spectra')

    headings = ('Spectrum  ', 'Time parameter')
    st = sputil.spectrum_table(session, self.top, headings,
                               self.add_spectrum, self.remove_spectrum)
    st.frame.pack(side = 'top', anchor = 'w')
    self.spectrum_widgets = {}

    spectra = session.project.spectrum_list()
    def time_param(s, self=self):
      return pyutil.string_to_float(self.default_time_parameter(s), 0)
    spectra = pyutil.sort_by_function_value(spectra, time_param)
    for spectrum in spectra:
      st.add_spectrum(spectrum)

    e = tkutil.entry_field(self.top, 'Use ', '5', 3,
                           ' random trials for error estimates.')
    e.frame.pack(side = 'top', anchor = 'w')
    self.trials = e
    
    br = tkutil.button_row(self.top,
                           ('Ok', self.ok_cb),
                           ('Apply', self.apply_cb),                           
                           ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'RelaxFit')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')
Пример #29
0
	def __init__(self, session):
		self.session = session
		self.grid_widgets = []

		tkutil.Dialog.__init__(self, session.tk, 'Fit Delta-Chi Tensor to PCS')

		self.dia_menu = sputil.spectrum_menu(session, self.top, 'Diamagnetic Spectrum:  ')
		self.dia_menu.frame.pack(side = 'top', anchor = 'w')

		self.para_menu = sputil.spectrum_menu(session, self.top, 'Paramagnetic Spectrum: ')
		self.para_menu.frame.pack(side = 'top', anchor = 'w')

		self.npc_write_path = tkutil.file_field(self.top, 'PCS save file: ', '.npc', save=1)
		self.npc_write_path.frame.pack(side = 'top', anchor = 'e')
		self.npc_write_path.set("pcsexp.npc")

		self.npc_read_path = tkutil.file_field(self.top, 'PCS read file: ', '.npc')
		self.npc_read_path.frame.pack(side = 'top', anchor = 'e')
		self.npc_read_path.set("pcscalc.npc")

		self.message = Tkinter.Label(self.top)
		self.message.pack(side = 'top', anchor = 'w')
		self.message['text'] = "\n"

		br = tkutil.button_row(self.top,
			('Write PCS', self.write_npc_cb),
			('Read PCS', self.read_npc_cb),
			('Clear PCS', self.clear_peaks_cb),
			('Close', self.close_cb))
		br.frame.pack(side = 'top', anchor = 'w')
Пример #30
0
  def make_dialog(self):

    tkutil.Dialog.__init__(self, self.session.tk, 'Mirror Assignment Checker')

    self.top.bind('<Destroy>', self.window_destroyed_cb, 1)

    w = self.make_noesy_table(self.top)
    w.pack(side = 'top', anchor = 'w')

    choices = ('Selected peaks',
	       'Peaks with assigned mirror peak',
	       'Peaks without assigned mirror peak',
	       'Unassigned with assigned mirror',
	       )
    self.show_type = tkutil.option_menu(self.top, 'Show ',
                                        choices, choices[0])
    self.show_type.frame.pack(side = 'top', anchor = 'w')

    cb = tkutil.checkbutton(self.top,
                            'Exclude mirrors with low signal/noise?', 0)
    cb.button.pack(side = 'top', anchor = 'w')
    self.exclude_mirrors = cb

    f = Tkinter.Frame(self.top)
    cb.map_widget(f)
    
    e = tkutil.entry_field(f, 'C13 / N15 intensity ratio: ', '1', 3)
    self.c13_n15_factor = e.variable
    e.frame.pack(side = 'top', anchor = 'w')

    e = tkutil.entry_field(f, 'Minimum mirror intensity factor: ', '.5', 3)
    self.min_mirror_factor = e.variable
    e.frame.pack(side = 'top', anchor = 'w')

    pl = tkutil.scrolling_list(self.top, '', 5)
    pl.frame.pack(side = 'top', fill = 'both', expand = 1)
    pl.listbox.bind('<ButtonRelease-2>', self.select_peak_or_assignment_cb)
    pl.listbox.bind('<ButtonRelease-1>', self.goto_peak_or_assignment_cb)
    self.peak_list = pl

    progress_label = Tkinter.Label(self.top, anchor = 'nw')
    progress_label.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
			   ('Update', self.update_cb),
			   ('Strips', self.strips_cb),
			   ('Save', self.peak_list.save_cb),
			   ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(self.session,
                                                   'MirrorPeak')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[3])

    self.settings = self.get_settings()
Пример #31
0
    def __init__(self, session):

        self.session = session

        tkutil.Dialog.__init__(self, session.tk, 'Peak Linewidth Plot')

        self.top.columnconfigure(0, weight=1)
        r = 0

        sw = sputil.spectrum_menu(session, self.top, 'Spectrum: ')
        sw.frame.grid(row=r, sticky='w')
        r = r + 1
        self.spectrum_widget = sw

        af = tkutil.entry_field(self.top, 'Spectrum axis: ', '1', 3)
        af.frame.grid(row=r, sticky='w')
        r = r + 1
        self.axis_variable = af.variable

        self.lw_ranges = [None, None]
        er = tkutil.entry_row(self.top, 'Linewidth range (hz): ',
                              ('min', '0', 3), ('max', '50', 3),
                              ('step', '5', 3))
        (self.lw_ranges[0], self.lw_ranges[1], self.lw_step) = er.variables
        er.frame.grid(row=r, sticky='w')
        r = r + 1

        e = tkutil.entry_field(self.top, 'Atoms: ', '', 30)
        self.atoms = e.variable
        e.frame.grid(row=r, sticky='w')
        r = r + 1

        c = tkutil.scrollable_canvas(self.top)
        c.frame.grid(row=r, sticky='news')
        self.top.rowconfigure(r, weight=1)
        r = r + 1
        self.canvas = c.canvas

        progress_label = Tkinter.Label(self.top, anchor='nw')
        progress_label.grid(row=r, sticky='w')
        r = r + 1

        postscript_cb = pyutil.precompose(tkutil.postscript_cb, self.canvas)
        br = tkutil.button_row(
            self.top,
            ('Update', self.update_cb),
            ('Postscript', postscript_cb),
            ('Stop', self.stop_cb),
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'LinewidthPlot')),
        )
        br.frame.grid(row=r, sticky='w')
        r = r + 1

        tkutil.Stoppable.__init__(self, progress_label, br.buttons[2])
Пример #32
0
    def __init__(self, session):

        self.session = session
        tkutil.Dialog.__init__(self, session.tk, 'Chemical Shift Plot')

        self.top.columnconfigure(0, weight=1)
        r = 0

        self.condition_widget = sputil.condition_menu(session, self.top,
                                                      'Condition: ')
        self.condition_widget.frame.grid(row=r, sticky='w')
        r = r + 1

        self.ppm_range_widget = [None, None]
        er = tkutil.entry_row(self.top, 'PPM range: ', ('min', '0', 3),
                              ('max', '12', 3), ('step', '1', 3))
        (self.ppm_range_widget[0], self.ppm_range_widget[1],
         self.ppm_step_widget) = er.variables
        er.frame.grid(row=r, sticky='w')
        r = r + 1

        e = tkutil.entry_field(self.top, 'Atoms: ', '', 30)
        self.atoms = e.variable
        e.frame.grid(row=r, sticky='w')
        r = r + 1

        t = tkutil.checkbutton(self.top, 'Show typical amino acid shifts?', 0)
        self.typical_range = t.variable
        t.button.grid(row=r, sticky='w')
        r = r + 1

        c = tkutil.scrollable_canvas(self.top)
        c.frame.grid(row=r, sticky='news')
        self.top.rowconfigure(r, weight=1)
        r = r + 1
        self.canvas = c.canvas

        progress_label = Tkinter.Label(self.top, anchor='nw')
        progress_label.grid(row=r, sticky='w')
        r = r + 1

        postscript_cb = pyutil.precompose(tkutil.postscript_cb, self.canvas)
        br = tkutil.button_row(
            self.top,
            ('Update', self.update_cb),
            ('Postscript', postscript_cb),
            ('Stop', self.stop_cb),
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'ChemShiftPlot')),
        )
        br.frame.grid(row=r, sticky='w')
        r = r + 1

        tkutil.Stoppable.__init__(self, progress_label, br.buttons[2])
Пример #33
0
    def __init__(self, session):
        self.session = session
        self.title = 'Assign peaks into GSSs'

        tkutil.Dialog.__init__(self, session.tk, self.title)

        _spectrum_names = [sp.name for sp in model.spectra()]
        self.spec_from = m1 = tkutil.option_menu(
            self.top, 'Using selected peaks in spectrum:', _spectrum_names)
        m1.frame.pack(side='top', anchor='w')

        self.spec_to = m2 = tkutil.option_menu(
            self.top, 'Assign peaks to GSSs in spectrum:', _spectrum_names)
        m2.frame.pack(side='top', anchor='w')

        _d3 = [1, 2, 3]  # TODO do those values need to be strings?

        # matching dimension 1
        self.match1_from = m3 = tkutil.option_menu(
            self.top, 'Matching dimension 1: from:', _d3)
        m3.frame.pack(side='top', anchor='w')

        self.match1_to = m4 = tkutil.option_menu(self.top,
                                                 'Matching dimension 1: to:',
                                                 _d3)
        m4.frame.pack(side='top', anchor='w')

        self.tol1 = tkutil.entry_field(
            self.top, 'Matching dimension 1: tolerance (PPM):', '0.2', 20)
        self.tol1.frame.pack(side='top', anchor='w')

        # matching dimension 2
        self.match2_from = tkutil.option_menu(self.top,
                                              'Matching dimension 2: from:',
                                              _d3)
        self.match2_from.frame.pack(side='top', anchor='w')

        self.match2_to = tkutil.option_menu(self.top,
                                            'Matching dimension 2: to:', _d3)
        self.match2_to.frame.pack(side='top', anchor='w')

        self.tol2 = tkutil.entry_field(
            self.top, 'Matching dimension 2: tolerance (PPM):', '0.2', 20)
        self.tol2.frame.pack(side='top', anchor='w')

        # TODO check that the nuclei match
        # TODO are 2 matching dimensions enough?

        br = tkutil.button_row(
            self.top,
            ('Assign peaks', self.execute),
            ('Close', self.close_cb),
        )
        br.frame.pack(side='top', anchor='w')
Пример #34
0
 def CreateButtonList(self, parent):    
   self.br = tkutil.button_row(parent,
                          ('<<', self.FastPrev),
                          ('<', self.Prev),
                          ('>', self.Next),
                          ('>>', self.FastNext),
                          ('Update', self.UpdateDialog),         
                          ('Assign', self.Assign),         
                          ('UnAssign', self.UnAssign), 
                          ('Close', self.close_cb),    
                         )
   self.br.frame.pack(side = 'top', anchor = 'w')
Пример #35
0
  def __init__(self, session):

    self.session = session
    
    tkutil.Dialog.__init__(self, session.tk, 'Peak Linewidth Plot')

    self.top.columnconfigure(0, weight = 1)
    r = 0
    
    sw = sputil.spectrum_menu(session, self.top, 'Spectrum: ')
    sw.frame.grid(row = r, sticky = 'w')
    r = r + 1
    self.spectrum_widget = sw
    
    af = tkutil.entry_field(self.top, 'Spectrum axis: ', '1', 3)
    af.frame.grid(row = r, sticky = 'w')
    r = r + 1
    self.axis_variable = af.variable
    
    self.lw_ranges = [None, None]
    er = tkutil.entry_row(self.top, 'Linewidth range (hz): ',
                          ('min', '0', 3), ('max', '50', 3), ('step', '5', 3))
    (self.lw_ranges[0], self.lw_ranges[1], self.lw_step) = er.variables
    er.frame.grid(row = r, sticky = 'w')
    r = r + 1
    
    e = tkutil.entry_field(self.top, 'Atoms: ', '', 30)
    self.atoms = e.variable
    e.frame.grid(row = r, sticky = 'w')
    r = r + 1
    
    c = tkutil.scrollable_canvas(self.top)
    c.frame.grid(row = r, sticky = 'news')
    self.top.rowconfigure(r, weight = 1)
    r = r + 1
    self.canvas = c.canvas

    progress_label = Tkinter.Label(self.top, anchor = 'nw')
    progress_label.grid(row = r, sticky = 'w')
    r = r + 1
    
    postscript_cb = pyutil.precompose(tkutil.postscript_cb, self.canvas)
    br = tkutil.button_row(self.top,
			   ('Update', self.update_cb),
			   ('Postscript', postscript_cb),
			   ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'LinewidthPlot')),
			   )
    br.frame.grid(row = r, sticky = 'w')
    r = r + 1

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[2])
Пример #36
0
  def __init__(self, session):

    self.session = session
    tkutil.Dialog.__init__(self, session.tk, 'Chemical Shift Plot')

    self.top.columnconfigure(0, weight = 1)
    r = 0
    
    self.condition_widget = sputil.condition_menu(session, self.top, 'Condition: ')
    self.condition_widget.frame.grid(row = r, sticky = 'w')
    r = r + 1

    self.ppm_range_widget = [None, None]
    er = tkutil.entry_row(self.top, 'PPM range: ',
                          ('min', '0', 3), ('max', '12', 3), ('step', '1', 3))
    (self.ppm_range_widget[0],
     self.ppm_range_widget[1],
     self.ppm_step_widget) = er.variables
    er.frame.grid(row = r, sticky = 'w')
    r = r + 1
    
    e = tkutil.entry_field(self.top, 'Atoms: ', '', 30)
    self.atoms = e.variable
    e.frame.grid(row = r, sticky = 'w')
    r = r + 1
    
    t = tkutil.checkbutton(self.top, 'Show typical amino acid shifts?', 0)
    self.typical_range = t.variable
    t.button.grid(row = r, sticky = 'w')
    r = r + 1
    
    c = tkutil.scrollable_canvas(self.top)
    c.frame.grid(row = r, sticky = 'news')
    self.top.rowconfigure(r, weight = 1)
    r = r + 1
    self.canvas = c.canvas

    progress_label = Tkinter.Label(self.top, anchor = 'nw')
    progress_label.grid(row = r, sticky = 'w')
    r = r + 1
    
    postscript_cb = pyutil.precompose(tkutil.postscript_cb, self.canvas)
    br = tkutil.button_row(self.top,
			   ('Update', self.update_cb),
			   ('Postscript', postscript_cb),
			   ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'ChemShiftPlot')),
			   )
    br.frame.grid(row = r, sticky = 'w')
    r = r + 1

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[2])
Пример #37
0
    def __init__(self, session):

        self.session = session

        tkutil.Dialog.__init__(self, session.tk, 'Peak Table')

        setup = Tkinter.Frame(self.top)
        setup.pack(side='top', anchor='w')

        # Choose Spectra

        sbutton = tkutil.checkbutton(self.top, 'Choose Spectra', 1)
        sbutton.button.pack(side='top', anchor='w')

        schoice = Tkinter.Frame(self.top)
        schoice.pack(side='top', anchor='w')

        sc = sputil.spectrum_checkbuttons(session, schoice, '')
        sc.frame.pack(side='top', anchor='w')
        self.spectrum_list = sc.chosen_spectra

        cb = tkutil.checkbutton(schoice, 'Noesy format?', 0)
        self.noesy_format = cb.variable
        cb.button.pack(side='top', anchor='w')

        sbutton.map_widget(schoice)

        # Peak list

        pl = sputil.assignment_listbox(session, self.top)
        pl.frame.pack(side='top', fill='both', expand=1)
        pl.listbox.bind('<ButtonRelease-1>', self.select_assignment_cb)
        pl.listbox.bind('<ButtonRelease-2>', self.goto_assignment_cb)
        pl.listbox.bind('<Double-ButtonRelease-1>', self.goto_assignment_cb)
        self.peak_list = pl

        progress_label = Tkinter.Label(self.top, anchor='nw')
        progress_label.pack(side='top', anchor='w')

        br = tkutil.button_row(
            self.top,
            ('Update', self.update_cb),
            ('Save', self.peak_list.save_cb),
            ('Stop', self.stop_cb),
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'PeakTable')),
        )
        br.frame.pack(side='top', anchor='w')

        tkutil.Stoppable.__init__(self, progress_label, br.buttons[2])
Пример #38
0
  def __init__(self, session):

    self.session = session
    
    tkutil.Dialog.__init__(self, session.tk, 'Peak Table')

    setup = Tkinter.Frame(self.top)
    setup.pack(side = 'top', anchor = 'w')

    # Choose Spectra

    sbutton = tkutil.checkbutton(self.top, 'Choose Spectra', 1)
    sbutton.button.pack(side = 'top', anchor = 'w')

    schoice = Tkinter.Frame(self.top)
    schoice.pack(side = 'top', anchor = 'w')

    sc = sputil.spectrum_checkbuttons(session, schoice, '')
    sc.frame.pack(side = 'top', anchor = 'w')
    self.spectrum_list = sc.chosen_spectra

    cb = tkutil.checkbutton(schoice, 'Noesy format?', 0)
    self.noesy_format = cb.variable
    cb.button.pack(side = 'top', anchor = 'w')

    sbutton.map_widget(schoice)

    # Peak list

    pl = sputil.assignment_listbox(session, self.top)
    pl.frame.pack(side = 'top', fill = 'both', expand = 1)
    pl.listbox.bind('<ButtonRelease-1>', self.select_assignment_cb)
    pl.listbox.bind('<ButtonRelease-2>', self.goto_assignment_cb)
    pl.listbox.bind('<Double-ButtonRelease-1>', self.goto_assignment_cb)
    self.peak_list = pl

    progress_label = Tkinter.Label(self.top, anchor = 'nw')
    progress_label.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
			   ('Update', self.update_cb),
			   ('Save', self.peak_list.save_cb),
			   ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'PeakTable')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[2])
Пример #39
0
  def __init__(self, session):

    self.molecule = None
    
    tkutil.Dialog.__init__(self, session.tk, 'Sequence Entry')

    se = self.sequence_entry(self.top)
    se.pack(side = 'top', anchor = 'w', fill = 'x', expand = 1)

    br = tkutil.button_row(self.top,
			   ('Ok', self.ok_cb),
                           ('Cancel', self.close_cb),
                           ('Help', sputil.help_cb(session, 'Sequence')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')
Пример #40
0
  def __init__(self, session):

    tkutil.Settings_Dialog.__init__(self, session.tk,
                                    'Python Shell Preferences')

    cb = tkutil.checkbutton(self.top, 'Show Python shell if error occurs?', 1)
    cb.button.pack(side = 'top', anchor = 'nw')
    self.raise_variable = cb.variable

    br = tkutil.button_row(self.top,
                           ('Ok', self.ok_cb),
                           ('Apply', self.apply_cb),
                           ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'PythonShell')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')
Пример #41
0
 def __init__(self, session, gid=None, rid=None, group_editor=None):
     self.gid = gid
     self.rid = rid
     self.group_editor = group_editor
     
     tkutil.Dialog.__init__(self, session.tk, 'Resonance editor --- ???')
     
     e1 = tkutil.entry_field(self.top, 'Atom type:', '', 20)
     e1.frame.pack(side='top', anchor='w')
     self.atomtype = e1.variable
 
     br = tkutil.button_row(self.top,
                 ('Apply', self.update),
                 ('Close', self.close_cb),
                 )
     br.frame.pack(side = 'top', anchor = 'w')
Пример #42
0
    def __init__(self, session):
        self.g = GitRepo(model.project().sparky_directory)
        
        self.session = session
        self.title = 'Reproducibility'
        
        tkutil.Dialog.__init__(self, session.tk, self.title)
        
        br = tkutil.button_row(self.top, ('Make snapshot', self.make_snapshot))
        br.frame.pack(side='top', anchor='w')
        # TODO would like to get an enumerated list of these from somewhere
        e = tkutil.entry_field(self.top, 'Deductive reason used:', '<enter reason>', 50)
        e.frame.pack(side='top', anchor='w')
        self.message = e.variable

        br2 = tkutil.button_row(self.top, ('Set groups of selected peaks', self.set_group))
        br2.frame.pack(side = 'top', anchor = 'w')
        e2 = tkutil.entry_field(self.top, 'Group name:', '', 20, '(leave blank for name to be autogenerated)')
        e2.frame.pack(side = 'top', anchor = 'w')
        self.group = e2.variable

        br4 = tkutil.button_row(self.top, ('Create new group for peak', self.create_new_group))
        br4.frame.pack(side = 'top', anchor = 'w')

        br5 = tkutil.button_row(self.top, ('Set selected peaks to noise', self.set_noise))
        br5.frame.pack(side = 'top', anchor = 'w')

        br6 = tkutil.button_row(self.top, ('Set selected peaks to artifact', self.set_artifact))
        br6.frame.pack(side = 'top', anchor = 'w')
        
        self.peaktype_spectrum = m1 = tkutil.option_menu(self.top, 'Select peaktype spectrum', peaktypes.spectra.keys())
        m1.frame.pack(side='top', anchor='w')
        m1.add_callback(self.set_peaktype_spectrum)
        
        self.peaktype_dim_order = m3 = tkutil.option_menu(self.top, 'Peaktype dimension order', [])
        self.dim_order = ','.join(map(str, peaktypes.orders[1][0]))
        m3.frame.pack(side='top', anchor='w')
        m3.add_callback(self.set_peaktype_dim_order)
        
        self.peaktype = m2 = tkutil.option_menu(self.top, 'Assign peaktype', [])
        m2.frame.pack(side='top', anchor='w')
        m2.add_callback(self.assign_peaktype)

        _spectrum_names = [sp.name for sp in model.spectra()]
        self.select_signal_peaks_menu = m4 = tkutil.option_menu(self.top, 'Select signal peaks', _spectrum_names)
        m4.frame.pack(side='top', anchor='w')
        m4.add_callback(self.select_signal_peaks)

        self.changed_callback = model.session().notify_me('selection changed', self.selection_changed)
    
        br = tkutil.button_row(self.top,
                    ('Open peak-GSS dialog', self.peaks_to_gss),
                    ('Close', self.close_cb),
                    )
        br.frame.pack(side = 'top', anchor = 'w')
Пример #43
0
    def __init__(self, session):
        self.session = session
        self.grid_widgets = []

        tkutil.Dialog.__init__(self, session.tk, 'Read and write PCS values')
        acqu_template = [("T{}-:".format(i + 1), "0.0", 6) for i in range(3)]

        self.dia_menu = sputil.spectrum_menu(session, self.top,
                                             'Diamagnetic Spectrum:  ')
        self.dia_menu.frame.pack(side='top', anchor='w')
        self.dia_menu.add_callback(self.dia_spec_change)
        self.dia_acqu = tkutil.entry_row(self.top, "Acqu Time:",
                                         *acqu_template)
        self.dia_acqu.frame.pack(side='top', anchor='w')

        self.para_menu = sputil.spectrum_menu(session, self.top,
                                              'Paramagnetic Spectrum: ')
        self.para_menu.frame.pack(side='top', anchor='w')
        self.para_menu.add_callback(self.para_spec_change)
        self.para_acqu = tkutil.entry_row(self.top, "Acqu Time:",
                                          *acqu_template)
        self.para_acqu.frame.pack(side='top', anchor='w')

        self.npc_write_path = tkutil.file_field(self.top,
                                                'PCS save file: ',
                                                '.npc',
                                                save=1)
        self.npc_write_path.frame.pack(side='top', anchor='e')
        self.npc_write_path.set("pcsexp.npc")

        self.npc_read_path = tkutil.file_field(self.top, 'PCS read file: ',
                                               '.npc')
        self.npc_read_path.frame.pack(side='top', anchor='e')
        self.npc_read_path.set("pcscalc.npc")

        self.message = Tkinter.Label(self.top)
        self.message.pack(side='top', anchor='w')
        self.message['text'] = "\n"

        br = tkutil.button_row(self.top, ('Write PCS', self.write_npc_cb),
                               ('Read PCS', self.read_npc_cb),
                               ('Clear PCS', self.clear_peaks_cb),
                               ('Close', self.close_cb))
        br.frame.pack(side='top', anchor='w')

        self.dia_spec_change()
        self.para_spec_change()
Пример #44
0
  def __init__(self, session):

    tkutil.Dialog.__init__(self, session.tk, 'MARDIGRAS Format')

    sc = sputil.spectrum_menu(session, self.top, 'Spectrum: ')
    sc.frame.pack(side = 'top', anchor = 'w')
    self.spectrum_choice = sc

    pl = sputil.peak_listbox(self.top)
    pl.frame.pack(fill = 'both', expand = 1)
    pl.heading['text'] = 'Peak list'
    pl.listbox.bind('<ButtonRelease-1>', pl.select_peak_cb)
    pl.listbox.bind('<ButtonRelease-2>', pl.goto_peak_cb)
    pl.listbox.bind('<Double-ButtonRelease-1>', pl.goto_peak_cb)
    self.peak_list = pl

    ib = tkutil.checkbutton(self.top, 'Include unintegrated peaks?', 0)
    ib.button.pack(side = 'top', anchor = 'w')
    self.unintegrated = ib

    nb = tkutil.checkbutton(self.top, 'Show peak notes?', 0)
    nb.button.pack(side = 'top', anchor = 'w')
    self.note = nb

    eh = Tkinter.Label(self.top, text = 'Omit peak if note has a word from:')
    eh.pack(side = 'top', anchor = 'w')
    ef = tkutil.entry_field(self.top, '  ', width = 30)
    ef.frame.pack(side = 'top', anchor = 'w')
    self.note_words = ef
    et = Tkinter.Label(self.top, text = '(space separated list of words)')
    et.pack(side = 'top', anchor = 'w')
    
    progress_label = Tkinter.Label(self.top, anchor = 'nw')
    progress_label.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
                           ('Update', self.update_cb),
                           ('Write Peaks', self.save_peaks_cb),
                           ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session,
                                                   'MardigrasFormat')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[2])
Пример #45
0
  def __init__(self, session):

    self.spectrum = None
    self.heavy_axis = None
    
    tkutil.Dialog.__init__(self, session.tk, 'Attached Proton')

    am = tkutil.option_menu(self.top, 'Attached proton axis: ', ())
    am.frame.pack(side = 'top')
    self.axis_menu = am

    br = tkutil.button_row(self.top,
			   ('Ok', self.ok_cb),
                           ('Cancel', self.close_cb),
                           ('Help', sputil.help_cb(session, 'LabelledAxis')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')
Пример #46
0
  def __init__(self, session):

    self.session = session
    self.selection_notice = None

    tkutil.Dialog.__init__(self, session.tk, 'Read Cyana peak list')

    tspectra=('2D','3D')
    initial=tspectra[0]
    self.spectratype = tkutil.option_menu(self.top, "Select spectra dimension", tspectra, initial)
    self.spectratype.frame.pack(side = 'top', anchor = 'w')

    order=('xy','yx','xyz','xzy','yxz','yzx','zxy','zyx')
    initial=order[0]

    self.order = tkutil.option_menu(self.top, "Select output order", order, initial)
    self.order.frame.pack(side = 'top', anchor = 'w')    

    self.plp = tkutil.file_field(self.top, 'Cyana output peak file: ', 'peaklist')
    self.plp.frame.pack(side = 'top', anchor = 'e')
    self.peak_list_path = self.plp
    
    self.pl = tkutil.file_field(self.top,   'Cyana output proton file:', 'protlist')
    self.pl.frame.pack(side = 'top', anchor = 'e')
    self.proton_list_path = self.pl

    self.sl = tkutil.file_field(self.top,   'Sequence file: ', 'seqlist')
    self.sl.frame.pack(side = 'top', anchor = 'e')
    self.sequence_list_path = self.sl

    sc = sputil.spectrum_menu(session, self.top, 'Spectrum: ')
    sc.frame.pack(side = 'top', anchor = 'w')
    self.spectrum_choice = sc

    progress_label = Tkinter.Label(self.top, anchor = 'nw')
    progress_label.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
			   ('Create peaks', self.read_cb),
			   ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'ReadPeaks')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[1])
Пример #47
0
    def __init__(self, session):

        tkutil.Dialog.__init__(self, session.tk, 'MARDIGRAS Format')

        sc = sputil.spectrum_menu(session, self.top, 'Spectrum: ')
        sc.frame.pack(side='top', anchor='w')
        self.spectrum_choice = sc

        pl = sputil.peak_listbox(self.top)
        pl.frame.pack(fill='both', expand=1)
        pl.heading['text'] = 'Peak list'
        pl.listbox.bind('<ButtonRelease-1>', pl.select_peak_cb)
        pl.listbox.bind('<ButtonRelease-2>', pl.goto_peak_cb)
        pl.listbox.bind('<Double-ButtonRelease-1>', pl.goto_peak_cb)
        self.peak_list = pl

        ib = tkutil.checkbutton(self.top, 'Include unintegrated peaks?', 0)
        ib.button.pack(side='top', anchor='w')
        self.unintegrated = ib

        nb = tkutil.checkbutton(self.top, 'Show peak notes?', 0)
        nb.button.pack(side='top', anchor='w')
        self.note = nb

        eh = Tkinter.Label(self.top, text='Omit peak if note has a word from:')
        eh.pack(side='top', anchor='w')
        ef = tkutil.entry_field(self.top, '  ', width=30)
        ef.frame.pack(side='top', anchor='w')
        self.note_words = ef
        et = Tkinter.Label(self.top, text='(space separated list of words)')
        et.pack(side='top', anchor='w')

        progress_label = Tkinter.Label(self.top, anchor='nw')
        progress_label.pack(side='top', anchor='w')

        br = tkutil.button_row(
            self.top,
            ('Update', self.update_cb),
            ('Write Peaks', self.save_peaks_cb),
            ('Stop', self.stop_cb),
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'MardigrasFormat')),
        )
        br.frame.pack(side='top', anchor='w')

        tkutil.Stoppable.__init__(self, progress_label, br.buttons[2])
Пример #48
0
    def __init__(self, session, gid=None, rid=None, group_editor=None):
        self.gid = gid
        self.rid = rid
        self.group_editor = group_editor

        tkutil.Dialog.__init__(self, session.tk, 'Resonance editor --- ???')

        e1 = tkutil.entry_field(self.top, 'Atom type:', '', 20)
        e1.frame.pack(side='top', anchor='w')
        self.atomtype = e1.variable

        br = tkutil.button_row(
            self.top,
            ('Apply', self.update),
            ('Close', self.close_cb),
        )
        br.frame.pack(side='top', anchor='w')
Пример #49
0
    def __init__(self, session):

        self.session = session

        tkutil.Dialog.__init__(self, session.tk, 'Restricted Peak Pick')

        m = sputil.view_menu(session, self.top, 'Find peaks in ')
        m.frame.pack(side='top', anchor='w')
        m.add_callback(self.chose_spectrum_cb)
        self.pick_menu = m

        m = sputil.spectrum_menu(session, self.top, 'Using peaks in ')
        m.frame.pack(side='top', anchor='w')
        m.add_callback(self.chose_spectrum_cb)
        self.ref_menu = m

        b = tkutil.checkbutton(self.top, 'Use selected peaks only?', 0)
        b.button.pack(side='top', anchor='w')
        self.selected_only = b

        lbl = Tkinter.Label(self.top, text='Axis match tolerances (ppm)')
        lbl.pack(side='top', anchor='w')
        self.axis_table_heading = lbl

        f = Tkinter.Frame(self.top)
        f.pack(side='top', anchor='w')
        self.axis_table = f
        self.range_entries = []

        self.setup_axis_table()

        progress_label = Tkinter.Label(self.top, anchor='nw')
        progress_label.pack(side='top', anchor='w')

        br = tkutil.button_row(
            self.top,
            ('Pick peaks', self.pick_cb),
            ('Select peaks', self.select_cb),
            ('Stop', self.stop_cb),
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'RestrictedPick')),
        )
        br.frame.pack(side='top', anchor='w')

        tkutil.Stoppable.__init__(self, progress_label, br.buttons[2])
Пример #50
0
 def __init__(self, session, gid=None, group_editor=None):
     self.session = session
     self.gid = gid
     self.group_editor = group_editor
     
     tkutil.Dialog.__init__(self, session.tk, 'merge resonances -- ???')
     
     self.rid1 = m1 = tkutil.option_menu(self.top, 'Resonance 1', [])
     m1.frame.pack(side='top', anchor='w')
     
     self.rid2 = m2 = tkutil.option_menu(self.top, 'Resonance 2', [])
     m2.frame.pack(side='top', anchor='w')
 
     br = tkutil.button_row(self.top,
                 ('Merge', self.merge_resonances),
                 ('Close', self.close_cb),
                 )
     br.frame.pack(side = 'top', anchor = 'w')
Пример #51
0
    def __init__(self, session):

        tkutil.Settings_Dialog.__init__(self, session.tk,
                                        'Python Shell Preferences')

        cb = tkutil.checkbutton(self.top, 'Show Python shell if error occurs?',
                                1)
        cb.button.pack(side='top', anchor='nw')
        self.raise_variable = cb.variable

        br = tkutil.button_row(
            self.top,
            ('Ok', self.ok_cb),
            ('Apply', self.apply_cb),
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'PythonShell')),
        )
        br.frame.pack(side='top', anchor='w')
Пример #52
0
    def __init__(self, session, num_range):

        self.session = session

        tkutil.Dialog.__init__(self, session.tk, 'Noesy Assignment Diagram')

        c = Tkinter.Canvas(self.top, width=700, height=700)
        c.pack(fill='both', expand=1)
        self.canvas = c

        br = tkutil.button_row(
            self.top,
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'NoesyAssign')),
        )
        br.frame.pack(side='top', anchor='w')

        self.draw_circle(num_range)
Пример #53
0
  def __init__(self, session):

    self.session = session
    
    tkutil.Dialog.__init__(self, session.tk, 'Restricted Peak Pick')
    
    m = sputil.view_menu(session, self.top, 'Find peaks in ')
    m.frame.pack(side = 'top', anchor = 'w')
    m.add_callback(self.chose_spectrum_cb)
    self.pick_menu = m

    m = sputil.spectrum_menu(session, self.top, 'Using peaks in ')
    m.frame.pack(side = 'top', anchor = 'w')
    m.add_callback(self.chose_spectrum_cb)
    self.ref_menu = m

    b = tkutil.checkbutton(self.top, 'Use selected peaks only?', 0)
    b.button.pack(side = 'top', anchor = 'w')
    self.selected_only = b

    lbl= Tkinter.Label(self.top, text = 'Axis match tolerances (ppm)')
    lbl.pack(side = 'top', anchor = 'w')
    self.axis_table_heading = lbl
    
    f = Tkinter.Frame(self.top)
    f.pack(side = 'top', anchor = 'w')
    self.axis_table = f
    self.range_entries = []
    
    self.setup_axis_table()

    progress_label = Tkinter.Label(self.top, anchor = 'nw')
    progress_label.pack(side = 'top', anchor = 'w')

    br = tkutil.button_row(self.top,
			   ('Pick peaks', self.pick_cb),
                           ('Select peaks', self.select_cb),
			   ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'RestrictedPick')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[2])
Пример #54
0
    def __init__(self, session):
        tkutil.Dialog.__init__(self, session.tk, 'Connect Ponderosa Analyzer')

        cnt = tkutil.file_field(self.top, 'Connect file (sparky.cnt): ',
                                'Connect file')
        cnt.frame.pack(side='top', anchor='w')
        self.cnt_path = cnt
        szCnt = os.getcwd() + os.sep + "sparky.cnt"
        if os.path.isfile(szCnt):
            self.cnt_path.set(szCnt)

        spec1 = sputil.spectrum_menu(session, self.top, '15N-NOESY: ')
        spec1.frame.pack(side='top', anchor='w')
        self.nnoe = spec1

        spec2 = sputil.spectrum_menu(session, self.top, '13C-NOESY(ali-): ')
        spec2.frame.pack(side='top', anchor='w')
        self.cnoe = spec2

        spec3 = sputil.spectrum_menu(session, self.top, '13C-NOESY(aro-): ')
        spec3.frame.pack(side='top', anchor='w')
        self.aronoe = spec3

        self.n15_ppms = []  # w1, w2, w3 chemical shifts
        self.c15_ppms = []  # w1, w2, w3 chemical shifts

        self.br = tkutil.button_row(
            self.top,
            ('Update', self.update_cb),
            ('Move(15N-)', self.move_n_cb),
            ('Move(13C-)', self.move_c_cb),
            ('Close', self.close_cb),
        )
        self.br.frame.pack(side='top', anchor='w')

        self.label_frame = Tkinter.Frame(self.top, width=500, height=100)
        self.label_frame.pack(side='top', anchor='nw')

        ll = modified_listbox(self.label_frame, 'Label List', 49, 8, "single")
        ll.listbox.bind('<Double-ButtonRelease-1>', self.move_to_selected_cb)
        ll.listbox.bind('<ButtonRelease-3>', self.move_to_selected_cb)
        self.label_list = ll
        self.label_list.frame.grid(sticky='news')