def draw_top_panel(self): self.top_panel = wx.Panel(self) szr = wx.BoxSizer(wx.VERTICAL) self.top_panel.SetSizer(szr) grid = wx.FlexGridSizer(cols=4) szr.Add(grid, 0, wx.ALL) grid.Add(utils.bold_text(self.top_panel, "Position type:"), 0, utils.std_sizer_flags, 5) pos_choice = wx.Choice(parent=self.top_panel, choices=ramalyze.res_type_labels) self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, pos_choice) pos_choice.SetSelection(ramalyze.RAMA_GENERAL) grid.Add(pos_choice, 0, utils.std_sizer_flags, 5) grid.Add(utils.bold_text(self.top_panel, "Residue name:"), 0, utils.std_sizer_flags, 5) aa = [ 'ALA', 'ARG', 'ASN', 'ASP', 'CYS', 'GLN', 'GLU', 'HIS', 'LEU', 'LYS', 'MET', 'PHE', 'SER', 'THR', 'TRP', 'TYR', ] res_choice = wx.Choice(parent=self.top_panel, choices=['*'] + aa) res_choice.SetSelection(0) self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, res_choice) res_choice.Disable() grid.Add(res_choice, 0, utils.std_sizer_flags, 5) grid.Add(utils.bold_text(self.top_panel, "Show data points:"), 0, utils.std_sizer_flags, 5) default = ramalyze.RAMALYZE_ANY if (self._validation.n_total > 2500): default = ramalyze.RAMALYZE_NOT_FAVORED pt_choice = wx.Choice(parent=self.top_panel, choices=ramalyze.rama_type_labels) pt_choice.SetSelection(default) self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, pt_choice) grid.Add(pt_choice, 0, utils.std_sizer_flags, 5) grid.Add(utils.bold_text(self.top_panel, "Color scheme:"), 0, utils.std_sizer_flags, 5) cm_choice = wx.Choice(parent=self.top_panel, choices=wxtbx.plots.colormap_names) cm_choice.SetStringSelection("Blue") self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, cm_choice) grid.Add(cm_choice, 0, utils.std_sizer_flags, 5) self.choices = [pos_choice, res_choice, pt_choice, cm_choice] self.show_labels = wx.CheckBox(self.top_panel, label="Show labels") self.show_labels.SetValue(True) self.Bind(wx.EVT_CHECKBOX, self.OnUpdatePlot, self.show_labels) grid.Add(self.show_labels, 0, utils.std_sizer_flags, 5)
def draw_top_panel(self): self.top_panel = wx.Panel(self) szr = wx.BoxSizer(wx.VERTICAL) self.top_panel.SetSizer(szr) grid = wx.FlexGridSizer(cols=4) szr.Add(grid, 0, wx.ALL) grid.Add(utils.bold_text(self.top_panel, "Residue name:"), 0, utils.std_sizer_flags, 5) res_choice = wx.Choice(parent=self.top_panel, choices=self.residues) res_choice.SetSelection(0) self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, res_choice) grid.Add(res_choice, 0, utils.std_sizer_flags, 5) grid.Add(utils.bold_text(self.top_panel, "Show data points:"), 0, utils.std_sizer_flags, 5) pt_names = ["All", "None", "Outlier"] pt_choice = wx.Choice(self.top_panel, choices=pt_names) pt_choice.SetSelection(0) self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, pt_choice) grid.Add(pt_choice, 0, utils.std_sizer_flags, 5) grid.Add(utils.bold_text(self.top_panel, "Color scheme:"), 0, utils.std_sizer_flags, 5) cm_choice = wx.Choice(parent=self.top_panel, choices=wxtbx.plots.colormap_names) cm_choice.SetSelection(5) self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, cm_choice) grid.Add(cm_choice, 0, utils.std_sizer_flags, 5) self.choices = [res_choice, pt_choice, cm_choice] self.show_labels = wx.CheckBox(self.top_panel, label="Show labels") self.show_labels.SetValue(False) self.Bind(wx.EVT_CHECKBOX, self.OnUpdatePlot, self.show_labels) grid.Add(self.show_labels, 0, utils.std_sizer_flags, 5)
def draw_top_panel (self) : self.top_panel = wx.Panel(self) szr = wx.BoxSizer(wx.VERTICAL) self.top_panel.SetSizer(szr) grid = wx.FlexGridSizer(cols=4) szr.Add(grid, 0, wx.ALL) grid.Add(utils.bold_text(self.top_panel, "Residue name:"), 0, utils.std_sizer_flags, 5) res_choice = wx.Choice(parent=self.top_panel, choices=self.residues) res_choice.SetSelection(0) self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, res_choice) grid.Add(res_choice, 0, utils.std_sizer_flags, 5) grid.Add(utils.bold_text(self.top_panel, "Show data points:"), 0, utils.std_sizer_flags, 5) pt_names = ["All", "None", "Outlier"] pt_choice = wx.Choice(self.top_panel, choices=pt_names) self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, pt_choice) grid.Add(pt_choice, 0, utils.std_sizer_flags, 5) grid.Add(utils.bold_text(self.top_panel, "Color scheme:"), 0, utils.std_sizer_flags, 5) cm_choice = wx.Choice(parent=self.top_panel, choices=wxtbx.plots.colormap_names) cm_choice.SetSelection(5) self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, cm_choice) grid.Add(cm_choice, 0, utils.std_sizer_flags, 5) self.choices = [res_choice, pt_choice, cm_choice] self.show_labels = wx.CheckBox(self.top_panel, label="Show labels") self.show_labels.SetValue(False) self.Bind(wx.EVT_CHECKBOX, self.OnUpdatePlot, self.show_labels) grid.Add(self.show_labels, 0, utils.std_sizer_flags, 5)
def draw_top_panel (self) : self.top_panel = wx.Panel(self) szr = wx.BoxSizer(wx.VERTICAL) self.top_panel.SetSizer(szr) grid = wx.FlexGridSizer(cols=4) szr.Add(grid, 0, wx.ALL) grid.Add(utils.bold_text(self.top_panel, "Position type:"), 0, utils.std_sizer_flags, 5) pos_choice = wx.Choice(parent=self.top_panel, choices=ramalyze.res_type_labels) self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, pos_choice) pos_choice.SetSelection(ramalyze.RAMA_GENERAL) grid.Add(pos_choice, 0, utils.std_sizer_flags, 5) grid.Add(utils.bold_text(self.top_panel, "Residue name:"), 0, utils.std_sizer_flags, 5) aa = ['ALA', 'ARG', 'ASN', 'ASP', 'CYS', 'GLN', 'GLU', 'HIS', 'LEU', 'LYS', 'MET', 'PHE', 'SER', 'THR', 'TRP', 'TYR',] res_choice = wx.Choice(parent=self.top_panel, choices=['*']+aa) res_choice.SetSelection(0) self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, res_choice) res_choice.Disable() grid.Add(res_choice, 0, utils.std_sizer_flags, 5) grid.Add(utils.bold_text(self.top_panel, "Show data points:"), 0, utils.std_sizer_flags, 5) default = ramalyze.RAMALYZE_ANY if (self._validation.n_total > 2500) : default = ramalyze.RAMALYZE_NOT_FAVORED pt_choice = wx.Choice(parent=self.top_panel, choices=ramalyze.rama_type_labels) pt_choice.SetSelection(default) self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, pt_choice) grid.Add(pt_choice, 0, utils.std_sizer_flags, 5) grid.Add(utils.bold_text(self.top_panel, "Color scheme:"), 0, utils.std_sizer_flags, 5) cm_choice = wx.Choice(parent=self.top_panel, choices=wxtbx.plots.colormap_names) cm_choice.SetStringSelection("Blue") self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, cm_choice) grid.Add(cm_choice, 0, utils.std_sizer_flags, 5) self.choices = [pos_choice, res_choice, pt_choice, cm_choice] self.show_labels = wx.CheckBox(self.top_panel, label="Show labels") self.show_labels.SetValue(True) self.Bind(wx.EVT_CHECKBOX, self.OnUpdatePlot, self.show_labels) grid.Add(self.show_labels, 0, utils.std_sizer_flags, 5)
def draw_top_panel (self) : self.top_panel = wx.Panel(self) szr = wx.BoxSizer(wx.VERTICAL) self.top_panel.SetSizer(szr) grid = wx.FlexGridSizer(cols=4) szr.Add(grid, 0, wx.ALL) grid.Add(utils.bold_text(self.top_panel, "Show residues:"), 0, utils.std_sizer_flags, 5) self.range_choice = wx.Choice(parent=self.top_panel, choices=self._binner.get_ranges()) self.range_choice.SetSelection(0) self.Bind(wx.EVT_CHOICE, self.OnUpdatePlot, self.range_choice) grid.Add(self.range_choice, 0, utils.std_sizer_flags, 5) grid.Add(utils.bold_text(self.top_panel, "Click to zoom residue:"), 0, utils.std_sizer_flags, 5) self.residue_status = wx.TextCtrl(self.top_panel, size=(160,-1), style=wx.TE_READONLY) grid.Add(self.residue_status, 0, utils.std_sizer_flags, 5)