Beispiel #1
0
  def noesy_table_row(self, table, row, atom_name):

    t = Tkinter.Label(table, text = atom_name + ' ')
    t.grid(row = row, column = 0)

    spectrum = sputil.spectrum_menu(self.session, table,
                                    '', allow_no_choice = 1)
    spectrum.frame.grid(row = row, column = 1)

    ppm_range = []
    for a in range(3):
      v = Tkinter.StringVar(table)
      v.set('.02')
      e = Tkinter.Entry(table, textvariable = v, width = 5)
      e.grid(row = row, column = 2 + a)
      ppm_range.append(v)

    spectra = self.session.project.spectrum_list()
    s = noesy.noesy_hsqc_spectrum(spectra, atom_name)
    if s:
      spectrum.set(s.name)
      heavy_axis = axes.unique_nucleus_axis(s, atom_name)
      ppm_range[heavy_axis].set('.2')

    return spectrum, ppm_range
Beispiel #2
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])
Beispiel #3
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')
Beispiel #4
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])
  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')
  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])
Beispiel #7
0
  def __init__(self, session):

    self.session = session
    
    tkutil.Dialog.__init__(self, session.tk, 'Align Spectrum')
    
    m = sputil.spectrum_menu(session, self.top, 'Align spectrum ')
    m.frame.pack(side = 'top', anchor = 'w')
    m.add_callback(self.chose_spectrum_cb)
    self.align_menu = m
    
    m = sputil.spectrum_menu(session, self.top, 'using peak in ')
    m.frame.pack(side = 'top', anchor = 'w')
    m.add_callback(self.chose_spectrum_cb)
    self.ref_menu = m

    lbl = Tkinter.Label(self.top, text = 'Match axes')
    lbl.pack(side = 'top', anchor = 'w')
    
    f = Tkinter.Frame(self.top)
    f.pack(side = 'top', anchor = 'w')
    self.axis_table = f
    self.axis_menus = []

    self.setup_axis_table()

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

    br = tkutil.button_row(self.top,
			   ('Align', self.align_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'AlignSpectrum')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')
    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])
Beispiel #9
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])
Beispiel #10
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])
    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])
  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])
Beispiel #13
0
  def __init__(self, session):

    self.session = session
    
    tkutil.Dialog.__init__(self, session.tk, 'Create Corma Spectrum')

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

    ms = tkutil.entry_row(self.top, 'Matrix size: ',
                          ('w1', '0', 5), ('w2', '0', 5))
    ms.frame.pack(side = 'top', anchor = 'w')
    self.matrix_size = ms

    lw = tkutil.entry_row(self.top, 'Default linewidth (hz): ',
                          ('w1', '0', 5), ('w2', '0', 5))
    lw.frame.pack(side = 'top', anchor = 'w')
    self.default_linewidth = lw

    cp = tkutil.file_field(self.top, 'Corma file: ', 'corma')
    cp.frame.pack(side = 'top', anchor = 'w')
    self.corma_path = cp

    sp = tkutil.file_field(self.top, 'Save in file: ', 'spectrum', save = 1)
    sp.frame.pack(side = 'top', anchor = 'w')
    self.save_path = sp
    
    progress_label = Tkinter.Label(self.top, anchor = 'nw', justify = 'left')
    progress_label.pack(side = 'top', anchor = 'w')
    
    self.spectrum_cb(self.spectrum_menu.get())

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

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[1])
Beispiel #14
0
    def __init__(self, session):

        self.session = session

        tkutil.Dialog.__init__(self, session.tk, 'Possible Noesy Assignments')

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

        er = tkutil.entry_row(self.top, 'PPM tolerance: ', ('w1', '.01', 4),
                              ('w2', '.01', 4), ('w3', '.01', 4))
        self.ppm_range = er.variables
        self.w3_range_widget = er.entries[2].frame
        er.frame.pack(side='top', anchor='w')

        self.spectrum_cb(self.spectrum_choice.get())

        t = tkutil.scrolling_text(self.top, height=32, width=60)
        t.frame.pack(side='top', anchor='nw', fill='both', expand=1)
        t.text['wrap'] = 'none'
        self.text = t.text

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

        br = tkutil.button_row(
            self.top,
            ('Update', self.update_cb),
            ('Diagram', self.diagram_cb),
            ('Stop', self.stop_cb),
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'NoesyAssign')),
        )
        br.frame.pack(side='top', anchor='w')

        tkutil.Stoppable.__init__(self, progress_label, br.buttons[2])
  def spectrum_choice_table(self, parent):

    f = Tkinter.Frame(parent, borderwidth = 5)

    self.type_to_spectrum_menu = {}
    self.type_to_phase = {}

    count = 0
    entries_per_column = 5
    row = 1
    column = 0
    for type in spectrum_types:

      column = 4 * (count / entries_per_column)
      row = 1 + (count % entries_per_column)
      
      if row == 1:
        lbl = Tkinter.Label(f, text = '  ')
        lbl.grid(row = 0, column = column)
        lbl = Tkinter.Label(f, text = 'Spectrum')
        lbl.grid(row = 0, column = column + 2)
        lbl = Tkinter.Label(f, text = 'Phase')
        lbl.grid(row = 0, column = column + 3)

      lbl = Tkinter.Label(f, text = type)
      lbl.grid(row = row, column = column + 1, sticky = 'w')

      m = sputil.spectrum_menu(self.sparky_session, f, '', allow_no_choice = 1)
      m.frame.grid(row = row, column = column + 2, sticky = 'w')
      self.type_to_spectrum_menu[type] = m

      p = tkutil.entry_field(f, '', width = 6)
      p.frame.grid(row = row, column = column + 3, sticky = 'w')
      self.type_to_phase[type] = p.variable
      
      count = count + 1

    return f
    def __init__(self, session):

        self.session = session
        self.selection_notice = None

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

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

        self.pdb_paths = tkutil.file_choices(self.top, 'PDB files: ', 'pdb')
        self.pdb_paths.frame.pack(side='top', anchor='w', fill='x')

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

        er = tkutil.entry_row(self.top, 'PPM tolerance: ', ('w1', '.01', 4),
                              ('w2', '.01', 4), ('w3', '.01', 4))
        self.ppm_range = er.variables
        self.w3_range_widget = er.entries[2].frame
        er.frame.pack(side='top', anchor='w')

        self.line_format = '%15s %s %7s %s'

        self.spectrum_cb(self.spectrum_choice.get())

        e = tkutil.entry_field(self.top, 'Max atom distance: ', '', 5)
        self.max_dist = e.variable
        e.frame.pack(side='top', anchor='w')

        tchoices = ('Assignments with far atoms',
                    'Peaks with multiple assignments',
                    'Close atoms with no peak',
                    'Assignments for unassigned peaks', 'Unassignable peaks',
                    'Assignments for selected peaks')
        initial = tchoices[5]
        self.show_type = tkutil.option_menu(self.top, 'Show: ', tchoices,
                                            initial)
        self.show_type.frame.pack(side='top', anchor='w')

        dchoices = ('shortest', 'all', 'min, ave, max')
        self.show_dist = tkutil.option_menu(self.top, 'Show model distances: ',
                                            dchoices)
        self.show_dist.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-1>', self.select_peak_or_assignment_cb)
        pl.listbox.bind('<ButtonRelease-2>', self.goto_peak_or_assignment_cb)
        pl.listbox.bind('<Double-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='nw')

        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, 'AssignmentDistance')),
        )
        br.frame.pack(side='top', anchor='w')

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

        self.settings = self.get_settings()
Beispiel #17
0
  def __init__(self, session):

    self.session = session
    self.selection_notice = None

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

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

    self.pdb_paths = tkutil.file_choices(self.top, 'PDB files: ', 'pdb')
    self.pdb_paths.frame.pack(side = 'top', anchor = 'w', fill = 'x')

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

    er = tkutil.entry_row(self.top, 'PPM tolerance: ',
		       ('w1', '.01', 4), ('w2', '.01', 4), ('w3', '.01', 4))
    self.ppm_range = er.variables
    self.w3_range_widget = er.entries[2].frame
    er.frame.pack(side = 'top', anchor = 'w')

    self.line_format = '%15s %s %7s %s'

    self.spectrum_cb(self.spectrum_choice.get())

    e = tkutil.entry_field(self.top, 'Max atom distance: ', '', 5)
    self.max_dist = e.variable
    e.frame.pack(side = 'top', anchor = 'w')

    tchoices = ('Assignments with far atoms',
	       'Peaks with multiple assignments',
	       'Close atoms with no peak',
	       'Assignments for unassigned peaks',
	       'Unassignable peaks',
	       'Assignments for selected peaks')
    initial = tchoices[5]
    self.show_type = tkutil.option_menu(self.top, 'Show: ', tchoices, initial)
    self.show_type.frame.pack(side = 'top', anchor = 'w')

    dchoices = ('shortest', 'all', 'min, ave, max')
    self.show_dist = tkutil.option_menu(self.top, 'Show model distances: ', dchoices)
    self.show_dist.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-1>', self.select_peak_or_assignment_cb)
    pl.listbox.bind('<ButtonRelease-2>', self.goto_peak_or_assignment_cb)
    pl.listbox.bind('<Double-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 = 'nw')

    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,
                                                   'AssignmentDistance')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

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

    self.settings = self.get_settings()
Beispiel #18
0
  def __init__(self, session):

    self.session = session
    
    tkutil.Dialog.__init__(self, session.tk, 'DYANA / XEASY Format')

    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, 'Chemical shift list', 5)
    sl.frame.pack(fill = 'both', expand = 1)
    sl.listbox.bind('<ButtonRelease-1>', self.resonance_cb)
    self.shift_list = sl

    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

    cy = tkutil.checkbutton(self.top, 'Cyana Formatting ?', 0)
    cy.button.pack(side = 'top', anchor = 'w')
    self.cyana = cy

    hb = tkutil.checkbutton(self.top,
                            'Show peak heights instead of volumes?', 0)
    hb.button.pack(side = 'top', anchor = 'w')
    self.heights = hb

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

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

    mb = tkutil.checkbutton(self.top,
                            'Include assignments without a residue number?', 0)
    mb.button.pack(side = 'top', anchor = 'w')
    self.unnumbered = mb

    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 Shifts', self.save_shifts_cb),
                           ('Write Peaks', self.save_peaks_cb),
                           ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'XEASYFormat')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[3])
Beispiel #19
0
  def __init__(self, session):

    tkutil.Dialog.__init__(self, session.tk, 'XPLOR Restraints')

    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'] = 'XPLOR Restraint 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

    bt = tkutil.entry_field(self.top, 'Bounds text ', width = 30)
    bt.frame.pack(side = 'top', anchor = 'w')
    self.bounds_text = bt

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

    hb = tkutil.entry_row(self.top, 'Only peaks with height',
                          (' >= ', '', 8), (' and < ', '', 8))
    hb.frame.pack(side = 'top', anchor = 'w')
    self.height_min, self.height_max = hb.variables

    vb = tkutil.entry_row(self.top, 'Only peaks with volume',
                          (' >= ', '', 8), (' and < ', '', 8))
    vb.frame.pack(side = 'top', anchor = 'w')
    self.volume_min, self.volume_max = vb.variables

    eh1 = Tkinter.Label(self.top, text = 'Omit peak if note has a word from:')
    eh1.pack(side = 'top', anchor = 'w')
    ef1 = tkutil.entry_field(self.top, '  ', width = 30)
    ef1.frame.pack(side = 'top', anchor = 'w')
    self.exclude_note_words = ef1
    eh2 = Tkinter.Label(self.top, text = 'or if it has no word from:')
    eh2.pack(side = 'top', anchor = 'w')
    ef2 = tkutil.entry_field(self.top, '  ', width = 30)
    ef2.frame.pack(side = 'top', anchor = 'w')
    self.require_note_words = ef2
    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 Restraints', self.save_peaks_cb),
                           ('Append', self.append_peaks_cb),
                           ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session,
                                                   'XplorFormat')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[3])
Beispiel #20
0
  def __init__(self, session):

    tkutil.Dialog.__init__(self, session.tk, 'Set Volume Errors')

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

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

    r = 0

    w = Tkinter.Label(f, text = 'Error (%)')
    w.grid(row = r, column = 1)
    r = r + 1

    cb = tkutil.checkbutton(f, 'Default fit', 1)
    self.fit_default = cb.variable
    cb.button.grid(row = r, column = 0, sticky = 'w')
    e = tkutil.entry_field(f, '', '10', 4)
    self.fit_default_error = e.variable
    e.frame.grid(row = r, column = 1)
    r = r + 1

    cb = tkutil.checkbutton(f, 'Default box / ellipse', 1)
    self.box_default = cb.variable
    cb.button.grid(row = r, column = 0, sticky = 'w')
    e = tkutil.entry_field(f, '', '20', 4)
    self.box_default_error = e.variable
    e.frame.grid(row = r, column = 1)
    r = r + 1

    cb = tkutil.checkbutton(f, 'Near diagonal', 0)
    self.near_diagonal = cb.variable
    cb.button.grid(row = r, column = 0, sticky = 'w')
    e = tkutil.entry_field(f, '', '20', 4)
    self.near_diagonal_error = e.variable
    e.frame.grid(row = r, column = 1)
    tkutil.grid_labels(f, ('Range (ppm)', r, 2))
    e = tkutil.entry_field(f, '|w1-w2| ', '.1', 4)
    self.near_diagonal_range = e.variable
    e.frame.grid(row = r+1, column = 2)
    r = r + 2

    cb = tkutil.checkbutton(f, 'Near other peaks', 0)
    self.nearby_peaks = cb.variable
    cb.button.grid(row = r, column = 0, sticky = 'w')
    tkutil.grid_labels(f,
                       ('Relative volume', r+1, 0),
                       ('< .5', r+2, 0),
                       ('.5 - 2', r+3, 0),
                       ('> 2', r+4, 0),
                       ('unintegrated', r+5, 0))
    self.nearby_error = {}
    (self.nearby_error['< .5'],
     self.nearby_error['.5 - 2'],
     self.nearby_error['> 2'],
     self.nearby_error['unintegrated']
     ) = tkutil.grid_entries(f, 4,
                             ('5', r+2, 1),
                             ('10', r+3, 1),
                             ('20', r+4, 1),
                             ('20', r+5, 1))
    self.nearby_range = {}
    tkutil.grid_labels(f, ('Range (ppm)', r+1, 2))
    e = tkutil.entry_field(f, 'w1 ', '.05', 4)
    self.nearby_range['w1 range'] = e.variable
    e.frame.grid(row = r+2, column = 2)
    e = tkutil.entry_field(f, 'w2 ', '.05', 4)
    self.nearby_range['w2 range'] = e.variable
    e.frame.grid(row = r+3, column = 2)
    r = r + 6

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

    br = tkutil.button_row(self.top,
			   ('Set Volume Errors', self.update_cb),
			   ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'VolumeErrors')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

    tkutil.Stoppable.__init__(self, progress_label, br.buttons[1])
Beispiel #21
0
    def __init__(self, session):

        self.session = session

        tkutil.Dialog.__init__(self, session.tk, 'DYANA / XEASY Format')

        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, 'Chemical shift list', 5)
        sl.frame.pack(fill='both', expand=1)
        sl.listbox.bind('<ButtonRelease-1>', self.resonance_cb)
        self.shift_list = sl

        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

        cy = tkutil.checkbutton(self.top, 'Cyana Formatting ?', 0)
        cy.button.pack(side='top', anchor='w')
        self.cyana = cy

        hb = tkutil.checkbutton(self.top,
                                'Show peak heights instead of volumes?', 0)
        hb.button.pack(side='top', anchor='w')
        self.heights = hb

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

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

        mb = tkutil.checkbutton(
            self.top, 'Include assignments without a residue number?', 0)
        mb.button.pack(side='top', anchor='w')
        self.unnumbered = mb

        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 Shifts', self.save_shifts_cb),
            ('Write Peaks', self.save_peaks_cb),
            ('Stop', self.stop_cb),
            ('Close', self.close_cb),
            ('Help', sputil.help_cb(session, 'XEASYFormat')),
        )
        br.frame.pack(side='top', anchor='w')

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