Skip to content

Commit

Permalink
fix the shiny app (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrue authored Jul 5, 2024
1 parent 1a281a0 commit e7511fe
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 15 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: TVTB
Type: Package
Title: TVTB: The VCF Tool Box
Version: 1.31.1
Date: 2024-07-04
Version: 1.31.2
Date: 2024-07-05
Authors@R: person("Kevin", "Rue-Albrecht", role = c("aut", "cre"),
email = "[email protected]")
Description: The package provides S4 classes and methods to filter,
Expand Down
8 changes: 8 additions & 0 deletions inst/NEWS.Rd
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
\name{TVTB-NEWS}
\title{NEWS: The VCF Tool Box}

\section{Changes in version 1.31.2 2024-07-05}{
\subsection{Bug fix}{
\itemize{
\item Fix \code{tSVE()} shiny application.
}
}
}

\section{Changes in version 1.31.1 2024-07-04}{
\subsection{Bug fix}{
\itemize{
Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/SLC24A5.bed
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15 48413169 48434869 SLC24A5
15 48413169 48434869 SLC24A5
2 changes: 1 addition & 1 deletion inst/shinyApp/fileParseFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tryParseCsq <- function(vcf, vepKey){
message("Parsing ", vepKey," to GRanges ...")

rawData <- tryCatch(
ensemblVEP::parseCSQToGRanges(
parseCSQToGRanges(
x = vcf,
VCFRowID = rownames(vcf),
info.key = vepKey),
Expand Down
1 change: 0 additions & 1 deletion inst/shinyApp/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ stopifnot(
requireNamespace("dplyr"),
requireNamespace("DT"),
requireNamespace("ensembldb"),
requireNamespace("ensemblVEP"),
requireNamespace("ggplot2"),
requireNamespace("reshape2"),
requireNamespace("Rsamtools"),
Expand Down
11 changes: 8 additions & 3 deletions inst/shinyApp/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ shinyServer(function(input, output, clientData, session) {
message("Importing phenotypes ...")
rawData <- tryCatch(
{
S4Vectors::DataFrame(read.table(phenoFile, TRUE, row.names = 1))
S4Vectors::DataFrame(read.table(phenoFile, TRUE, row.names = 1, stringsAsFactors = TRUE))
},
warning = function(warn){
Errors[["phenotypes"]] <- sprintf("Failed to parse file:\n%s", warn)
Expand Down Expand Up @@ -281,6 +281,7 @@ shinyServer(function(input, output, clientData, session) {
observeEvent(
input$phenoAddFrequencies,
{
print(input$phenoAddFrequencies)
# raw VCF
vcf <- RV[["VCF"]]

Expand All @@ -289,8 +290,11 @@ shinyServer(function(input, output, clientData, session) {

# phenotypes
phenos <- SummarizedExperiment::colData(vcf)
print(phenos)
phenoNames <- colnames(phenos)
print(phenoNames)
phenoLevels <- levels(phenos[,input$phenoAddFrequencies])
print(phenoLevels)

if (length(phenoLevels) == 0){
return()
Expand Down Expand Up @@ -1590,10 +1594,11 @@ shinyServer(function(input, output, clientData, session) {
RV[["VCF"]] <- NULL
return()
}

print(vcf)
print(colData(print(vcf)))
# Clean header of INFO fields not imported
vcf <- TVTB::dropInfo(vcf)

print(colData(print(vcf)))
# Store ExpandedVCF object in list of reactive values
RV[["VCF"]] <- vcf

Expand Down
14 changes: 7 additions & 7 deletions inst/shinyApp/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,13 @@ shinyUI(navbarPage(
width = 2,
actionButton(
"tickAllInfo", "Select all",
icon = icon("check-square-o"))
icon = icon("square-check"))
),
column(
width = 2,
actionButton(
"untickAllInfo", "Deselect all",
icon = icon("square-o"))
icon = icon("square"))
),
column(
width = 7, offset = 1,
Expand Down Expand Up @@ -507,7 +507,7 @@ shinyUI(navbarPage(
# Calculate frequencies ----

tabPanel(
title = "Frequencies", icon = icon("calculator "),
title = "Frequencies", icon = icon("calculator"),

uiOutput("TVTBparamWarning"),

Expand Down Expand Up @@ -561,13 +561,13 @@ shinyUI(navbarPage(
actionButton(
"tickAllPhenoLevelsFreq",
"Select all",
icon = icon("check-square-o"),
icon = icon("square-check"),
width = "100%"
), br(),
actionButton(
"untickAllPhenoLevelsFreq",
"Deselect all",
icon = icon("square-o"),
icon = icon("square"),
width = "100%"
)
),
Expand Down Expand Up @@ -731,7 +731,7 @@ shinyUI(navbarPage(
),

tabPanel(
title = "Views", icon = icon("picture-o"),
title = "Views", icon = icon("image"),

tabsetPanel(
id = "tabset.views",
Expand Down Expand Up @@ -895,7 +895,7 @@ shinyUI(navbarPage(
"to generate/update the figure",
actionButton(
"doGenoHeatmap", "Go!",
icon = icon("time")
icon = icon("hourglass-start")
)
),

Expand Down

0 comments on commit e7511fe

Please sign in to comment.