-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
154 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
if (!requireNamespace("BiocManager", quietly = TRUE)) | ||
install.packages("BiocManager") | ||
BiocManager::install(version = "3.14") | ||
devtools::install_github("tidyverse/tidyverse") | ||
library(shiny) | ||
library(shinydisconnect) | ||
library(ggplot2) | ||
library(stringr) | ||
library(dplyr) | ||
library(tidyr) | ||
library(forcats) | ||
library(patchwork) | ||
library(glue) | ||
library(ggpubr) | ||
library(writexl) | ||
library(snpStats) | ||
BiocManager::install("snpStats") | ||
library(writexl) | ||
library(snpStats) | ||
library(IRanges) | ||
BiocManager::install(c("IRanges","ape","LDheatmap","pegas","ggtree")) | ||
options(warn = -1") | ||
BiocManager::install("shiny") | ||
BiocManager::install("shinydisconnect") | ||
library(IRanges) | ||
library(LDheatmap) | ||
library(ape) | ||
library(pegas) | ||
library(gridExtra) | ||
library(grid) | ||
library(ggtree) | ||
library(shinycssloaders) | ||
library(shinysky) | ||
devtools::install_github("AnalytixWare/ShinySky") | ||
library(shinydashboard) | ||
library(shinyWidgets) | ||
library(gggenes) | ||
library(DT) | ||
library(shinythemes) | ||
library(NAM) | ||
library(adegenet) | ||
library(rmarkdown) | ||
library(rvg) | ||
library(officer) | ||
source("script/mod_ldheatmap.R") | ||
source("script/mod_snpdistribution.R") | ||
source("script/mod_phylogenetics.R") | ||
source("script/mod_diversity.R") | ||
source("script/mod_extraction.R") | ||
source("script/mod_documentation.R") | ||
source("script/mod_about.R") | ||
source("script/extractsnp.R") | ||
source("script/extractallele.R") | ||
source("script/ldheatmap.R") | ||
source("script/genestru.viz.R") | ||
source("script/chooser.R") | ||
source("script/readNewData.R") | ||
#' @param rightLabel | ||
#' @param leftChoices | ||
#' @param rightChoices | ||
#' @param size | ||
#' @param multiple | ||
#' | ||
#' @return | ||
#' @export | ||
#' | ||
#' @examples | ||
chooserInput <- function(inputId, leftLabel, rightLabel, leftChoices, rightChoices, | ||
size = 2, multiple = FALSE) { | ||
leftChoices <- lapply(leftChoices, tags$option) | ||
rightChoices <- lapply(rightChoices, tags$option) | ||
if (multiple) { | ||
multiple <- "multiple" | ||
} else { | ||
multiple <- NULL | ||
} | ||
tagList( | ||
singleton(tags$head( | ||
tags$script(src = "css/chooser-binding.js"), | ||
tags$style( | ||
type = "text/css", | ||
HTML(".chooser-container { display: inline-block; }") | ||
) | ||
)), | ||
div( | ||
id = inputId, class = "chooser", | ||
div( | ||
class = "chooser-container chooser-left-container", | ||
tags$select(class = "left", size = size, multiple = multiple, leftChoices, style = "width:100px;background:gray50") | ||
), | ||
div( | ||
class = "chooser-container chooser-center-container", | ||
icon("arrow-alt-circle-right", "right-arrow fa-2x"), | ||
tags$br(), | ||
icon("arrow-alt-circle-left", "left-arrow fa-2x") | ||
), | ||
div( | ||
class = "chooser-container chooser-right-container", | ||
tags$select(class = "right", size = size, multiple = multiple, rightChoices, style = "width:100px;background:gray50") | ||
) | ||
) | ||
) | ||
} | ||
source("script/snp_distribution.R") | ||
shiny::runApp() | ||
BiocManager::install("markdown") | ||
runApp() | ||
runApp() | ||
rm(list=ls()) | ||
runApp() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
source("global.R") | ||
ui <- fluidPage( | ||
tags$script(src="css/addhash.js"), | ||
div(img(src = "img/bnasnpdb_logo.png")), | ||
includeCSS("www/css/custom.css"), | ||
includeCSS("www/css/footer.css"), | ||
disconnectMessage( | ||
text = "Your session timed out, reload the application!", | ||
refresh = "Reload now", | ||
background = "#f89f43", | ||
colour = "white", | ||
overlayColour = "grey", | ||
overlayOpacity = 0.75, | ||
top = 250, | ||
refreshColour = "brown" | ||
), | ||
navbarPage( | ||
title = "", | ||
windowTitle = "Welcome to BnaSNPDB", | ||
theme = shinytheme("flatly"), | ||
tabPanel("Home", homepage, icon = icon("home")), | ||
tabPanel("LDheatmap", mod_ldheatmap_ui("ld")), | ||
tabPanel("SNPdistribution", mod_snpdistribution_ui("dis")), | ||
tabPanel("Phylogenetics", mod_phylogenetics_ui("tree")), | ||
tabPanel("Diversity", mod_diversity_ui("diversity")), | ||
tabPanel("Extraction", mod_extraction_ui("extract"), icon = icon("search")), | ||
tabPanel("Documentation", mod_doc_ui("doc"), icon = icon("file-text")), | ||
tabPanel("About", mod_about_ui("about"), icon = icon("info-circle")), | ||
footer = footerTagList | ||
) | ||
) | ||
|
||
server <- function(input, output, session) { | ||
callModule(mod_ldheatmap_server, "ld") | ||
callModule(mod_snpdistribution_server, "dis") | ||
callModule(mod_phylogenetics_server, "tree") | ||
callModule(mod_diversity_server, "diversity") | ||
callModule(mod_extraction_server, "extract") | ||
observeEvent(input$disconnect, { | ||
session$close() | ||
}) | ||
} | ||
|
||
shinyApp(ui, server) | ||
source("global.R") | ||
ui <- fluidPage( | ||
tags$script(src="css/addhash.js"), | ||
div(img(src = "img/bnasnpdb_logo.png")), | ||
includeCSS("www/css/custom.css"), | ||
includeCSS("www/css/footer.css"), | ||
disconnectMessage( | ||
text = "Your session timed out, reload the application!", | ||
refresh = "Reload now", | ||
background = "#f89f43", | ||
colour = "white", | ||
overlayColour = "grey", | ||
overlayOpacity = 0.75, | ||
top = 250, | ||
refreshColour = "brown" | ||
), | ||
navbarPage( | ||
title = "", | ||
windowTitle = "Welcome to BnaSNPDB", | ||
theme = shinytheme("flatly"), | ||
tabPanel("Home", homepage, icon = icon("home")), | ||
tabPanel("LDheatmap", mod_ldheatmap_ui("ld")), | ||
tabPanel("SNPdistribution", mod_snpdistribution_ui("dis")), | ||
tabPanel("Phylogenetics", mod_phylogenetics_ui("tree")), | ||
tabPanel("Diversity", mod_diversity_ui("diversity")), | ||
tabPanel("Extraction", mod_extraction_ui("extract"), icon = icon("search")), | ||
tabPanel("Documentation", mod_doc_ui("doc"), icon = icon("file-alt")), | ||
tabPanel("About", mod_about_ui("about"), icon = icon("info-circle")), | ||
footer = footerTagList | ||
) | ||
) | ||
|
||
server <- function(input, output, session) { | ||
callModule(mod_ldheatmap_server, "ld") | ||
callModule(mod_snpdistribution_server, "dis") | ||
callModule(mod_phylogenetics_server, "tree") | ||
callModule(mod_diversity_server, "diversity") | ||
callModule(mod_extraction_server, "extract") | ||
observeEvent(input$disconnect, { | ||
session$close() | ||
}) | ||
} | ||
|
||
shinyApp(ui, server) |
Binary file not shown.