Skip to content

Commit

Permalink
Merge pull request #35 from Breeding-Insight/development
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
alex-sandercock authored Aug 16, 2024
2 parents dd55c44 + 76d907d commit e75b475
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 27 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -52,7 +52,6 @@ Imports:
AGHmatrix,
factoextra,
future,
methods,
shinycssloaders,
RColorBrewer,
tibble,
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions R/mod_GSAcc.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
16 changes: 7 additions & 9 deletions R/mod_dapc.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand All @@ -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)

Expand Down Expand Up @@ -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",
Expand All @@ -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)

Expand Down Expand Up @@ -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({
Expand Down
35 changes: 21 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# (B)reeding (I)nsight (G)enomics app
<!-- badges: start -->
[![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)
<!-- badges: end -->

# (B)reeding (I)nsight (G)enomics app <img src="https://github.com/user-attachments/assets/60955106-fa99-4495-9c8a-c6a7d0b5ed48" align="right" width="250"/>

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:
Expand All @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit e75b475

Please sign in to comment.