diff --git a/DESCRIPTION b/DESCRIPTION index 2173cba..29f411a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: BIGapp Title: Breeding Insight Genomics Shiny Application -Version: 0.5.0 +Version: 0.5.1 Authors@R: c( person(c("Alexander", "M."), "Sandercock", @@ -52,7 +52,6 @@ Imports: AGHmatrix, factoextra, future, - methods, shinycssloaders, RColorBrewer, tibble, diff --git a/NAMESPACE b/NAMESPACE index ff4abd2..36375a3 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -69,7 +69,6 @@ importFrom(graphics,strwidth) importFrom(graphics,text) importFrom(graphics,title) importFrom(matrixcalc,is.positive.definite) -importFrom(methods,new) importFrom(plotly,add_markers) importFrom(plotly,layout) importFrom(plotly,plot_ly) diff --git a/R/app_ui.R b/R/app_ui.R index e381e4f..fa1a5d8 100644 --- a/R/app_ui.R +++ b/R/app_ui.R @@ -74,7 +74,7 @@ app_ui <- function(request) { ), left = div( style = "display: flex; align-items: center; height: 100%;", # Center the version text vertically - "v0.5.0") + "v0.5.1") ), dashboardBody( disconnectMessage(), #Adds generic error message for any error if not already accounted for diff --git a/R/mod_GSAcc.R b/R/mod_GSAcc.R index 84f2440..18f544c 100644 --- a/R/mod_GSAcc.R +++ b/R/mod_GSAcc.R @@ -791,6 +791,7 @@ mod_GSAcc_server <- function(id){ validate( need(!is.null(pred_outputs$avg_GEBVs), "Upload the input files, set the parameters and click 'run analysis' to access results in this session.") ) + pred_outputs$avg_GEBVs }) output$pred_gebvs_table <- renderDT({avg_GEBVs()}, options = list(scrollX = TRUE,autoWidth = FALSE, pageLength = 5)) diff --git a/R/mod_dapc.R b/R/mod_dapc.R index 1cae27c..7670e2d 100644 --- a/R/mod_dapc.R +++ b/R/mod_dapc.R @@ -103,11 +103,9 @@ mod_dapc_ui <- function(id){ #' dapc Server Functions #' @import grDevices -#' @importFrom methods new #' @importFrom graphics axis #' @importClassesFrom adegenet genlight #' @importFrom adegenet find.clusters dapc optim.a.score pop<- nInd scatter.dapc -#' @importFrom methods new #' @importFrom vcfR read.vcfR extract.gt #' @importFrom stats BIC as.formula lm logLik median model.matrix na.omit prcomp qbeta quantile runif sd setNames #' @noRd @@ -129,7 +127,7 @@ mod_dapc_server <- function(id){ observeEvent(input$K_start, { toggleClass(id = "dapc_ploidy", class = "borderred", condition = (is.na(input$dapc_ploidy) | is.null(input$dapc_ploidy))) - if (is.null(input$dosage_file1$datapath)) { + if (is.null(input$dosage_file$datapath)) { shinyalert( title = "Missing input!", text = "Upload VCF File", @@ -145,11 +143,11 @@ mod_dapc_server <- function(id){ animation = TRUE ) } - req(input$dosage_file1$datapath, input$dapc_ploidy) + req(input$dosage_file$datapath, input$dapc_ploidy) ploidy <- as.numeric(input$dapc_ploidy) maxK <- as.numeric(input$dapc_kmax) - geno <- input$dosage_file1$datapath + geno <- input$dosage_file$datapath ##Add in VCF with the vcfR package (input VCF, then convert to genlight using vcf2genlight function) @@ -185,11 +183,10 @@ mod_dapc_server <- function(id){ observeEvent(input$dapc_start, { - if(is.null(input$dosage_file2)) dosage_file2 <- input$dosage_file1$datapath toggleClass(id = "dapc_ploidy", class = "borderred", condition = (is.na(input$dapc_ploidy) | is.null(input$dapc_ploidy))) toggleClass(id = "dapc_k", class = "borderred", condition = (is.na(input$dapc_k) | is.null(input$dapc_k))) - if (is.null(dosage_file2)) { + if (is.null(input$dosage_file$datapath)) { shinyalert( title = "Missing input!", text = "Upload VCF File", @@ -205,9 +202,9 @@ mod_dapc_server <- function(id){ animation = TRUE ) } - req(dosage_file2, input$dapc_ploidy, input$dapc_k) + req(input$dosage_file$datapath, input$dapc_ploidy, input$dapc_k) - geno <- dosage_file2 + geno <- input$dosage_file$datapath ploidy <- as.numeric(input$dapc_ploidy) selected_K <- as.numeric(input$dapc_k) @@ -312,6 +309,7 @@ mod_dapc_server <- function(id){ validate( need(!is.null(dapc_items$assignments), "Input VCF, define parameters and click `run analysis` in Step 2:(DAPC) to access results in this session.") ) + dapc_items$assignments }) output$DAPC_table <- renderDT({ diff --git a/README.md b/README.md index 97a4024..09ca3c4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,14 @@ -# (B)reeding (I)nsight (G)enomics app + +[![R-CMD-check](https://github.com/Breeding-Insight/BIGapp/workflows/R-CMD-check/badge.svg)](https://github.com/Breeding-Insight/BIGapp/actions) +[![Development](https://img.shields.io/badge/development-active-blue.svg)](https://img.shields.io/badge/development-active-blue.svg) + + +# (B)reeding (I)nsight (G)enomics app Currently, Breeding Insight provides bioinformatic processing support for our external collaborators. This R shiny app will provide a web-based user friendly way for our internal and external collaborators to analyze genomic data without needing to use command-line tools. ### Supported Analyses + Initial supported analyses will include the mature genomics/bioinformatics pipelines developed within Breeding Insight, with additional analyses continuing to be added. Supported: @@ -27,6 +33,9 @@ Supported: Tutorial available: https://scribehow.com/page/BIGapp_Tutorials__FdLsY9ZxQsi6kgT9p-U2Zg +Online preview: +https://big-demo.shinyapps.io/bigapp/ + **Local computer** 1. Install R 2. Open Terminal (on mac) @@ -41,25 +50,23 @@ BIGapp::run_app() **Online (in progress)** -## References +## Third-party software + The BIG app relies on both custom scripts and previously developed R packages cited below: -R: version 4.2.2 +* [R](): version 4.2.2 + +#### R packages + +* Shiny tools: [shiny](https://cran.r-project.org/web/packages/shiny/index.html), [shinyWidgets](https://cran.r-project.org/web/packages/shinyWidgets/index.html), [shinyalert](https://cran.r-project.org/web/packages/shinyalert/index.html), [shinyjs](https://cran.r-project.org/web/packages/shinyjs/index.html), [shinydisconnect](https://cran.r-project.org/web/packages/shinydisconnect/index.html), [shinycssloaders](https://cran.r-project.org/web/packages/shinycssloaders/index.html), [bs4Dash](https://cran.r-project.org/web/packages/bs4Dash/index.html), [DT](https://cran.r-project.org/web/packages/DT/index.html), [config](https://cran.r-project.org/web/packages/config/index.html) -required_cran_packages <- c("updog", "ggplot2","devtools","GWASpoly","SNPRelate", - "adegenet", "future", "scales", "AGHmatrix", "stats", - "factoextra", "readxl", "ggrepel", "dplyr", "shiny", - "shinydashboard","randomcoloR","plotly", "DT","RColorBrewer", - "dichromat", "bs4Dash", "shinyWidgets","data.table", - "matrixcalc","Matrix", "shinyalert","rrBLUP", "tidyverse", - "foreach", "doParallel","VariantAnnotation", "vcfR") +* Genetic analysis: [updog](https://cran.r-project.org/web/packages/updog/index.html), [GWASpoly](https://github.com/jendelman/GWASpoly), [AGHmatrix](https://cran.r-project.org/web/packages/AGHmatrix/index.html), [rrBLUP](https://cran.r-project.org/web/packages/rrBLUP/index.html), [BIGr](https://github.com/Breeding-Insight/BIGr), [adegenet](https://cran.r-project.org/web/packages/adegenet/index.html), [vcfR](https://cran.r-project.org/web/packages/vcfR/index.html) -required_bio_packages <- c("SNPRelate","VariantAnnotation") +* Data manipulation optimization: [dplyr](https://cran.r-project.org/web/packages/dplyr/index.html), [tidyr](https://cran.r-project.org/web/packages/tidyr/index.html), [purrr](https://cran.r-project.org/web/packages/purrr/index.html), [stringr](https://cran.r-project.org/web/packages/stringr/index.html), [future](https://cran.r-project.org/web/packages/future/index.html), [tibble](https://cran.r-project.org/web/packages/tibble/vignettes/tibble.html) -Dev_tools_packages <- c("GWASpoly") +* Statistical analysis: [factoextra](https://cran.r-project.org/web/packages/factoextra/index.html), [MASS](https://cran.r-project.org/web/packages/MASS/index.html), [Matrix](https://cran.r-project.org/web/packages/Matrix/index.html), [matrixcalc](https://cran.r-project.org/web/packages/matrixcalc/index.html) -if (!require("BiocManager", quietly = TRUE)) - install.packages("BiocManager") +* Generate pretty graphics: [ggplot2](https://cran.r-project.org/web/packages/ggplot2/index.html), [scales](https://cran.r-project.org/web/packages/scales/index.html), [RColorBrewer](https://cran.r-project.org/web/packages/RColorBrewer/index.html), [plotly](https://cran.r-project.org/web/packages/plotly/index.html) ## Funding Sources