akikuno / DAJIN2

🔬 Genotyping tool for genome-edited samples, utilizing nanopore sequencer target sequencing
MIT License
7 stars 0 forks source link

GUI implementation #35

Open akikuno opened 1 month ago

akikuno commented 1 month ago

Describe the features you want.

GUI implementation of DAJIN2.

Describe the solution you'd like if you have any.

Create a GUI that runs on localhost using Flask or streamlit. The GUI should automatically launch with the DAJIN2 gui command, allowing users to upload FASTQ files and perform other tasks through the GUI.

akikuno commented 1 month ago

Currently, Streamlit and Flask are difficult to obtain the directory path, which is the input for DAJIN2 (v0.4.6).

While it is possible to obtain the directory path using tkinter.filedialog.askdirectory, the appearance is so poor that it is not worth using.

In Dorado, the output is a BAM file, so it is possible to handle it with Flask as it involves obtaining a path rather than a directory. Although Guppy's output is a directory, it would be better to align with Dorado's format for consistency. #37

akikuno commented 3 weeks ago

Flet looks good.

https://flet.dev/

It can select a directry.

import flet as ft
import os

def main(page: ft.Page):
    page.title = "Folder Picker Example"

    def pick_folder(e):
        file_picker.get_directory_path()

    def folder_picked(e: ft.FilePickerResultEvent):
        if e.path:
            selected_folder.value = os.path.abspath(e.path)
            page.update()

    file_picker = ft.FilePicker(on_result=folder_picked)
    page.overlay.append(file_picker)

    pick_folder_button = ft.ElevatedButton("Pick a Folder", on_click=pick_folder)
    selected_folder = ft.Text("No folder selected")

    page.add(pick_folder_button, selected_folder)

ft.app(target=main)
akikuno commented 2 weeks ago

In the case of Dorado, it is simpler to specify the file directly, and it is easier to create a GUI.

Given that the default basecaller in MinKNOW has become Dorado, it might be more convenient for DAJIN2 to adopt a format where the path to BAM or FASTA files output by Dorado is specified directly as default.

Additionally, by including the -d/--directory option, users could select the directory path, which could enhance usability.