Esempio n. 1
0
    def create_UI(self):
        self.grid_rowconfigure(0, weight = 1)
        self.grid_columnconfigure(0, weight = 1)
        central_panel = tkinter.PanedWindow(self, orient = tkinter.HORIZONTAL, sashwidth = self.p * 2, sashrelief = tkinter.RIDGE, background = self.host.back)
        central_panel.grid(row = 0, column = 0, sticky = "NSEW")
        
        self.fixed = Aln_basic.TextFrameWithLabelAndButton(central_panel, self.p, None, None, 
                               "'Fixed' alignment:", "Save to file")
        self.fixed.button.configure(command = self.save_fixed)
        sort_by_tree = tkinter.Button(self.fixed.panel, background = self.host.header, foreground = "#FFFFFF", text = "Sort by tree", command = self.sort_by_tree)
        sort_by_tree.grid(row = 0, column = 2, sticky = "NSW", padx = self.p, pady = self.p)  
        central_panel.add(self.fixed)

        self.pure = Aln_basic.TextFrameWithLabelAndButton(central_panel, self.p, None, None,  
                               "'Pure names':", "Save to file")
        self.pure.button.configure(command = self.save_pure)
        self.run_hmmsearch_Pfam = tkinter.Button(self.pure.panel, state = tkinter.DISABLED, text = "HMM search (Pfam)", command = self.hmmsearch_Pfam)
        self.run_hmmsearch_Pfam.grid(row = 0, column = 2, sticky = "NSW", padx = self.p, pady = self.p)  
        self.run_hmmsearch_COG = tkinter.Button(self.pure.panel, state = tkinter.DISABLED, text = "HMM search (COG)", command = self.hmmsearch_COG)
        self.run_hmmsearch_COG.grid(row = 0, column = 3, sticky = "NSW", padx = self.p, pady = self.p)  
        self.run_TMHMM = tkinter.Button(self.pure.panel, state = tkinter.DISABLED, text = "TMHMM", command = self.TMHMM)
        self.run_TMHMM.grid(row = 0, column = 4, sticky = "NSW", padx = self.p, pady = self.p)  

        tkinter.Label(self.pure.panel, text = "Enter begin, step and nsteps:").grid(row = 1, column = 0, sticky = "NSW")
        self.begin_entry = tkinter.Entry(self.pure.panel, width = 8)
        self.begin_entry.grid(row = 1, column = 1, sticky = "NSW", padx = self.p, pady = self.p)
        self.begin_entry.insert(tkinter.END, 200)
        self.step_entry = tkinter.Entry(self.pure.panel, width = 8)
        self.step_entry.grid(row = 1, column = 2, sticky = "NSW", padx = self.p, pady = self.p)
        self.step_entry.insert(tkinter.END, 50)
        self.nsteps_entry = tkinter.Entry(self.pure.panel, width = 8)
        self.nsteps_entry.grid(row = 1, column = 3, sticky = "NSW", padx = self.p, pady = self.p)
        self.nsteps_entry.insert(tkinter.END, 10)
        self.length_histo = tkinter.Button(self.pure.panel, text = "To log", state = tkinter.DISABLED, command = self.histo_to_log)
        self.length_histo.grid(row = 1, column = 4, sticky = "NSW", padx = self.p, pady = self.p)
        central_panel.add(self.pure)

        self.blocks = Aln_basic.TextFrameWithLabelAndButton(central_panel, self.p, None, None, 
                               "Blocks regions:", "Save to file")
        self.blocks.button.configure(command = self.save_blocks)
        central_panel.add(self.blocks)  

        self.IDs = Aln_basic.TextFrameWithLabelAndButton(central_panel, self.p, None, None, 
                               "List of IDs:", "Save to file")
        self.IDs.button.configure(command = self.save_IDs)
        self.ID_save_mode = tkinter.StringVar()
        self.ID_save_mode.set("No change")
        ID_save_mode = tkinter.OptionMenu(self.IDs.panel, self.ID_save_mode, "No change", "  -> gi  ", "fix gi-gi", "fix & ->") 
        ID_save_mode.grid(row = 0, column = 2, sticky = "NW", padx = self.p, pady = self.p)         
        try: #FIX: version 1.0.0 (if no assignment between gi and id/locus was given, conversion options are disabled)
            curr_table = self.host.settings.table_filename
        except AttributeError:
            ID_save_mode.configure(state = tkinter.DISABLED)
        
        central_panel.add(self.IDs)
        self.update_idletasks()
        central_panel.sash_place(0, 300, 1)
        central_panel.sash_place(1, 1100, 1)
        central_panel.sash_place(2, 1500, 1)
Esempio n. 2
0
    def create_UI(self):
        self.grid_rowconfigure(0, weight = 1)
        self.grid_columnconfigure(0, weight = 1)
        central_panel = tkinter.PanedWindow(self, orient = tkinter.HORIZONTAL, sashwidth = self.p * 2, sashrelief = tkinter.RIDGE, background = self.host.back)
        central_panel.grid(row = 0, column = 0, sticky = "NSEW")

        self.auto_log = Aln_basic.TextFrameWithLabelAndButton(central_panel, self.p, None, None, 
                        "Automatically generated log:", "")
        self.auto_log.button.grid_forget()
        self.auto_log.text_widget.tag_configure("important", background = "#FFFF00")
        self.wrap_auto = tkinter.BooleanVar()
        c = tkinter.Checkbutton(self.auto_log.panel, text = "Wrap text", variable = self.wrap_auto, command = self.wrap_configure)
        c.grid(row = 0, column = 1, sticky ="NSE", padx = self.p, pady = self.p)
        central_panel.add(self.auto_log)

        self.manual_log = Aln_basic.TextFrameWithLabelAndButton(central_panel, self.p, None, None, 
                        "Manually generated log:", "")
        self.manual_log.button.grid_forget()
        self.wrap_manual = tkinter.BooleanVar()
        c = tkinter.Checkbutton(self.manual_log.panel, text = "Wrap text", variable = self.wrap_manual, command = self.wrap_configure)
        c.grid(row = 0, column = 1, sticky ="NSE", padx = self.p, pady = self.p)
        central_panel.add(self.manual_log)
Esempio n. 3
0
    def create_UI(self):
        self.grid_rowconfigure(0, weight = 1)
        self.grid_columnconfigure(0, weight = 1)
        central_panel = tkinter.PanedWindow(self, orient = tkinter.HORIZONTAL, sashwidth = self.p * 2, sashrelief = tkinter.RIDGE, background = self.host.back)
        central_panel.grid(row = 0, column = 0, sticky = "NSEW")
        self.aln_input_frame = Aln_basic.TextFrameWithLabelAndButton(central_panel, self.p, self.host.header, "#FFFFFF", 
                               "Insert multiple alignment or generate it from the left panel:", "Check input")
        self.aln_input_frame.button.configure(command = self.check_input)
        central_panel.add(self.aln_input_frame)
        
        self.seq_input_frame = Aln_basic.TextFrameWithLabelAndButton(central_panel, self.p, self.host.header, "#FFFFFF",
                               "Insert unaligned sequences:", "Align now!")
        self.seq_input_frame.button.configure(command = self.align)
        central_panel.add(self.seq_input_frame)         

        self.insert_blocks = tkinter.BooleanVar()
        self.insert_blocks.set(False)
        c = tkinter.Checkbutton(self.seq_input_frame.panel, text = "Insert BLOCKS & SITE", variable = self.insert_blocks)
        c.grid(row = 0, column = 2, sticky ="NSW", padx = self.p, pady = self.p)

        tkinter.Label(self.seq_input_frame.panel, text = "maxiters").grid(row = 0, column = 3, sticky = "NSW")
        self.maxiters = tkinter.Entry(self.seq_input_frame.panel, width = 2)
        self.maxiters.insert(tkinter.END, "2")
        self.maxiters.grid(row = 0, column = 4, sticky = "NSW", padx = self.p, pady = self.p)

        tkinter.Label(self.seq_input_frame.panel, text = "gapopen").grid(row = 0, column = 5, sticky = "NSW")
        self.gapopen = tkinter.Entry(self.seq_input_frame.panel, width = 3)
        self.gapopen.insert(tkinter.END, "")
        self.gapopen.grid(row = 0, column = 6, sticky = "NSW", padx = self.p, pady = self.p)

        tkinter.Label(self.seq_input_frame.panel, text = "gapextend").grid(row = 0, column = 7, sticky = "NSW")
        self.gapextend = tkinter.Entry(self.seq_input_frame.panel, width = 3)
        self.gapextend.insert(tkinter.END, "")
        self.gapextend.grid(row = 0, column = 8, sticky = "NSW", padx = self.p, pady = self.p)

        filter_identical = tkinter.Button(self.seq_input_frame.panel, text = "Filter identical", command = self.filter_seq)
        filter_identical.grid(row = 0, column = 9, sticky = "NSW", padx = self.p, pady = self.p)
Esempio n. 4
0
    def create_UI(self):
        self.grid_rowconfigure(0, weight = 1)
        self.grid_columnconfigure(0, weight = 1)
        self.input_frame = Aln_basic.TextFrameWithLabelAndButton(self, self.p, self.host.header, "#FFFFFF", 
                           "Insert sequences in FASTA format:", "Obtain taxonomy units")
        self.input_frame.grid(row = 0, column = 0, sticky = "NSEW", padx = self.p, pady = self.p)
        self.input_frame.button.configure(command = self.filter)
        tkinter.Label(self.input_frame.panel, text = "Input format:").grid(row = 0, column = 2, sticky = "NSW")
        self.input_format = tkinter.StringVar()
        self.input_format.set("My")
        input_format = tkinter.OptionMenu(self.input_frame.panel, self.input_format, "URef", "NCBI", "Uniprot", "PDB", "COGalyser", "Basic", "COG", "OldRef", "My_Ref", "My", "Olesya", "German") 
        input_format.grid(row = 0, column = 3, sticky = "NSW", padx = self.p, pady = self.p)      
        help_button = tkinter.Button(self.input_frame.panel, state = tkinter.DISABLED, text = "Format help", command = self.show_help)
        help_button.grid(row = 0, column = 4, sticky = "NSW", padx = self.p, pady = self.p)   

        self.configure_frame = 
Esempio n. 5
0
    def create_UI(self):
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)
        central_panel = tkinter.PanedWindow(self,
                                            orient=tkinter.HORIZONTAL,
                                            sashwidth=self.p * 2,
                                            sashrelief=tkinter.RIDGE,
                                            background=self.host.back)
        central_panel.grid(row=0, column=0, sticky="NSEW")

        base_frame = tkinter.Frame(central_panel)
        base_frame.columnconfigure(0, weight=1)
        base_frame.rowconfigure(1, weight=1)

        top_frame = tkinter.Frame(base_frame)
        tkinter.Label(top_frame, text="Max e-value:").grid(row=0,
                                                           column=0,
                                                           sticky="NSW")
        self.evalue_threshold = tkinter.Entry(top_frame,
                                              state=tkinter.DISABLED,
                                              width=8)
        self.evalue_threshold.grid(row=0,
                                   column=1,
                                   sticky="NSW",
                                   padx=self.p,
                                   pady=self.p)
        tkinter.Label(top_frame, text="# of σ (hit):").grid(row=0,
                                                            column=2,
                                                            sticky="NSW")
        self.sigma_num_self = tkinter.Entry(top_frame,
                                            state=tkinter.DISABLED,
                                            width=4)
        self.sigma_num_self.grid(row=0,
                                 column=3,
                                 sticky="NSW",
                                 padx=self.p,
                                 pady=self.p)
        self.self_hits_button = tkinter.Button(top_frame,
                                               state=tkinter.DISABLED,
                                               text="Find self-hits",
                                               command=self.find_self_hits)
        self.self_hits_button.grid(row=0,
                                   column=4,
                                   sticky="NSW",
                                   padx=self.p,
                                   pady=self.p)
        self.white_crow_button = tkinter.Button(
            top_frame,
            state=tkinter.DISABLED,
            text="Apply options",
            command=self.apply_purification_options)
        self.white_crow_button.grid(row=1,
                                    column=4,
                                    sticky="NSW",
                                    padx=self.p,
                                    pady=self.p)
        tkinter.Label(top_frame, text="Min length:").grid(row=1,
                                                          column=0,
                                                          sticky="NSW")
        self.min_length = tkinter.Entry(top_frame, width=6)
        self.min_length.insert(tkinter.END, "0")
        self.min_length.grid(row=1,
                             column=1,
                             sticky="NSW",
                             padx=self.p,
                             pady=self.p)
        tkinter.Label(top_frame, text="Max length:").grid(row=1,
                                                          column=2,
                                                          sticky="NSW")
        self.max_length = tkinter.Entry(top_frame, width=6)
        self.max_length.insert(tkinter.END, "10000")
        self.max_length.grid(row=1,
                             column=3,
                             sticky="NSW",
                             padx=self.p,
                             pady=self.p)

        top_frame.grid(row=0, column=0, columnspan=2, sticky="NSEW")

        y_scrollbar = tkinter.Scrollbar(base_frame)
        y_scrollbar.grid(row=1, column=1, sticky="NS")
        actions = ttk.Treeview(base_frame,
                               columns=("action", "organism"),
                               selectmode="extended",
                               yscrollcommand=y_scrollbar.set)
        y_scrollbar.config(command=actions.yview)
        actions.grid(row=1, column=0, sticky="NSEW")
        actions.column("action", width=50, anchor="w")
        actions.heading("action", text="Action")
        actions.column("organism", width=50, anchor="w")
        actions.heading("organism", text="Organism")
        actions.bind("<Double-Button-1>", self.get_click)
        self.actions = actions
        self.actions.menu_available = True  # To show <ActionMenu> only at this widget
        central_panel.add(base_frame)

        self.alignment = Aln_basic.TextFrameWithLabelAndButton(
            central_panel, self.p, self.host.header, "#FFFFFF",
            "Suggested changes in alignment:", "Load domains")
        self.alignment.button.configure(state=tkinter.DISABLED,
                                        command=self.create_domain_tags)
        self.alignment.text_widget.purify_text_widget = True  # To show <TextMenu> only at this widget
        self.show_features = tkinter.Button(self.alignment.panel,
                                            state=tkinter.DISABLED,
                                            text="Show domains",
                                            command=self.show_domains)
        self.show_features.grid(row=0,
                                column=2,
                                sticky="NSW",
                                padx=self.p,
                                pady=self.p)
        self.hide_features = tkinter.Button(self.alignment.panel,
                                            state=tkinter.DISABLED,
                                            text="Hide domains",
                                            command=self.hide_domains)
        self.hide_features.grid(row=0,
                                column=3,
                                sticky="NSW",
                                padx=self.p,
                                pady=self.p)
        self.load_taxonomy = tkinter.Button(self.alignment.panel,
                                            state=tkinter.DISABLED,
                                            text="Color taxonomy",
                                            command=self.color_taxonomy)
        self.load_taxonomy.grid(row=0,
                                column=4,
                                sticky="NSW",
                                padx=self.p,
                                pady=self.p)
        self.act = tkinter.Button(self.alignment.panel,
                                  state=tkinter.DISABLED,
                                  text="Apply actions",
                                  background=self.host.header,
                                  foreground="#FFFFFF",
                                  command=self.apply_actions)
        self.act.grid(row=0,
                      column=5,
                      sticky="NSW",
                      padx=self.p * 3,
                      pady=self.p)
        tkinter.Label(self.alignment.panel,
                      text="Presence required (%):").grid(row=0, column=6)
        self.presence_entry = tkinter.Entry(self.alignment.panel, width=3)
        self.presence_entry.insert(tkinter.END, "0")
        self.presence_entry.grid(row=0, column=7, padx=self.p, pady=self.p)

        central_panel.add(self.alignment)

        self.update_idletasks()
        central_panel.sash_place(0, base_frame.winfo_reqwidth(), 1)
Esempio n. 6
0
    def create_UI(self):
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)
        central_panel = tkinter.PanedWindow(self,
                                            orient=tkinter.HORIZONTAL,
                                            sashwidth=self.p * 2,
                                            sashrelief=tkinter.RIDGE,
                                            background=self.host.back)
        central_panel.grid(row=0, column=0, sticky="NSEW")
        self.input_frame = Aln_basic.TextFrameWithLabelAndButton(
            central_panel, self.p, self.host.header, "#FFFFFF",
            "Insert FASTA-format sequences:", "=> Convert =>")
        self.input_frame.button.configure(command=self.convert)
        tkinter.Label(self.input_frame.panel,
                      text="Input format:").grid(row=0, column=2, sticky="NSW")
        self.input_format = tkinter.StringVar()
        self.input_format.set("Basic")
        #input_format = tkinter.OptionMenu(self.input_frame.panel, self.input_format, "URef", "NCBI", "NCBI_2016", "Uniprot", "PDB", "COGcollator", "Basic", "COG", "OldRef", "My_Ref", "My", "Olesya", "German")
        input_format = tkinter.OptionMenu(self.input_frame.panel,
                                          self.input_format, "Basic", "NCBI",
                                          "NCBI_2016-", "Uniprot", "PDB",
                                          "COGcollator", "URef", "My")
        input_format.grid(row=0,
                          column=3,
                          sticky="NSW",
                          padx=self.p,
                          pady=self.p)
        help_button = tkinter.Button(self.input_frame.panel,
                                     state=tkinter.DISABLED,
                                     text="Format help",
                                     command=self.show_help)
        help_button.grid(row=0,
                         column=4,
                         sticky="NSW",
                         padx=self.p,
                         pady=self.p)
        central_panel.add(self.input_frame)

        self.output_frame = Aln_basic.TextFrameWithLabelAndButton(
            central_panel, self.p, self.host.header, "#FFFFFF",
            "Your result will be shown here:", "")
        self.output_frame.button.grid_forget()
        tkinter.Label(self.output_frame.panel,
                      text="Output format:").grid(row=0,
                                                  column=1,
                                                  sticky="NSW")

        self.output_format = tkinter.StringVar()
        self.output_format.set("My")
        output_format = tkinter.OptionMenu(self.output_frame.panel,
                                           self.output_format, "My", "Basic",
                                           "NCBI", "ID", "Table",
                                           "Same but fixed")
        output_format.grid(row=0,
                           column=2,
                           sticky="NSW",
                           padx=self.p,
                           pady=self.p)
        tkinter.Label(self.output_frame.panel,
                      text="Group label (optional):").grid(row=0,
                                                           column=3,
                                                           sticky="NSW")
        self.output_class = tkinter.Entry(self.output_frame.panel, width=15)
        self.output_class.grid(row=0,
                               column=4,
                               sticky="NSW",
                               padx=self.p,
                               pady=self.p)

        self.replace_spaces = tkinter.BooleanVar()
        self.replace_spaces.set(True)
        c = tkinter.Checkbutton(self.output_frame.panel,
                                text="Replace spaces",
                                variable=self.replace_spaces)
        c.grid(row=0, column=5, sticky="NSW", padx=self.p, pady=self.p)
        self.id_mode = tkinter.StringVar()
        self.id_mode.set("GI")
        radio = tkinter.Radiobutton(self.output_frame.panel,
                                    text="GI",
                                    variable=self.id_mode,
                                    value="GI")
        radio.grid(row=0, column=6, sticky="NSW", padx=self.p, pady=self.p)
        radio = tkinter.Radiobutton(self.output_frame.panel,
                                    text="protein_id",
                                    variable=self.id_mode,
                                    value="ID")
        radio.grid(row=0, column=7, sticky="NSW", padx=self.p, pady=self.p)
        radio = tkinter.Radiobutton(self.output_frame.panel,
                                    text="locus",
                                    variable=self.id_mode,
                                    value="locus")
        radio.grid(row=0, column=8, sticky="NSW", padx=self.p, pady=self.p)
        self.unalign = tkinter.BooleanVar()
        self.unalign.set(False)
        c = tkinter.Checkbutton(self.output_frame.panel,
                                text="Unalign",
                                variable=self.unalign)
        c.grid(row=0, column=9, sticky="NSW", padx=self.p, pady=self.p)

        central_panel.add(self.output_frame)
Esempio n. 7
0
    def create_UI(self):
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)
        central_panel = tkinter.PanedWindow(self,
                                            orient=tkinter.HORIZONTAL,
                                            sashwidth=self.p * 2,
                                            sashrelief=tkinter.RIDGE,
                                            background=self.host.back)
        central_panel.grid(row=0, column=0, sticky="NSEW")

        self.hmmresults_COG = Aln_basic.TextFrameWithLabelAndButton(
            central_panel, self.p, None, None, "HMMer (COG):", "")
        self.hmmresults_COG.button.grid_forget()
        central_panel.add(self.hmmresults_COG)

        self.hmmresults_Pfam = Aln_basic.TextFrameWithLabelAndButton(
            central_panel, self.p, None, None, "HMMer (Pfam):", "")
        self.hmmresults_Pfam.button.grid_forget()
        central_panel.add(self.hmmresults_Pfam)

        self.TMHMM_results = Aln_basic.TextFrameWithLabelAndButton(
            central_panel, self.p, None, None, "TMHMM results:", "Save")
        self.TMHMM_results.button.configure(command=self.save_TMHMM)
        central_panel.add(self.TMHMM_results)

        self.features = Aln_basic.TextFrameWithLabelAndButton(
            central_panel, self.p, None, None, "Resulting features:",
            "Save to file")
        self.features.button.configure(command=self.save_features)

        tkinter.Label(self.features.panel,
                      text="Max e-value:").grid(row=0, column=2, sticky="NSW")
        self.evalue_threshold = tkinter.Entry(self.features.panel, width=8)
        self.evalue_threshold.insert(tkinter.END, "1e-5")
        self.evalue_threshold.grid(row=0,
                                   column=3,
                                   sticky="NSW",
                                   padx=self.p,
                                   pady=self.p)

        tkinter.Label(self.features.panel,
                      text="Min overlap/max_domain_length (%):").grid(
                          row=0, column=4, sticky="NSW")
        self.overlap_threshold = tkinter.Entry(self.features.panel, width=3)
        self.overlap_threshold.insert(tkinter.END, "20")
        self.overlap_threshold.grid(row=0,
                                    column=5,
                                    sticky="NSW",
                                    padx=self.p,
                                    pady=self.p)

        self.feature_mode = tkinter.StringVar()
        self.feature_mode.set("COG")
        radio = tkinter.Radiobutton(self.features.panel,
                                    text="COG",
                                    variable=self.feature_mode,
                                    value="COG")
        radio.grid(row=0, column=6, sticky="NSW", padx=self.p, pady=self.p)
        radio = tkinter.Radiobutton(self.features.panel,
                                    text="Pfam",
                                    variable=self.feature_mode,
                                    value="Pfam")
        radio.grid(row=0, column=7, sticky="NSW", padx=self.p, pady=self.p)

        obtain = tkinter.Button(self.features.panel,
                                text="Obtain",
                                background=self.host.header,
                                foreground="#FFFFFF",
                                command=self.obtain_features)
        obtain.grid(row=0, column=8, sticky="NSW", padx=self.p, pady=self.p)
        central_panel.add(self.features)

        self.update_idletasks()
        central_panel.sash_place(0, 200, 1)
        central_panel.sash_place(1, 400, 1)
        central_panel.sash_place(2, 600, 1)