Ejemplo n.º 1
0
 def __init__(self, master):
     dm = DnaManager()
     rm = RnaManager()
     pm = ProteinManager()
     ps = ProteinSystem(dm, rm, pm)
     tk.Frame.__init__(self, master)
     tk.Label(self,
              text="Input DNA sequence without any spaces").pack(side="top",
                                                                 pady=20)
     entry = tk.Entry(self, width=50)
     entry.pack()
     label = ttk.Label(self, text="")
     label.pack()
     convert = tk.Button(
         self,
         text="Convert",
         command=lambda: [
             label.config(text=ps.get_mrna(entry.get()), wraplengt=500),
             copied.config(text="")
         ])
     convert.pack()
     copy = tk.Button(self,
                      text="Copy",
                      command=lambda: [
                          master.copy_to_clipboard(label.cget("text")),
                          copied.config(text="Copied to Clipboard")
                      ])
     copy.pack()
     tk.Button(self,
               text="Return to main page",
               command=lambda: master.frame_switch(MainPage)).pack()
     copied = tk.Label(self, text="")
     copied.pack(pady=10)
Ejemplo n.º 2
0
    def __init__(self, master):
        label_font = tk.font.Font(family="Courier New", size=8)
        dm = DnaManager()
        rm = RnaManager()
        pm = ProteinManager()
        ps = ProteinSystem(dm, rm, pm)
        tk.Frame.__init__(self, master)
        tk.Label(self, text="Input 1st protein sequence without any"
                 " spaces").pack(side="top", pady=10)
        entry1 = tk.Entry(self, width=50)
        entry1.pack()
        tk.Label(self, text="Input 2nd protein sequence without any "
                 "spaces").pack(side="top", pady=10)
        entry2 = tk.Entry(self, width=50)
        entry2.pack()

        label = ttk.Label(self, text="")
        label.pack(anchor='w')
        label.config(font=label_font)
        align = tk.Button(self,
                          text="Align",
                          command=lambda: [
                              label.config(text=ps.compare_protein(
                                  entry1.get(), entry2.get()),
                                           wraplengt=500)
                          ])
        align.pack()
        tk.Button(self,
                  text="Return to main page",
                  command=lambda: master.frame_switch(MainPage)).pack()