diff --git a/projet_texte/genome.py b/projet_texte/genome.py index 69ebdc5f96b87201fc8ecfe86d228c543f9e48d4..562e369830a3f25579d9fa1770dcf8946e64a29b 100644 --- a/projet_texte/genome.py +++ b/projet_texte/genome.py @@ -1,9 +1,11 @@ +# coding: utf-8 + from fileinput import filename from ftplib import FTP from turtle import end_fill from unittest import result import urllib -import requests +# import requests import re import os import pandas as pd diff --git a/projet_texte/interface.py b/projet_texte/interface.py index c8a818c2e72b86d6f5448b74b99135f30dcdd436..4ba3a7934bcaf93c28b92cd54af1d1c7f266b209 100644 --- a/projet_texte/interface.py +++ b/projet_texte/interface.py @@ -1,16 +1,32 @@ +# coding: utf-8 + import tkinter as tk import os import sys import subprocess +from tkinter import * +import tkinter.font as font +from uuid import RFC_4122 # --- functions --- def test(): - print("Hello World") + print(v.get()) + Selection(EtatCheckButton,resultat) p = subprocess.run("ls", shell=True, stdout=subprocess.PIPE) print(p.stdout.decode()) +def Selection(EtatCheckButton, resultat): + region = [] + for i in range (10): + # print(EtatCheckButton[i].get()) + # print("----------------") + if EtatCheckButton[i].get() == 1 : + # print(resultat[i]) + region.append(resultat[i]) + print(region) + # --- classes --- @@ -27,15 +43,75 @@ class Redirect(): root = tk.Tk() -text = tk.Text(root) -text.pack() +f = font.Font(size=18) +f.configure(underline=True) + +root.geometry("1200x800") +root.title('Projet Bioinformatique SDSC Groupe 1') +# root.configure(bg='lightblue') + + +label = Label(root, text="Sélectionner un Kingdom :") +label['font'] = f +label.place(x = 270, y = 60) + +v = StringVar() +v.set("Eukaryota") + +R1 = Radiobutton(root, text="Eukaryota", variable=v, value="Eukaryota") +R1.place(x = 270, y = 90) + +R2 = Radiobutton(root, text="Bacteria", variable=v, value="Bacteria") +R2.place(x = 370, y = 90) + +R3 = Radiobutton(root, text="Archaea", variable=v, value="Archaea") +R3.place(x = 470, y = 90) + +R4 = Radiobutton(root, text="Viruses", variable=v, value="Viruses") +R4.place(x = 570, y = 90) -button = tk.Button(root, text='TEST', command=test) -button.pack() +var1 = IntVar() + +resultat = ["CDS", "centromere", "intro", "mobile_element", "ncRNA", "rRNA", "telomere", "tRNA", "3'UTR", "5'UTR"] + + +label = Label(root, text="Les choix des régions fonctionnelles :") +label['font'] = f +label.place(x = 270, y = 180) + +EtatCheckButton =[0 for i in range (10)] +for i in range(10) : + EtatCheckButton[i] = IntVar() + +c1 = tk.Checkbutton(root, text="CDS", variable=EtatCheckButton[0], onvalue=1, offvalue=0) +c1.place(x = 270, y = 210) +c2 = tk.Checkbutton(root, text="centromere", variable=EtatCheckButton[1], onvalue=1, offvalue=0) +c2.place(x = 370, y = 210) +c3 = tk.Checkbutton(root, text="intro", variable=EtatCheckButton[2], onvalue=1, offvalue=0) +c3.place(x = 470, y = 210) +c4 = tk.Checkbutton(root, text="mobile_element", variable=EtatCheckButton[3], onvalue=1, offvalue=0) +c4.place(x = 570, y = 210) +c5 = tk.Checkbutton(root, text="ncRNA", variable=EtatCheckButton[4], onvalue=1, offvalue=0) +c5.place(x = 700, y = 210) +c6 = tk.Checkbutton(root, text="rRNA", variable=EtatCheckButton[5], onvalue=1, offvalue=0) +c6.place(x = 270, y = 230) +c7 = tk.Checkbutton(root, text="telomere", variable=EtatCheckButton[6], onvalue=1, offvalue=0) +c7.place(x = 370, y = 230) +c8 = tk.Checkbutton(root, text="tRNA", variable=EtatCheckButton[7], onvalue=1, offvalue=0) +c8.place(x = 470, y = 230) +c9 = tk.Checkbutton(root, text="3'UTR", variable=EtatCheckButton[8], onvalue=1, offvalue=0) +c9.place(x = 570, y = 230) +c10 = tk.Checkbutton(root, text="5'UTR", variable=EtatCheckButton[9], onvalue=1, offvalue=0) +c10.place(x = 670, y = 230) + +text = tk.Text(root, bg = "lightblue", width=200) +text.place(x = 0, y = 260) old_stdout = sys.stdout sys.stdout = Redirect(text) -root.mainloop() +button = tk.Button(root, text='Démarrer', command=test) +button.place(x = 600, y = 600) -sys.stdout = old_stdout + +root.mainloop() diff --git a/projet_texte/main.py b/projet_texte/main.py index 34e1163cecb0d0fab9251a0a7d62fd48d5aeabc2..6a2b0f12de022bd140b42789a0a68dae01f11e23 100644 --- a/projet_texte/main.py +++ b/projet_texte/main.py @@ -1,3 +1,5 @@ +# coding: utf-8 + from cgitb import handler from fileinput import filename from re import sub