Ejemplo n.º 1
0
  def read_settings(self):

    atof = pyutil.string_to_float
    settings = pyutil.generic_class()

    settings.spectrum = self.spectrum_choice.spectrum()

    settings.fit_default_error = None
    if self.fit_default.get():
      settings.fit_default_error = atof(self.fit_default_error.get())

    settings.box_default_error = None
    if self.box_default.get():
      settings.box_default_error = atof(self.box_default_error.get())

    settings.near_diagonal_range = None
    settings.near_diagonal_error = None
    if self.near_diagonal.get():
      settings.near_diagonal_range = atof(self.near_diagonal_range.get())
      settings.near_diagonal_error = atof(self.near_diagonal_error.get())
      
    settings.nearby_peaks = {}
    settings.nearby_error = {}
    if self.nearby_peaks.get():
      range = (atof(self.nearby_range['w1 range'].get()),
	       atof(self.nearby_range['w2 range'].get()))
      if range[0] != None and range[1] != None:
        plist = settings.spectrum.peak_list()
        settings.nearby_peaks = nearby_peak_table(plist, range, self)
        for range in ('< .5', '.5 - 2', '> 2', 'unintegrated'):
          e = atof(self.nearby_error[range].get(), 0)
          settings.nearby_error[range] = e

    return settings
Ejemplo n.º 2
0
  def show_linewidths(self, ap_pairs):

    p = pyutil.generic_class()

    p.top_yspace = 30
    p.name_xspace = 70
    p.name_yspace = 18
    p.atom_yspace = p.name_yspace / self.atoms_per_line
    p.tick_size = p.atom_yspace / 2
    p.label_gap = 15
    p.left_xspace = 20
    p.names_xspace = p.left_xspace + self.atoms_per_line * p.name_xspace
    p.plot_range = (p.names_xspace, p.names_xspace + 500)
    p.linewidth_range = (self.min_linewidth, self.max_linewidth)
    p.line = 0

    self.canvas.delete('all')

    self.plot_linewidths(ap_pairs, p)
    self.plot_grid(p)

    box = self.canvas.bbox('all')
    self.canvas['width'] = box[2]
    self.canvas['scrollregion'] = box
    tkutil.set_canvas_corner(self.canvas, 0, 0)
Ejemplo n.º 3
0
    def show_linewidths(self, ap_pairs):

        p = pyutil.generic_class()

        p.top_yspace = 30
        p.name_xspace = 70
        p.name_yspace = 18
        p.atom_yspace = p.name_yspace / self.atoms_per_line
        p.tick_size = p.atom_yspace / 2
        p.label_gap = 15
        p.left_xspace = 20
        p.names_xspace = p.left_xspace + self.atoms_per_line * p.name_xspace
        p.plot_range = (p.names_xspace, p.names_xspace + 500)
        p.linewidth_range = (self.min_linewidth, self.max_linewidth)
        p.line = 0

        self.canvas.delete('all')

        self.plot_linewidths(ap_pairs, p)
        self.plot_grid(p)

        box = self.canvas.bbox('all')
        self.canvas['width'] = box[2]
        self.canvas['scrollregion'] = box
        tkutil.set_canvas_corner(self.canvas, 0, 0)
Ejemplo n.º 4
0
  def get_settings(self):
    settings = pyutil.generic_class()

    settings.c13_spectrum = self.c13_spect.spectrum()
    settings.n15_spectrum = self.n15_spect.spectrum()
    settings.c13_ppm_range = tkutil.float_variable_values(self.c13_ppm_range)
    settings.n15_ppm_range = tkutil.float_variable_values(self.n15_ppm_range)
    settings.show_type = self.show_type.get()
    settings.exclude_mirrors = self.exclude_mirrors.state()
    if settings.exclude_mirrors:
      ftext = self.c13_n15_factor.get()
      settings.c13_n15_factor = pyutil.string_to_float(ftext, 1)
      ftext = self.min_mirror_factor.get()
      settings.min_mirror_factor = pyutil.string_to_float(ftext, 0)
    return settings
Ejemplo n.º 5
0
  def get_settings(self):

    settings = pyutil.generic_class()
    settings.spectrum = self.spectrum_choice.spectrum()
    settings.noesy_hsqc = noesy.is_noesy_hsqc(settings.spectrum)
    settings.pdb_paths = list(self.pdb_paths.path_list)
    settings.max_distance = pyutil.string_to_float(self.max_dist.get())
    if settings.spectrum:
      dim = settings.spectrum.dimension
      settings.ppm_range = tkutil.float_variable_values(self.ppm_range)[:dim]
    else:
      settings.ppm_range = None
    settings.show_type = self.show_type.get()
    settings.show_dist = self.show_dist.get()
    
    return settings
Ejemplo n.º 6
0
    def get_settings(self):

        settings = pyutil.generic_class()
        settings.spectrum = self.spectrum_choice.spectrum()
        settings.noesy_hsqc = noesy.is_noesy_hsqc(settings.spectrum)
        settings.pdb_paths = list(self.pdb_paths.path_list)
        settings.max_distance = pyutil.string_to_float(self.max_dist.get())
        if settings.spectrum:
            dim = settings.spectrum.dimension
            settings.ppm_range = tkutil.float_variable_values(
                self.ppm_range)[:dim]
        else:
            settings.ppm_range = None
        settings.show_type = self.show_type.get()
        settings.show_dist = self.show_dist.get()

        return settings
Ejemplo n.º 7
0
  def get_settings(self):
  
    settings = pyutil.generic_class()
    Labels = []
    for (resi,resn) in self.sequence:
      Labels.append(resn + str(resi))
    spectra = self.spectrum_table.chosen_spectra
    settings.spectrum_list=[spectrum for spectrum in spectra]
    settings.pdb_path = self.pdb_path.get()
    settings.chains = self.chains.get().replace(',','')
    settings.labeling = self.labeling.get()


    settings.sequence = self.sequence
    settings.ref_spectrum = self.sc_ref_spectrum.spectrum()
    settings.spectrum_2 = self.sc_spectrum_2.spectrum()
    settings.Htol = float(self.ppm_range.variables[0].get())
    settings.Ctol = float(self.ppm_range.variables[1].get())
    settings.Labels = Labels

    return settings
Ejemplo n.º 8
0
    def get_settings(self):

        settings = pyutil.generic_class()

        settings.ref_spectrum = self.ref_menu.spectrum()
        if settings.ref_spectrum == None:
            self.progress_report('Spectrum %s not found' % self.ref_menu.get())
            return None

        settings.pick_view = self.pick_menu.view()
        if settings.pick_view == None:
            self.progress_report('View %s not found' % self.pick_menu.get())
            return None

        settings.selected_only = self.selected_only.state()

        settings.ranges = []
        for ref_axis, pick_axis, ef in self.range_entries:
            rtext = ef.variable.get()
            r = pyutil.string_to_float(rtext)
            if r != None:
                settings.ranges.append((ref_axis, pick_axis, r))

        return settings
Ejemplo n.º 9
0
  def get_settings(self):

    settings = pyutil.generic_class()

    settings.ref_spectrum = self.ref_menu.spectrum()
    if settings.ref_spectrum == None:
      self.progress_report('Spectrum %s not found' % self.ref_menu.get())
      return None

    settings.pick_view = self.pick_menu.view()
    if settings.pick_view == None:
      self.progress_report('View %s not found' % self.pick_menu.get())
      return None

    settings.selected_only = self.selected_only.state()

    settings.ranges = []
    for ref_axis, pick_axis, ef in self.range_entries:
      rtext = ef.variable.get()
      r = pyutil.string_to_float(rtext)
      if r != None:
        settings.ranges.append((ref_axis, pick_axis, r))

    return settings
Ejemplo n.º 10
0
  def show_intervals(self, slist):

    p = pyutil.generic_class()

    p.top_yspace = 30
    p.name_xspace = 70
    p.name_yspace = 18
    p.atom_yspace = p.name_yspace / self.atoms_per_line
    p.tick_size = p.atom_yspace / 2
    p.label_gap = 15
    p.left_xspace = 20
    p.names_xspace = p.left_xspace + self.atoms_per_line * p.name_xspace
    p.plot_range = (p.names_xspace + 500, p.names_xspace)
    p.ppm_range = (self.min_ppm, self.max_ppm)

    self.canvas.delete('all')

    self.plot_grid(p, len(slist))
    self.plot_shifts(slist, p)

    box = self.canvas.bbox('all')
    self.canvas['width'] = box[2]
    self.canvas['scrollregion'] = box
    tkutil.set_canvas_corner(self.canvas, 0, 0)
Ejemplo n.º 11
0
    def show_intervals(self, slist):

        p = pyutil.generic_class()

        p.top_yspace = 30
        p.name_xspace = 70
        p.name_yspace = 18
        p.atom_yspace = p.name_yspace / self.atoms_per_line
        p.tick_size = p.atom_yspace / 2
        p.label_gap = 15
        p.left_xspace = 20
        p.names_xspace = p.left_xspace + self.atoms_per_line * p.name_xspace
        p.plot_range = (p.names_xspace + 500, p.names_xspace)
        p.ppm_range = (self.min_ppm, self.max_ppm)

        self.canvas.delete('all')

        self.plot_grid(p, len(slist))
        self.plot_shifts(slist, p)

        box = self.canvas.bbox('all')
        self.canvas['width'] = box[2]
        self.canvas['scrollregion'] = box
        tkutil.set_canvas_corner(self.canvas, 0, 0)