Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Breedverse
Title: Collection of R Shiny Packages From Breeding Insight
Version: 0.2.0
Version: 0.3.0
Authors@R: c(person(given='Cristiane',
family='Taniguti',
email = 'ctaniguti@ufl.edu',
Expand All @@ -18,7 +18,7 @@ Authors@R: c(person(given='Cristiane',
family='Insight',
role = 'aut')
)
Description: Provides an interface for users to add modules from BIGapp, Qploidy, familia and AlloMate packages.
Description: Provides an interface for users to add modules from BIGapp, Qploidy, familia, GenoBrew and AlloMate packages.
License: Apache License 2.0
Depends: R (>= 3.6.0)
biocViews:
Expand All @@ -43,12 +43,13 @@ Suggests:
Qploidy,
BIGapp,
familia,
AlloMate
GenoBrew
Remotes:
Cristianetaniguti/Qploidy,
Breeding-Insight/BIGapp,
Breeding-Insight/familia,
Breeding-Insight/AlloMate@development
Breeding-Insight/AlloMate@development,
Breeding-Insight/GenoBrew@development
URL: https://github.com/Breeding-Insight/Breedverse
BugReports: https://github.com/Breeding-Insight/Breedverse/issues
LazyData: true
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# breedverse NEWS

## breedverse 0.3.0

* Add GenoBrew

## breedverse 0.2.0

* Collapse packages modules into a single collapsible menuItem in the left side menu
Expand Down
61 changes: 39 additions & 22 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,30 @@ app_server <- function(input, output, session) {
output$qploidyInstalled <- reactive({
"Qploidy" %in% rownames(installed.packages())
})

output$BIGappInstalled <- reactive({
"BIGapp" %in% rownames(installed.packages())
})

output$familiaInstalled <- reactive({
"familia" %in% rownames(installed.packages())
})

output$allomateInstalled <- reactive({
"AlloMate" %in% rownames(installed.packages())
})


output$genobrewInstalled <- reactive({
"GenoBrew" %in% rownames(installed.packages())
})

# Expose the value to JS even when panel is hidden
outputOptions(output, "qploidyInstalled", suspendWhenHidden = FALSE)
outputOptions(output, "BIGappInstalled", suspendWhenHidden = FALSE)
outputOptions(output, "familiaInstalled", suspendWhenHidden = FALSE)
outputOptions(output, "allomateInstalled", suspendWhenHidden = FALSE)
outputOptions(output, "genobrewInstalled", suspendWhenHidden = FALSE)


## Modules

Expand All @@ -47,17 +53,17 @@ app_server <- function(input, output, session) {
callModule(mod_install_server,
"install_1",
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)
}
}

## BIGapp

if(isTRUE(requireNamespace("BIGapp", quietly = TRUE))) {
do.call("library", list("BIGapp"))
callModule(getFromNamespace("mod_DosageCall_server", "BIGapp"),
Expand Down Expand Up @@ -85,9 +91,9 @@ app_server <- function(input, output, session) {
"GS_1",
parent_session = session)
}

##familia

if(isTRUE(requireNamespace("familia", quietly = TRUE))) {
do.call("library", list("familia"))
callModule(getFromNamespace("mod_SNMF_server", "familia"),
Expand All @@ -97,16 +103,27 @@ app_server <- function(input, output, session) {
"PolyBreedTools_1",
parent_session = session)
}

## AlloMate
if(isTRUE(requireNamespace("AlloMate", quietly = TRUE))) {
do.call("library", list("AlloMate"))
getFromNamespace("mod_allomate_server", "AlloMate")(
"allomate_1",
parent_session = session
)
}

}

## GenoBrew
if(isTRUE(requireNamespace("GenoBrew", quietly = TRUE))) {
do.call("library", list("GenoBrew"))
callModule(getFromNamespace("mod_mk_select_server", "GenoBrew"),
"mk_select_1",
parent_session = session)
callModule(getFromNamespace("mod_cnv_server", "GenoBrew"),
"cnv_1",
parent_session = session)
}

#Session info popup
observeEvent(input$session_info_button, {
showModal(modalDialog(
Expand All @@ -122,13 +139,13 @@ app_server <- function(input, output, session) {
)
))
})

#Check for updates from GitHub for Breedverse
get_latest_github_commit <- function(repo, owner) {
url <- paste0("https://api.github.com/repos/", owner, "/", repo, "/releases/latest")
response <- GET(url)
content <- content(response, "parsed")

if (status_code(response) == 200) {
tag_name <- content$tag_name
clean_tag_name <- sub("-.*", "", tag_name)
Expand All @@ -138,7 +155,7 @@ app_server <- function(input, output, session) {
return(NULL)
}
}

is_internet_connected <- function() {
handle <- new_handle()
success <- tryCatch({
Expand All @@ -149,7 +166,7 @@ app_server <- function(input, output, session) {
})
return(success)
}

observeEvent(input$updates_info_button, {
# Check internet connectivity
if (!is_internet_connected()) {
Expand All @@ -164,17 +181,17 @@ app_server <- function(input, output, session) {
))
return()
}

package_name <- "Breedverse"
repo_name <- "Breedverse" # GitHub repo name
repo_owner <- "Breeding-Insight" # User or organization name

# Get the installed version
installed_version <- as.character(packageVersion(package_name))

# Get the latest version from GitHub (can be tag version or latest commit)
latest_commit <- get_latest_github_commit(repo_name, repo_owner)

# Compare versions and prepare message
if (latest_commit > installed_version) {
update_status <- "A new version is available. Please update your package."
Expand All @@ -194,7 +211,7 @@ app_server <- function(input, output, session) {
update_status
)
}

# Display message in a Shiny modal
showModal(modalDialog(
title = "Breedverse Updates",
Expand Down
85 changes: 53 additions & 32 deletions R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ app_ui <- function(request) {
tags$li(class = "header", style = "color: grey; margin-top: 10px; margin-bottom: 10px; padding-left: 15px;", "Menu"),
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.familiaInstalled == true",
tags$li(class = "header", style = "color: grey; margin-top: 18px; margin-bottom: 10px; padding-left: 15px;", "Ancestry (R/familia)"),
Expand All @@ -75,13 +75,13 @@ app_ui <- function(request) {
menuSubItem("Unsupervised", tabName = "polybreedtools", icon = icon("share-from-square"))
)
),

conditionalPanel(
condition = "output.allomateInstalled == true",
tags$li(class = "header", style = "color: grey; margin-top: 18px; margin-bottom: 10px; padding-left: 15px;", "Mating Estimation (R/AlloMate)"),
menuItem("AlloMate", tabName = "allomate", icon = icon("diagram-project"))
),

conditionalPanel(
condition = "output.BIGappInstalled == true",
tags$li(class = "header", style = "color: grey; margin-top: 18px; margin-bottom: 10px; padding-left: 15px;", "Genotype Processing"),
Expand All @@ -100,7 +100,18 @@ app_ui <- function(request) {
menuSubItem("Genomic Prediction", tabName = "prediction", icon = icon("angles-right"))
)
),

conditionalPanel(
condition = "output.genobrewInstalled == true",
tags$li(class = "header", style = "color: grey; margin-top: 18px; margin-bottom: 10px; padding-left: 15px;", "Marker Panel Test &\n CNV Profiles"),
menuItem(
"GenoBrew",
icon = icon("dna"),
startExpanded = FALSE,
menuSubItem("Select Markers", tabName = "mk_select", icon = icon("magnifying-glass")),
menuSubItem("CNV profiles", tabName = "cnv", icon = icon("dna"))
)
),

tags$li(class = "header", style = "color: grey; margin-top: 18px; margin-bottom: 10px; padding-left: 15px;", "Information"),
menuItem("Source Code", icon = icon("circle-info"), href = "https://www.github.com/Breeding-Insight/Genomics_Shiny_App"),
menuItem("Help", tabName = "help", icon = icon("circle-question"))
Expand Down Expand Up @@ -128,7 +139,7 @@ app_ui <- function(request) {
)
),
left = div(
style = "display: flex; align-items: center; height: 100%;",
style = "display: flex; align-items: center; height: 100%;",
sprintf("v%s", as.character(utils::packageVersion("Breedverse"))))
),
dashboardBody(
Expand All @@ -155,70 +166,80 @@ app_ui <- function(request) {
tabName = "install", mod_install_ui("install_1")
),
tabItem(
tabName = "qploidy",
if(isTRUE(requireNamespace("Qploidy", quietly = TRUE)))
tabName = "qploidy",
if(isTRUE(requireNamespace("Qploidy", quietly = TRUE)))
getFromNamespace("mod_qploidy_ui", "Qploidy")("qploidy_1")
),
tabItem(
tabName = "snmf",
if(isTRUE(requireNamespace("familia", quietly = TRUE)))
tabName = "snmf",
if(isTRUE(requireNamespace("familia", quietly = TRUE)))
getFromNamespace("mod_SNMF_ui", "familia")("SNMF_1")
),
tabItem(
tabName = "polybreedtools",
if(isTRUE(requireNamespace("familia", quietly = TRUE)))
tabName = "polybreedtools",
if(isTRUE(requireNamespace("familia", quietly = TRUE)))
getFromNamespace("mod_polybreedtools_ui", "familia")("PolyBreedTools_1")
),
tabItem(
tabName = "allomate",
if(isTRUE(requireNamespace("AlloMate", quietly = TRUE)))
tabName = "allomate",
if(isTRUE(requireNamespace("AlloMate", quietly = TRUE)))
getFromNamespace("mod_allomate_ui", "AlloMate")("allomate_1")
),
tabItem(
tabName = "filtering",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
tabName = "filtering",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
getFromNamespace("mod_Filtering_ui", "BIGapp")("Filtering_1")
),
tabItem(
tabName = "updog",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
tabName = "updog",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
getFromNamespace("mod_DosageCall_ui", "BIGapp")("DosageCall_1")
),
tabItem(
tabName = "dosage2vcf",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
tabName = "dosage2vcf",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
getFromNamespace("mod_dosage2vcf_ui", "BIGapp")("dosage2vcf_1")
),
tabItem(
tabName = "pca",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
tabName = "pca",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
getFromNamespace("mod_PCA_ui", "BIGapp")("PCA_1")
),
tabItem(
tabName = "dapc",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
tabName = "dapc",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
getFromNamespace("mod_dapc_ui", "BIGapp")("dapc_1")
),
tabItem(
tabName = "gwas",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
tabName = "gwas",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
getFromNamespace("mod_gwas_ui", "BIGapp")("gwas_1")
),
tabItem(
tabName = "diversity",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
tabName = "diversity",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
getFromNamespace("mod_diversity_ui", "BIGapp")("diversity_1")
),
tabItem(
tabName = "prediction_accuracy",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
getFromNamespace("mod_GSAcc_ui", "BIGapp")("GSAcc_1")
),
tabItem(
tabName = "prediction",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
tabName = "prediction",
if(isTRUE(requireNamespace("BIGapp", quietly = TRUE)))
getFromNamespace("mod_GS_ui", "BIGapp")("GS_1")
),
tabItem(
tabName = "mk_select",
if(isTRUE(requireNamespace("GenoBrew", quietly = TRUE)))
getFromNamespace("mod_mk_select_ui", "GenoBrew")("mk_select_1")
),
tabItem(
tabName = "cnv",
if(isTRUE(requireNamespace("GenoBrew", quietly = TRUE)))
getFromNamespace("mod_cnv_ui", "GenoBrew")("cnv_1")
),
tabItem(
tabName = "help", mod_help_ui("help_1")
)
Expand All @@ -241,7 +262,7 @@ golem_add_external_resources <- function() {
"www",
app_sys("app/www")
)

tags$head(
favicon(),
bundle_resources(
Expand Down
Loading
Loading