Beispiel #1
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')
Beispiel #2
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')
Beispiel #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()
Beispiel #4
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])
  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]) 
    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])
  def peak_list_box(self, parent):

    pl = tkutil.scrolling_list(parent, 'Possible resonance assignments', 5)
    pl.listbox.bind('<ButtonRelease-1>', self.select_peak_cb)
    pl.listbox.bind('<Double-ButtonRelease-1>', self.goto_peak_cb)
    self.peak_list = pl

    return pl.frame
    def peak_list_box(self, parent):

        pl = tkutil.scrolling_list(parent, 'Possible resonance assignments', 5)
        pl.listbox.bind('<ButtonRelease-1>', self.select_peak_cb)
        pl.listbox.bind('<Double-ButtonRelease-1>', self.goto_peak_cb)
        self.peak_list = pl

        return pl.frame
Beispiel #9
0
  def label_list_box(self, parent):

    pl = tkutil.scrolling_list(parent, 'Choose possible resonance assignments by PINE', 8)
    pl.listbox.bind('<Double-ButtonRelease-1>', self.Assign_cb)          # Func
    pl.listbox.bind('<ButtonRelease-3>', self.Assign_cb)          # Func
    self.label_list = pl
    
    return pl.frame
Beispiel #10
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()
    def label_list_box(self, parent):

        pl = tkutil.scrolling_list(
            parent, 'Choose possible resonance assignments by PINE', 8)
        pl.listbox.bind('<Double-ButtonRelease-1>', self.Assign_cb)  # Func
        pl.listbox.bind('<ButtonRelease-3>', self.Assign_cb)  # Func
        self.label_list = pl

        return pl.frame
Beispiel #12
0
  def __init__(self, session):

    self.session = session
    self.spectrum_times = []
    self.last_spectrum_times = []
    self.error_estimate_trials = 5
    
    tkutil.Dialog.__init__(self, session.tk, 'Relaxation Peak Heights')

    pl = tkutil.scrolling_list(self.top, heading = '', height = 5)
    pl.frame.pack(side = 'top', fill = 'both', expand = 1)
    pl.listbox.bind('<ButtonRelease-1>', self.show_fit_cb)
    pl.listbox.bind('<KeyPress-Delete>', pl.delete_selected_cb)
    # The following is needed so key press is received by list box.
    pl.listbox.bind('<ButtonPress-1>', pl.set_focus_cb)
    self.peak_list = pl

    md = tkutil.option_menu(self.top, 'Use ',
                            (self.HEIGHTS_MODE,
                             self.ASSIGNED_HEIGHTS_MODE,
                             self.ASSIGNED_HEIGHTS_ONLY_MODE,
                             self.VOLUMES_MODE))
    md.frame.pack(side = 'top', anchor = 'w')
    self.mode = md.variable

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

    br = tkutil.button_row(self.top,
                           ('Setup...', self.setup_cb),
                           ('Save', self.peak_list.save_cb),
                           ('Append', self.peak_list.append_cb),
                           ('Clear', self.clear_cb),
                           ('Stop', self.stop_cb),
			   ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'RelaxFit')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')

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

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

    cm = sputil.condition_menu(session, self.top, 'Condition: ')
    cm.frame.pack(side = 'top', anchor = 'w')
    self.condition_menu = cm

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

    al = tkutil.scrolling_list(self.top, 'Resonances w/o PDB atoms', 5)
    al.frame.pack(fill = 'both', expand = 1)
    self.atom_list = al

    br = tkutil.button_row(self.top,
			   ('Update', self.update_cb),
                           ('Close', self.close_cb),
                           ('Help', sputil.help_cb(session, 'PDBNames')),
			   )
    br.frame.pack(side = 'top', anchor = 'w')
Beispiel #14
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()
Beispiel #15
0
    def __init__(self, session):

        self.session = session

        tkutil.Dialog.__init__(self, session.tk,
                               'Reposition Assigned Fragment')

        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])
    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):

    self.session = session
    try:
      persist_path = self.session.project.save_path + '.seq'
    except:
      persist_path = ''
    sequence = []
    ## If the session.project.save_path + '.seq' file exist then produce sequence = [(idx, szA)]
    if os.path.exists(persist_path):
      pszLines =[line.rstrip() for line in open(persist_path).readlines() if line.rstrip() and ">" not in line and "#" not in line]
      for line in pszLines:
        if line.split()[0] in AAA_dict.keys():
          sequence.append((int(line.split()[1]), AAA_dict[line.split()[0]]))

    if not os.path.exists(persist_path):
      tkMessageBox.showinfo('Input Error', "No Sequence file was found\n Please load a sequence using 'sq' command\nSave the project and relaunch MAGIC-Act")

      return  self.close_cb
    self.sequence = sequence
    self.selection_notice = None
    self.save_file = session.project.save_path.split('/')[-1].replace('.proj', '_pymol.txt')
    tkutil.Dialog.__init__(self, session.tk, 'MAGIC-View')
    explain = ('Pymol Visualization and Assignment Accuracy Statistics\n') 
    w = Tkinter.Label(self.top, text = explain, justify = 'left')
    w.pack(side = 'top', anchor = 'w')
    explain = ('PDB does NOT need H')
    w = Tkinter.Label(self.top, text = explain, justify = 'left')
    w.pack(side = 'top', anchor = 'w')

    ep = tkutil.file_field2(self.top, 'PDB file', 'Browse...', file_type=[('Protein Data Bank File', '.pdb')], default_ext='.pdb')
    self.pdb_path = ep.variable
    ep.frame.pack(side = 'top', anchor = 'w')

    lb = tkutil.entry_field(self.top, 'Labeled Methyls: ', 'ILVMAT', 10)
    lb.frame.pack(side = 'top', anchor = 'w')
    self.labeling = lb.variable

    explain = ('Specify which chain should be used')
    w = Tkinter.Label(self.top, text = explain, justify = 'left')
    w.pack(side = 'top', anchor = 'w')
    ch = tkutil.entry_field(self.top, 'Use Chain(s): ', 'A', 5)
    self.chains = ch.variable
    ch.frame.pack(side = 'top', anchor = 'w')

    explain = ('Select 2D spectra that contain assignments')
    w = Tkinter.Label(self.top, text = explain, justify = 'left')
    w.pack(side = 'top', anchor = 'w')    
    self.sc = self.spectrum_choice_table(self.top)
    self.sc.pack(side = 'top', anchor = 'w')

  # Compare Assignments Box
    self.lf2 = Tkinter.LabelFrame(self.top, text='Compare Assignments')
    self.lf2.pack(fill=X, pady=5)
    self.pmframe= Tkinter.Frame(self.lf2)
    self.pmframe.pack(pady=5)
    # First Spectrum
    self.sc_ref_spectrum = spectrum_menu(session, self.pmframe, 'Ref Spectrum: ')
    self.sc_ref_spectrum.frame.pack(side ='top',padx=3)
  # Second Spectrum  
    self.sc_spectrum_2 = spectrum_menu(session, self.pmframe, 'Query Spectrum: ')
    self.sc_spectrum_2.frame.pack(side = 'top', anchor = 'w')

    sl = tkutil.scrolling_list(self.top, 'Assignment Report', 10)
    sl.frame.pack(fill = 'both', expand = 1)
    self.summary_list = sl

  # PPM Tolerances for filtering noesy and finding geminal pairs
    er = tkutil.entry_row(self.top, 'PPM tolerance: ',
                                    ('1H', '0.01', 5),
                                    ('13C', '0.10', 5))
    er.frame.pack(side = 'top', anchor = 'w',padx=2)
    self.ppm_range = er

    br = tkutil.button_row(self.top,
                           ('Compare', self.show_summary),
                           ('Save', self.save_pymol_cb),
                           ('Close', self.close_cb))
    br.frame.pack(side = 'top', anchor = 'w')
Beispiel #20
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])