Skip to content

Commit

Permalink
Merge branch 'main' into svg_add
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristianetaniguti authored Feb 7, 2025
2 parents 69f56fc + 1b19bad commit 8d2730c
Show file tree
Hide file tree
Showing 23 changed files with 769 additions and 395 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Imports:
markdown
Remotes:
github::jendelman/GWASpoly,
github::Breeding-Insight/BIGr
github::Breeding-Insight/BIGr,
bioc::release/Rsamtools
Suggests:
testthat
47 changes: 47 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM rocker/r-ver:4.4.2
RUN apt-get update && apt-get install -y cmake libz-dev libcurl4-openssl-dev libssl-dev
RUN R -e 'install.packages("remotes")'
RUN Rscript -e 'remotes::install_version("adegenet",upgrade="never", version = "2.1.10")'
RUN Rscript -e 'remotes::install_version("curl",upgrade="never", version = "6.0.1")'
RUN Rscript -e 'remotes::install_version("DT",upgrade="never", version = "0.33")'
RUN Rscript -e 'remotes::install_version("dplyr",upgrade="never", version = "1.1.4")'
RUN Rscript -e 'remotes::install_version("vcfR",upgrade="never", version = "1.15.0")'
RUN Rscript -e 'remotes::install_version("ggplot2",upgrade="never", version = "3.5.1")'
RUN Rscript -e 'remotes::install_version("tidyr",upgrade="never", version = "1.3.1")'
RUN Rscript -e 'remotes::install_version("curl",upgrade="never", version = "6.0.1")'
RUN Rscript -e 'remotes::install_version("shiny",upgrade="never", version = "1.9.1")'
RUN Rscript -e 'remotes::install_version("config",upgrade="never", version = "0.3.2")'
RUN Rscript -e 'remotes::install_version("bs4Dash",upgrade="never", version = "2.3.4")'
RUN Rscript -e 'remotes::install_version("golem",upgrade="never", version = "0.5.1")'
RUN Rscript -e 'remotes::install_version("purrr",upgrade="never", version = "1.0.2")'
RUN Rscript -e 'remotes::install_version("markdown",upgrade="never", version = "1.13")'
RUN Rscript -e 'remotes::install_version("scales",upgrade="never", version = "1.3.0")'
RUN Rscript -e 'remotes::install_version("plotly",upgrade="never", version = "4.10.4")'
RUN Rscript -e 'remotes::install_version("shinyWidgets",upgrade="never", version = "0.8.7")'
RUN Rscript -e 'remotes::install_version("shinyjs",upgrade="never", version = "2.1.0")'
RUN Rscript -e 'remotes::install_version("shinydisconnect",upgrade="never", version = "0.1.1")'
RUN Rscript -e 'remotes::install_version("shinyalert",upgrade="never", version = "3.1.0")'
RUN Rscript -e 'remotes::install_version("stringr",upgrade="never", version = "1.5.1")'
RUN Rscript -e 'remotes::install_version("updog",upgrade="never", version = "2.1.5")'
RUN Rscript -e 'remotes::install_version("AGHmatrix",upgrade="never", version = "2.1.4")'
RUN Rscript -e 'remotes::install_version("factoextra",upgrade="never", version = "1.0.7")'
RUN Rscript -e 'remotes::install_version("httr",upgrade="never", version = "1.4.7")'
RUN Rscript -e 'remotes::install_version("future",upgrade="never", version = "1.34.0")'
RUN Rscript -e 'remotes::install_version("shinycssloaders",upgrade="never", version = "1.1.0")'
RUN Rscript -e 'remotes::install_version("RColorBrewer",upgrade="never", version = "1.1.3")'
RUN Rscript -e 'remotes::install_version("tibble",upgrade="never", version = "3.2.1")'
RUN Rscript -e 'remotes::install_version("rrBLUP",upgrade="never", version = "4.6.3")'
RUN Rscript -e 'remotes::install_version("MASS",upgrade="never", version = "7.3.60.2")'
RUN Rscript -e 'remotes::install_version("Matrix",upgrade="never", version = "1.7.0")'
RUN Rscript -e 'remotes::install_version("matrixcalc",upgrade="never", version = "1.0.6")'
RUN Rscript -e 'remotes::install_github("Breeding-Insight/BIGr",upgrade="never")'
RUN Rscript -e 'remotes::install_github("jendelman/GWASpoly",upgrade="never")'

RUN mkdir /build_zone
ADD . /build_zone
WORKDIR /build_zone
RUN R -e 'remotes::install_local(upgrade="never")'
RUN rm -rf /build_zone
EXPOSE 80
CMD R -e "options('shiny.port'=80,shiny.host='0.0.0.0');BIGapp::run_app()"

1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ importFrom(MASS,ginv)
importFrom(Matrix,nearPD)
importFrom(R.utils,gunzip)
importFrom(RColorBrewer,brewer.pal)
importFrom(Rsamtools,bgzip)
importFrom(adegenet,"pop<-")
importFrom(adegenet,dapc)
importFrom(adegenet,find.clusters)
Expand Down
29 changes: 12 additions & 17 deletions R/mod_DosageCall.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#'
#' @noRd
#'
#' @importFrom shinyjs enable disable useShinyjs
#' @importFrom shiny NS tagList
#' @importFrom future availableCores
#' @importFrom bs4Dash renderValueBox
Expand All @@ -16,6 +15,7 @@
mod_DosageCall_ui <- function(id){
ns <- NS(id)
tagList(
useShinyjs(),
fluidPage(
disconnectMessage(
text = "An unexpected error occurred, please reload the application and check the input file(s).",
Expand Down Expand Up @@ -134,8 +134,7 @@ mod_DosageCall_ui <- function(id){
)
),
actionButton(ns("run_analysis"), "Run Analysis"),
useShinyjs(),
downloadButton(ns('download_updog_vcf'), "Download VCF File", class = "butt"),
uiOutput(ns('mybutton')),

div(style="display:inline-block; float:right",dropdownButton(
HTML("<b>Input files</b>"),
Expand Down Expand Up @@ -167,7 +166,6 @@ mod_DosageCall_ui <- function(id){
#' @import vcfR
#' @import updog
#' @importFrom BIGr updog2vcf
#' @importFrom shinyjs enable disable
#' @import dplyr
#'
#' @noRd
Expand Down Expand Up @@ -254,6 +252,7 @@ mod_DosageCall_server <- function(input, output, session, parent_session){
disable("download_updog_vcf")

##This is for performing Dosage Calling

updog_out <- eventReactive(input$run_analysis,{
# Updog
if (input$Rpackage == "Updog") {
Expand Down Expand Up @@ -469,14 +468,9 @@ mod_DosageCall_server <- function(input, output, session, parent_session){
})

# Only make available the download button when analysis is finished
observe({
if (!is.null(updog_out())) {
Sys.sleep(1)
# enable the download button
enable("download_updog_vcf")
} else {
disable("download_updog_vcf")
}
output$mybutton <- renderUI({
if(isTruthy(updog_out()))
downloadButton(ns("download_updog_vcf"), "Download VCF file", class = "butt")
})

output$download_updog_vcf <- downloadHandler(
Expand All @@ -490,6 +484,7 @@ mod_DosageCall_server <- function(input, output, session, parent_session){

},
content = function(file) {

#Save Updog output as VCF file
temp <- tempfile()
if (input$Rpackage == "Updog") {
Expand Down Expand Up @@ -537,14 +532,14 @@ mod_DosageCall_server <- function(input, output, session, parent_session){
ex <- system.file("iris_DArT_MADC.csv", package = "BIGapp")
file.copy(ex, file)
})

##Summary Info
dosage_summary_info <- function() {
#Handle possible NULL values for inputs
genotype_file_name <- if (!is.null(input$madc_file$name)) input$madc_file$name else "No file selected"
report_file_name <- if (!is.null(input$madc_passport$name)) input$madc_passport$name else "No file selected"
selected_ploidy <- if (!is.null(input$ploidy)) as.character(input$ploidy) else "Not selected"

#Print the summary information
cat(
"BIGapp Dosage Calling Summary\n",
Expand Down Expand Up @@ -572,7 +567,7 @@ mod_DosageCall_server <- function(input, output, session, parent_session){
sep = ""
)
}

# Popup for analysis summary
observeEvent(input$dosage_summary, {
showModal(modalDialog(
Expand All @@ -588,8 +583,8 @@ mod_DosageCall_server <- function(input, output, session, parent_session){
)
))
})


# Download Summary Info
output$download_dosage_info <- downloadHandler(
filename = function() {
Expand Down
44 changes: 17 additions & 27 deletions R/mod_Filtering.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ mod_Filtering_ui <- function(id){
)
),
actionButton(ns("run_filters"), "Apply Filters"),
useShinyjs(),
downloadButton(ns("start_updog_filter"), "Download", icon = icon("download"), class = "butt"),
uiOutput(ns("mybutton")),
div(style="display:inline-block; float:right",dropdownButton(
HTML("<b>Input files</b>"),
p(downloadButton(ns('download_vcf'),""), "VCF Example File"),
Expand All @@ -75,8 +74,7 @@ mod_Filtering_ui <- function(id){
valueBoxOutput(ns("snp_removed_box"), width = NULL),
box(title = "Plot Controls", status = "warning", solidHeader = TRUE, collapsible = TRUE,
sliderInput(ns("hist_bins"),"Histogram Bins", min = 1, max = 1200, value = c(50), step = 1), width = NULL,
div(style="display:inline-block; float:left",dropdownButton(
tags$h3("Save Image"),
div(style="display:inline-block; float:left", dropdownButton(
selectInput(inputId = ns('filter_hist'), label = 'Figure', choices = c("Bias Histogram",
"OD Histogram",
"Prop_mis Histogram",
Expand All @@ -88,7 +86,7 @@ mod_Filtering_ui <- function(id){
sliderInput(inputId = ns('image_height'), label = 'Height', value = 5, min = 1, max = 20, step = 0.5),
downloadButton(ns("download_filter_hist"), "Save"),
circle = FALSE,
status = "danger",
status = "danger", label = "Save",
icon = icon("floppy-disk"), width = "300px",
tooltip = tooltipOptions(title = "Click to see inputs!")
))
Expand All @@ -112,37 +110,37 @@ mod_Filtering_ui <- function(id){
mod_Filtering_server <- function(input, output, session, parent_session){

ns <- session$ns

# Help links
observeEvent(input$goPar, {
# change to help tab
updatebs4TabItems(session = parent_session, inputId = "MainMenu",
selected = "help")

# select specific tab
updateTabsetPanel(session = parent_session, inputId = "VCF_Filtering_tabset",
selected = "VCF_Filtering_par")
# expand specific box
updateBox(id = "VCF_Filtering_box", action = "toggle", session = parent_session)
})

observeEvent(input$goRes, {
# change to help tab
updatebs4TabItems(session = parent_session, inputId = "MainMenu",
selected = "help")

# select specific tab
updateTabsetPanel(session = parent_session, inputId = "VCF_Filtering_tabset",
selected = "VCF_Filtering_results")
# expand specific box
updateBox(id = "VCF_Filtering_box", action = "toggle", session = parent_session)
})

observeEvent(input$goCite, {
# change to help tab
updatebs4TabItems(session = parent_session, inputId = "MainMenu",
selected = "help")

# select specific tab
updateTabsetPanel(session = parent_session, inputId = "VCF_Filtering_tabset",
selected = "VCF_Filtering_cite")
Expand Down Expand Up @@ -177,8 +175,6 @@ mod_Filtering_server <- function(input, output, session, parent_session){
)
})

disable("start_updog_filter")

output$din_tabs <- renderUI({
tabBox(width =12, collapsible = FALSE, status = "info",
id = "updog_tab", height = "600px",
Expand Down Expand Up @@ -351,17 +347,11 @@ mod_Filtering_server <- function(input, output, session, parent_session){
})

# Only make available the download button when analysis is finished
observe({
if (!is.null(vcf())) {
Sys.sleep(1)
# enable the download button
enable("start_updog_filter")
} else {
disable("start_updog_filter")
}
output$mybutton <- renderUI({
if(isTruthy(vcf()))
downloadButton(ns("start_updog_filter"), "Download VCF file", class = "butt")
})


#Updog filtering
output$start_updog_filter <- downloadHandler(
filename = function() {
Expand Down Expand Up @@ -671,13 +661,13 @@ mod_Filtering_server <- function(input, output, session, parent_session){
ex <- system.file("iris_DArT_VCF.vcf.gz", package = "BIGapp")
file.copy(ex, file)
})

##Summary Info
filtering_summary_info <- function() {
#Handle possible NULL values for inputs
genotype_file_name <- if (!is.null(input$updog_rdata$name)) input$updog_rdata$name else "No file selected"
selected_ploidy <- if (!is.null(input$filter_ploidy)) as.character(input$filter_ploidy) else "Not selected"

#Print the summary information
cat(
"BIGapp VCF Filtering Summary\n",
Expand Down Expand Up @@ -711,7 +701,7 @@ mod_Filtering_server <- function(input, output, session, parent_session){
sep = ""
)
}

# Popup for analysis summary
observeEvent(input$filtering_summary, {
showModal(modalDialog(
Expand All @@ -727,8 +717,8 @@ mod_Filtering_server <- function(input, output, session, parent_session){
)
))
})


# Download Summary Info
output$download_filtering_info <- downloadHandler(
filename = function() {
Expand Down
Loading

0 comments on commit 8d2730c

Please sign in to comment.