From 2e2890261f66b9937f7d17615d9d5b99cf76d4a6 Mon Sep 17 00:00:00 2001 From: Cristianetaniguti Date: Tue, 28 Apr 2026 17:02:18 -0400 Subject: [PATCH] rm Qploidy --- DESCRIPTION | 2 +- NEWS.md | 4 + R/app_server.R | 20 +-- R/app_ui.R | 20 +-- R/mod_help.R | 38 +++--- R/mod_install.R | 340 ++++++++++++++++++++++++------------------------ 6 files changed, 214 insertions(+), 210 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index cda87c2..5a3d0fb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: Breedverse Title: Collection of R Shiny Packages From Breeding Insight -Version: 0.3.0 +Version: 0.3.1 Authors@R: c(person(given='Cristiane', family='Taniguti', email = 'ctaniguti@ufl.edu', diff --git a/NEWS.md b/NEWS.md index e74ee9e..bdaba30 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # breedverse NEWS +## breedverse 0.3.1 + +* Remove Qploidy while it is going throught repository transition + ## breedverse 0.3.0 * Add GenoBrew diff --git a/R/app_server.R b/R/app_server.R index 9ab8415..ce59be8 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -14,9 +14,9 @@ app_server <- function(input, output, session) { options(shiny.maxRequestSize = 1000000 * 1024^2) # Set maximum upload size to 1000GB #shiny.maxRequestSize = 10000 * 1024^2; # 10 GB <- This is for a future limit when using BI's server remotely - output$qploidyInstalled <- reactive({ - "Qploidy" %in% rownames(installed.packages()) - }) + # output$qploidyInstalled <- reactive({ + # "Qploidy" %in% rownames(installed.packages()) + # }) output$BIGappInstalled <- reactive({ "BIGapp" %in% rownames(installed.packages()) @@ -35,7 +35,7 @@ app_server <- function(input, output, session) { }) # Expose the value to JS even when panel is hidden - outputOptions(output, "qploidyInstalled", suspendWhenHidden = FALSE) + # outputOptions(output, "qploidyInstalled", suspendWhenHidden = FALSE) outputOptions(output, "BIGappInstalled", suspendWhenHidden = FALSE) outputOptions(output, "familiaInstalled", suspendWhenHidden = FALSE) outputOptions(output, "allomateInstalled", suspendWhenHidden = FALSE) @@ -55,12 +55,12 @@ app_server <- function(input, output, session) { parent_session = session) ## Qploidy - if(isTRUE(requireNamespace("Qploidy", quietly = TRUE))) { - do.call("library", list("Qploidy")) - callModule(getFromNamespace("mod_qploidy_server", "Qploidy"), - "qploidy_1", - parent_session = session) - } + # if(isTRUE(requireNamespace("Qploidy", quietly = TRUE))) { + # do.call("library", list("Qploidy")) + # callModule(getFromNamespace("mod_qploidy_server", "Qploidy"), + # "qploidy_1", + # parent_session = session) + # } ## BIGapp diff --git a/R/app_ui.R b/R/app_ui.R index f9aa4cd..b59e714 100644 --- a/R/app_ui.R +++ b/R/app_ui.R @@ -58,11 +58,11 @@ app_ui <- function(request) { menuItem("Home", tabName = "welcome", icon = icon("house"),startExpanded = FALSE), menuItem("Install modules", tabName = "install", icon = icon("share-from-square")), - conditionalPanel( - condition = "output.qploidyInstalled == true", - tags$li(class = "header", style = "color: grey; margin-top: 18px; margin-bottom: 10px; padding-left: 15px;", "Ploidy Estimation"), - menuItem("Qploidy", tabName = "qploidy", icon = icon("dna")), - ), + # conditionalPanel( + # condition = "output.qploidyInstalled == true", + # tags$li(class = "header", style = "color: grey; margin-top: 18px; margin-bottom: 10px; padding-left: 15px;", "Ploidy Estimation"), + # menuItem("Qploidy", tabName = "qploidy", icon = icon("dna")), + # ), conditionalPanel( condition = "output.familiaInstalled == true", @@ -151,11 +151,11 @@ app_ui <- function(request) { tabItem( tabName = "install", mod_install_ui("install_1") ), - tabItem( - tabName = "qploidy", - if(isTRUE(requireNamespace("Qploidy", quietly = TRUE))) - getFromNamespace("mod_qploidy_ui", "Qploidy")("qploidy_1") - ), + # tabItem( + # tabName = "qploidy", + # if(isTRUE(requireNamespace("Qploidy", quietly = TRUE))) + # getFromNamespace("mod_qploidy_ui", "Qploidy")("qploidy_1") + # ), tabItem( tabName = "snmf", if(isTRUE(requireNamespace("familia", quietly = TRUE))) diff --git a/R/mod_help.R b/R/mod_help.R index 4c1b2b2..9bb508d 100644 --- a/R/mod_help.R +++ b/R/mod_help.R @@ -13,23 +13,23 @@ mod_help_ui <- function(id){ fluidPage( column(width=12), column(width=12, - conditionalPanel( - condition = "output.qploidyInstalled == true", - box(title="Ploidy Estimation", id = "Qploidy_box",width = 12, collapsible = TRUE, collapsed = TRUE, status = "info", solidHeader = TRUE, - "This tab uses Qploidy package to standardize marker allele counts to estimate ploidy or aneuploidy.", - br(), br(), - bs4Dash::tabsetPanel(id = "Qploidy_tabset", - tabPanel("Parameters description", value = "Qploidy_par", br(), - includeMarkdown(system.file("help_files/Qploidy_par.Rmd", package = "Qploidy")) - ), - tabPanel("Results description", value = "Qploidy_results", br(), - includeMarkdown(system.file("help_files/Qploidy_res.Rmd", package = "Qploidy")) - ), - tabPanel("How to cite", value = "Qploidy_cite", br(), - includeMarkdown(system.file("help_files/Qploidy_cite.Rmd", package = "Qploidy")) - )) - ) - ), + # conditionalPanel( + # condition = "output.qploidyInstalled == true", + # box(title="Ploidy Estimation", id = "Qploidy_box",width = 12, collapsible = TRUE, collapsed = TRUE, status = "info", solidHeader = TRUE, + # "This tab uses Qploidy package to standardize marker allele counts to estimate ploidy or aneuploidy.", + # br(), br(), + # bs4Dash::tabsetPanel(id = "Qploidy_tabset", + # tabPanel("Parameters description", value = "Qploidy_par", br(), + # includeMarkdown(system.file("help_files/Qploidy_par.Rmd", package = "Qploidy")) + # ), + # tabPanel("Results description", value = "Qploidy_results", br(), + # includeMarkdown(system.file("help_files/Qploidy_res.Rmd", package = "Qploidy")) + # ), + # tabPanel("How to cite", value = "Qploidy_cite", br(), + # includeMarkdown(system.file("help_files/Qploidy_cite.Rmd", package = "Qploidy")) + # )) + # ) + # ), conditionalPanel( condition = "output.BIGappInstalled == true", box(title="Convert to VCF", id = "DArT_Report2VCF_box",width = 12, collapsible = TRUE, collapsed = TRUE, status = "info", solidHeader = TRUE, @@ -170,9 +170,9 @@ mod_help_ui <- function(id){ #' #' @noRd mod_help_server <- function(input, output, session, parent_session){ - + ns <- session$ns - + } ## To be copied in the UI diff --git a/R/mod_install.R b/R/mod_install.R index 9952ee4..301f845 100644 --- a/R/mod_install.R +++ b/R/mod_install.R @@ -71,7 +71,7 @@ mod_install_ui <- function(id) { fluidPage( fluidRow( class = "install-row", - # --- Qploidy card ---------------------------------------------------- + # --- GenoBrew card ---------------------------------------------------- column( width = 6, div( @@ -79,7 +79,7 @@ mod_install_ui <- function(id) { # Already installed conditionalPanel( - condition = sprintf("output['%s'] == true", ns("qploidyInstalled")), + condition = sprintf("output['%s'] == true", ns("genobrewInstalled")), div( class = "install-header", h3(class = "install-title", div( @@ -87,16 +87,16 @@ mod_install_ui <- function(id) { tags$div( style = "display:flex; align-items:center;", tags$img( - src = "www/Qploidy_logo.png", + src = "www/GenoBrew_logo.png", height = "100px", style = "margin-right:8px;" ), - h3(class = "install-title", "Qploidy") + h3(class = "install-title", "GenoBrew") ), )), span("Installed", class = "install-status-badge install-status-ok") ), - p(tags$a(href = "https://github.com/Cristianetaniguti/Qploidy", target = "_blank", + p(tags$a(href = "https://github.com/Breeding-Insight/GenoBrew", target = "_blank", icon("github"), " GitHub Repository")), tagList( p("Features:"), @@ -108,12 +108,12 @@ mod_install_ui <- function(id) { ), br() ), - p("Qploidy is installed. You can access ploidy estimation features in the app.") + p("GenoBrew is installed. You can access ploidy estimation features in the app.") ), # Not installed conditionalPanel( - condition = sprintf("output['%s'] == false", ns("qploidyInstalled")), + condition = sprintf("output['%s'] == false", ns("genobrewInstalled")), div( class = "install-header", h3(class = "install-title", div( @@ -121,33 +121,33 @@ mod_install_ui <- function(id) { tags$div( style = "display:flex; align-items:center;", tags$img( - src = "www/Qploidy_logo.png", + src = "www/GenoBrew_logo.png", height = "100px", style = "margin-right:8px;" ), - h3(class = "install-title", "Qploidy") + h3(class = "install-title", "GenoBrew") ), )), span("Not installed", class = "install-status-badge install-status-missing") ), - p(tags$a(href = "https://github.com/Cristianetaniguti/Qploidy", target = "_blank", + p(tags$a(href = "https://github.com/Breeding-Insight/GenoBrew", target = "_blank", icon("github"), " GitHub Repository")), tagList( p("Features:"), tags$ul( - tags$li("Allele intensities/read counts standardization"), - tags$li("Sample ploidy estimation"), - tags$li("Aneuploidy detection"), - tags$li("Multipoint (HMM) copy number estimation (beta)") + tags$li("Test marker panel performance with historical data"), + tags$li("Markers basic filters"), + tags$li("Interactive visualization of Qploidy2 CNV profiles results"), + tags$li("Find copy number variation hostspots in the genome") ), br() ), - p("Install the Qploidy package to enable ploidy estimation workflows."), + p("Install the GenoBrew package to enable marker panel tests and CNV visualization workflows."), div( style = "margin-top: 12px; margin-bottom: 10px;", actionButton( - ns("install_qploidy"), - "Install Qploidy", + ns("install_genobrew"), + "Install GenoBrew", icon = icon("download") ) ) @@ -157,10 +157,100 @@ mod_install_ui <- function(id) { tags$label("Installation log"), div( class = "install-log", - uiOutput(ns("install_log_qploidy")) + uiOutput(ns("install_log_genobrew")) ) ) ), + # --- Qploidy card ---------------------------------------------------- + # column( + # width = 6, + # div( + # class = "install-card", + # + # # Already installed + # conditionalPanel( + # condition = sprintf("output['%s'] == true", ns("qploidyInstalled")), + # div( + # class = "install-header", + # h3(class = "install-title", div( + # class = "install-header", + # tags$div( + # style = "display:flex; align-items:center;", + # tags$img( + # src = "www/Qploidy_logo.png", + # height = "100px", + # style = "margin-right:8px;" + # ), + # h3(class = "install-title", "Qploidy") + # ), + # )), + # span("Installed", class = "install-status-badge install-status-ok") + # ), + # p(tags$a(href = "https://github.com/Cristianetaniguti/Qploidy", target = "_blank", + # icon("github"), " GitHub Repository")), + # tagList( + # p("Features:"), + # tags$ul( + # tags$li("Allele intensities/read counts standardization"), + # tags$li("Sample ploidy estimation"), + # tags$li("Aneuploidy detection"), + # tags$li("Multipoint (HMM) copy number estimation (beta)") + # ), + # br() + # ), + # p("Qploidy is installed. You can access ploidy estimation features in the app.") + # ), + # + # # Not installed + # conditionalPanel( + # condition = sprintf("output['%s'] == false", ns("qploidyInstalled")), + # div( + # class = "install-header", + # h3(class = "install-title", div( + # class = "install-header", + # tags$div( + # style = "display:flex; align-items:center;", + # tags$img( + # src = "www/Qploidy_logo.png", + # height = "100px", + # style = "margin-right:8px;" + # ), + # h3(class = "install-title", "Qploidy") + # ), + # )), + # span("Not installed", class = "install-status-badge install-status-missing") + # ), + # p(tags$a(href = "https://github.com/Cristianetaniguti/Qploidy", target = "_blank", + # icon("github"), " GitHub Repository")), + # tagList( + # p("Features:"), + # tags$ul( + # tags$li("Allele intensities/read counts standardization"), + # tags$li("Sample ploidy estimation"), + # tags$li("Aneuploidy detection"), + # tags$li("Multipoint (HMM) copy number estimation (beta)") + # ), + # br() + # ), + # p("Install the Qploidy package to enable ploidy estimation workflows."), + # div( + # style = "margin-top: 12px; margin-bottom: 10px;", + # actionButton( + # ns("install_qploidy"), + # "Install Qploidy", + # icon = icon("download") + # ) + # ) + # ), + # + # # Log (always visible) + # tags$label("Installation log"), + # div( + # class = "install-log", + # uiOutput(ns("install_log_qploidy")) + # ) + # ) + # ), # --- BIGapp card ----------------------------------------------------- column( @@ -436,96 +526,6 @@ mod_install_ui <- function(id) { uiOutput(ns("install_log_allomate")) ) ) - ), - # --- GenoBrew card ---------------------------------------------------- - column( - width = 6, - div( - class = "install-card", - - # Already installed - conditionalPanel( - condition = sprintf("output['%s'] == true", ns("genobrewInstalled")), - div( - class = "install-header", - h3(class = "install-title", div( - class = "install-header", - tags$div( - style = "display:flex; align-items:center;", - tags$img( - src = "www/GenoBrew_logo.png", - height = "100px", - style = "margin-right:8px;" - ), - h3(class = "install-title", "GenoBrew") - ), - )), - span("Installed", class = "install-status-badge install-status-ok") - ), - p(tags$a(href = "https://github.com/Breeding-Insight/GenoBrew", target = "_blank", - icon("github"), " GitHub Repository")), - tagList( - p("Features:"), - tags$ul( - tags$li("Allele intensities/read counts standardization"), - tags$li("Sample ploidy estimation"), - tags$li("Aneuploidy detection"), - tags$li("Multipoint (HMM) copy number estimation (beta)") - ), - br() - ), - p("GenoBrew is installed. You can access ploidy estimation features in the app.") - ), - - # Not installed - conditionalPanel( - condition = sprintf("output['%s'] == false", ns("genobrewInstalled")), - div( - class = "install-header", - h3(class = "install-title", div( - class = "install-header", - tags$div( - style = "display:flex; align-items:center;", - tags$img( - src = "www/GenoBrew_logo.png", - height = "100px", - style = "margin-right:8px;" - ), - h3(class = "install-title", "GenoBrew") - ), - )), - span("Not installed", class = "install-status-badge install-status-missing") - ), - p(tags$a(href = "https://github.com/Breeding-Insight/GenoBrew", target = "_blank", - icon("github"), " GitHub Repository")), - tagList( - p("Features:"), - tags$ul( - tags$li("Test marker panel performance with historical data"), - tags$li("Markers basic filters"), - tags$li("Interactive visualization of Qploidy2 CNV profiles results"), - tags$li("Find copy number variation hostspots in the genome") - ), - br() - ), - p("Install the GenoBrew package to enable marker panel tests and CNV visualization workflows."), - div( - style = "margin-top: 12px; margin-bottom: 10px;", - actionButton( - ns("install_genobrew"), - "Install GenoBrew", - icon = icon("download") - ) - ) - ), - - # Log (always visible) - tags$label("Installation log"), - div( - class = "install-log", - uiOutput(ns("install_log_genobrew")) - ) - ) ) ) #Closing fluidrow parentheses ) @@ -540,9 +540,9 @@ mod_install_server <- function(input, output, session, parent_session){ ns <- session$ns # --- reactive installation flags --------------------------------------- - qploidy_installed <- reactiveVal( - requireNamespace("Qploidy", quietly = TRUE) - ) + # qploidy_installed <- reactiveVal( + # requireNamespace("Qploidy", quietly = TRUE) + # ) familia_installed <- reactiveVal( requireNamespace("familia", quietly = TRUE) ) @@ -556,8 +556,8 @@ mod_install_server <- function(input, output, session, parent_session){ requireNamespace("GenoBrew", quietly = TRUE) ) - output$qploidyInstalled <- reactive({ qploidy_installed() }) - outputOptions(output, "qploidyInstalled", suspendWhenHidden = FALSE) + # output$qploidyInstalled <- reactive({ qploidy_installed() }) + # outputOptions(output, "qploidyInstalled", suspendWhenHidden = FALSE) output$familiaInstalled <- reactive({ familia_installed() }) outputOptions(output, "familiaInstalled", suspendWhenHidden = FALSE) @@ -572,7 +572,7 @@ mod_install_server <- function(input, output, session, parent_session){ outputOptions(output, "genobrewInstalled", suspendWhenHidden = FALSE) # Initialize logs as empty - output$install_log_qploidy <- renderUI(NULL) + # output$install_log_qploidy <- renderUI(NULL) output$install_log_BIGapp <- renderUI(NULL) output$install_log_familia <- renderUI(NULL) output$install_log_allomate <- renderUI(NULL) @@ -580,62 +580,62 @@ mod_install_server <- function(input, output, session, parent_session){ # --- Qploidy installation ---------------------------------------------- - observeEvent(input$install_qploidy, { - err_msg <- NULL - ok <- FALSE - log_lines <- character(0) - - output$install_log_qploidy <- renderUI(NULL) - - withProgress(message = "Installing Qploidy", value = 0, { - - capture_msg <- function(m) { - log_lines <<- c(log_lines, conditionMessage(m)) - output$install_log_qploidy <- renderUI( - pre(style = "font-size:11px; white-space:pre-wrap;", - paste(log_lines, collapse = "")) - ) - invokeRestart("muffleMessage") - } - - withCallingHandlers( - tryCatch({ - if (!requireNamespace("remotes", quietly = TRUE)) { - incProgress(0.05, detail = "Installing remotes...") - install.packages("remotes") - } - incProgress(0.1, detail = "Contacting GitHub...") - remotes::install_github( - "Cristianetaniguti/Qploidy", - upgrade = "never", - quiet = FALSE - ) - incProgress(0.9, detail = "Verifying...") - ok <- requireNamespace("Qploidy", quietly = TRUE) - incProgress(1, detail = "Done") - }, error = function(e) { - err_msg <<- conditionMessage(e) - }), - message = capture_msg - ) - }) - - if (ok) { - qploidy_installed(TRUE) - showNotification("Qploidy installed successfully.", type = "message", duration = 8) - output$install_log_qploidy <- renderUI(HTML( - paste0(if (length(log_lines)) paste0('
', paste(log_lines, collapse=""), '
'), - 'Qploidy installation completed. Restart the app to load Qploidy features.') - )) - } else { - showNotification("Qploidy installation failed. See log below.", type = "error", duration = NULL) - output$install_log_qploidy <- renderUI( - pre(style = "font-size:11px; white-space:pre-wrap; color:#c62828;", - if (is.null(err_msg)) "Unknown error (check server permissions/logs)." else - paste(c(log_lines, err_msg), collapse = "")) - ) - } - }) + # observeEvent(input$install_qploidy, { + # err_msg <- NULL + # ok <- FALSE + # log_lines <- character(0) + # + # output$install_log_qploidy <- renderUI(NULL) + # + # withProgress(message = "Installing Qploidy", value = 0, { + # + # capture_msg <- function(m) { + # log_lines <<- c(log_lines, conditionMessage(m)) + # output$install_log_qploidy <- renderUI( + # pre(style = "font-size:11px; white-space:pre-wrap;", + # paste(log_lines, collapse = "")) + # ) + # invokeRestart("muffleMessage") + # } + # + # withCallingHandlers( + # tryCatch({ + # if (!requireNamespace("remotes", quietly = TRUE)) { + # incProgress(0.05, detail = "Installing remotes...") + # install.packages("remotes") + # } + # incProgress(0.1, detail = "Contacting GitHub...") + # remotes::install_github( + # "Cristianetaniguti/Qploidy", + # upgrade = "never", + # quiet = FALSE + # ) + # incProgress(0.9, detail = "Verifying...") + # ok <- requireNamespace("Qploidy", quietly = TRUE) + # incProgress(1, detail = "Done") + # }, error = function(e) { + # err_msg <<- conditionMessage(e) + # }), + # message = capture_msg + # ) + # }) + # + # if (ok) { + # qploidy_installed(TRUE) + # showNotification("Qploidy installed successfully.", type = "message", duration = 8) + # output$install_log_qploidy <- renderUI(HTML( + # paste0(if (length(log_lines)) paste0('
', paste(log_lines, collapse=""), '
'), + # 'Qploidy installation completed. Restart the app to load Qploidy features.') + # )) + # } else { + # showNotification("Qploidy installation failed. See log below.", type = "error", duration = NULL) + # output$install_log_qploidy <- renderUI( + # pre(style = "font-size:11px; white-space:pre-wrap; color:#c62828;", + # if (is.null(err_msg)) "Unknown error (check server permissions/logs)." else + # paste(c(log_lines, err_msg), collapse = "")) + # ) + # } + # }) # --- Familia installation ---------------------------------------------- observeEvent(input$install_familia, {