-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added logo and made esthetic changes to web
- Loading branch information
Showing
11 changed files
with
539 additions
and
149 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 |
---|---|---|
|
@@ -13,4 +13,5 @@ binder | |
docker | ||
LICENSE | ||
^.*\.code-workspace | ||
^R/\.repcred-package.R | ||
^R/\.repcred-package.R | ||
^logo |
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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,90 +1,77 @@ | ||
server <- function(input, output) { | ||
|
||
original_help_text = "Repcred is an R program that allows you to see visually statistics and information about your repertoire." | ||
output$help_info <- renderText({paste("<h2>Repcred</h2>\n",original_help_text)}) | ||
|
||
|
||
dataValues <- reactiveValues( | ||
repcred_report_path=NULL | ||
) | ||
|
||
|
||
|
||
observe({ | ||
|
||
val= input$input_chk | ||
|
||
if(val==TRUE){ | ||
output$condInput <- renderUI({ fileInput("genome", "Choose germline reference FASTA File", | ||
multiple = TRUE, | ||
accept = c("text/tab-separated-values",".fasta",".fna",".ffn",".frn",".fa","text/plain")) | ||
}) | ||
} | ||
|
||
if(val==FALSE){ | ||
output$condInput <- renderUI({}) | ||
} | ||
|
||
|
||
}) | ||
|
||
help_text="The repertoire file should contain the speficied rows as set out by the AIRR guidelines.Please be aware some stats will be unable to be run if there is missing data in some columns. This is mainly the sumrep stats , if there are specific stats you need makesure the related columns that are required are filled." | ||
help_text2 = "Many of the statistics can be run without a genome file but the genome file does allow missing genes to be pin pointed and gene usage to be analysed." | ||
|
||
observeEvent(input$help, { | ||
output$help_info <- renderText({paste("<h2>Repertoire File</h2>\n",help_text,"\n<h2> Genome File </h2>\n",help_text2)}) | ||
|
||
|
||
}) | ||
|
||
observeEvent(input$go, { | ||
output$openResultsBtn <- renderUI({ | ||
|
||
#req(input$file1) | ||
withProgress( | ||
tryCatch( | ||
{ | ||
dataValues$repcred_report_path <- repcred_report(input$file1$datapath, | ||
genome_file=input$genome$datapath, | ||
#sumrep = input$sumrep, | ||
downsample = input$input_downsample) | ||
|
||
}, | ||
error = function(e) { | ||
stop(e) | ||
|
||
dataValues <- reactiveValues( | ||
repcred_report_path=NULL | ||
) | ||
|
||
observe({ | ||
|
||
val= input$input_chk | ||
|
||
if(val==TRUE){ | ||
output$condInput <- renderUI({ fileInput("genome", | ||
"Choose germline reference FASTA File", | ||
multiple = TRUE, | ||
accept = c("text/tab-separated-values",".fasta",".fna",".ffn",".frn",".fa","text/plain")) | ||
}) | ||
} | ||
|
||
if(val==FALSE){ | ||
output$condInput <- renderUI({}) | ||
} | ||
|
||
}) | ||
|
||
help_text2 = "Many of the statistics can be run without a genome file but the genome file does allow missing genes to be pin pointed and gene usage to be analysed." | ||
|
||
observeEvent(input$go, { | ||
output$openResultsBtn <- renderUI({ | ||
|
||
#req(input$file1) | ||
withProgress( | ||
tryCatch( | ||
{ | ||
dataValues$repcred_report_path <- repcred_report(input$file1$datapath, | ||
genome_file=input$genome$datapath, | ||
#sumrep = input$sumrep, | ||
downsample = input$input_downsample) | ||
|
||
}, | ||
error = function(e) { | ||
stop(e) | ||
} | ||
), | ||
message="Analyzing repertoire..." | ||
) | ||
|
||
if (!is.null(dataValues$repcred_report_path)) { | ||
|
||
#repcred::replaceChapterClassType(dataValues$repcred_report_path) | ||
shiny::addResourcePath(basename(dirname(dataValues$repcred_report_path)),dirname(dataValues$repcred_report_path)) | ||
|
||
output$downloadResults <- downloadHandler( | ||
filename = function() { | ||
"report.zip" | ||
}, | ||
content = function(fname) { | ||
zip(zipfile=fname, files=dirname(dataValues$repcred_report_path)) | ||
if(file.exists(paste0(fname, ".zip"))) {file.rename(paste0(fname, ".zip"), fname)} | ||
}, | ||
contentType = "application/zip" | ||
) | ||
|
||
div( | ||
actionButton(inputId='openResultsBtn', | ||
label= 'Open analysis results', | ||
icon = icon("link"), | ||
style="color: #fff; background-color: #f39c12; border-color: #f39c12", | ||
onclick =paste0("window.open('",file.path(".",basename(dirname(dataValues$repcred_report_path)),basename(dataValues$repcred_report_path)),"', '_blank')") | ||
), | ||
downloadButton("downloadResults") | ||
) | ||
} | ||
), | ||
message="Analyzing repertoire..." | ||
) | ||
|
||
if (!is.null(dataValues$repcred_report_path)) { | ||
|
||
#repcred::replaceChapterClassType(dataValues$repcred_report_path) | ||
shiny::addResourcePath(basename(dirname(dataValues$repcred_report_path)),dirname(dataValues$repcred_report_path)) | ||
|
||
output$downloadResults <- downloadHandler( | ||
filename = function() { | ||
"report.zip" | ||
}, | ||
content = function(fname) { | ||
zip(zipfile=fname, files=dirname(dataValues$repcred_report_path)) | ||
if(file.exists(paste0(fname, ".zip"))) {file.rename(paste0(fname, ".zip"), fname)} | ||
}, | ||
contentType = "application/zip" | ||
) | ||
|
||
div( | ||
actionButton(inputId='openResultsBtn', | ||
label= 'Open analysis results', | ||
icon = icon("link"), | ||
style="color: #fff; background-color: #f39c12; border-color: #f39c12", | ||
onclick =paste0("window.open('",file.path(".",basename(dirname(dataValues$repcred_report_path)),basename(dataValues$repcred_report_path)),"', '_blank')") | ||
), | ||
downloadButton("downloadResults") | ||
) | ||
} | ||
}) | ||
}) | ||
|
||
|
||
}) | ||
}) | ||
|
||
|
||
} |
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,56 +1,67 @@ | ||
# Define UI | ||
options(shiny.maxRequestSize = 0) | ||
ui <- fluidPage( | ||
|
||
tags$head( | ||
tags$link(rel = "stylesheet", type = "text/css", href = "repcred.css") | ||
), | ||
|
||
# Sidebar layout | ||
sidebarLayout( | ||
sidebarPanel(align="center", | ||
# App title | ||
fluidRow(titlePanel("Repcred"), | ||
#Help Button | ||
actionButton("help" , "Help")), | ||
br(), | ||
# Input | ||
fileInput("file1", "Choose TSV File (REQUIRED)", | ||
multiple = FALSE, | ||
accept = c("text/tab-separated-values", | ||
".tsv",".csv",".tab", "text/plain")), | ||
#Downsampled input | ||
checkboxInput("input_downsample", "Downsampled repertoire?", value = TRUE ), | ||
#Genome fasta file upload | ||
checkboxInput("input_chk", "Upload germline reference set?", value = FALSE ), | ||
uiOutput("condInput"), | ||
|
||
#selectInput("sumrep" , "Select Sumrep stats to run. Full stats takes longer to run but gives pairwise statistics , Basic statistics is faster but contains less statistics." , choices=c("Full sumrep stats" , "Basic sumrep stats")), | ||
|
||
|
||
|
||
|
||
actionButton("go", "Run analysis"), | ||
|
||
# Output | ||
uiOutput("openResultsBtn") | ||
|
||
), | ||
|
||
|
||
mainPanel = ({ | ||
htmlOutput("help_info") | ||
} | ||
) | ||
|
||
) | ||
|
||
|
||
|
||
) | ||
|
||
|
||
|
||
|
||
|
||
|
||
ui <- fluidPage( | ||
|
||
tags$head( | ||
tags$link(rel = "stylesheet", type = "text/css", href = "repcred.css") | ||
), | ||
|
||
tags$script( | ||
HTML( | ||
"$(function () { | ||
$('[data-toggle=tooltip]').tooltip(); | ||
});" | ||
) | ||
), | ||
|
||
# App title | ||
fluidRow( | ||
id="div-main", | ||
tags$img(src = "logo.svg", width = "100px"), | ||
tags$h1("Rep-Cred"), | ||
tags$strong("Credibility of a repertoire"), | ||
tags$p("Summary statistics and graphical information to quickly asses the quality of a repertoire."), | ||
tabsetPanel( | ||
tabPanel("Rep-Cred", | ||
br(), | ||
# Input | ||
fileInput("file1", | ||
"Choose repertoire (.tsv) (REQUIRED)", | ||
multiple = FALSE, | ||
accept = c("text/tab-separated-values", | ||
".tsv",".csv",".tab", "text/plain")), | ||
# helpText( "Note: The repertoire file should contain the ", | ||
# "speficied rows as set out by the AIRR guidelines.", | ||
# "Please be aware some stats will be unable to be ", | ||
# "run if there is missing data in some columns. ", | ||
# "This is mainly the sumrep stats , if there are ", | ||
# "specific stats you need makesure the related ", | ||
# "columns that are required are filled."), | ||
|
||
# Downsample | ||
checkboxInput("input_downsample", "Downsample repertoire?", value = TRUE ), | ||
# helpText( "Note: Whether to downsample the input repertoire", | ||
# "to 5000 sequences."), | ||
|
||
# Genome fasta file upload | ||
checkboxInput("input_chk", "Upload germline reference set?", value = FALSE ), | ||
# helpText( "Note: Many of the statistics can be run without ", | ||
# "a genome file but the genome file does allow ", | ||
# "missing genes to be pin pointed and gene usage ", | ||
# "to be analysed."), | ||
|
||
# Sumrep | ||
uiOutput("condInput"), | ||
#selectInput("sumrep" , "Select Sumrep stats to run. Full stats takes longer to run but gives pairwise statistics , Basic statistics is faster but contains less statistics." , choices=c("Full sumrep stats" , "Basic sumrep stats")), | ||
actionButton("go", "Run analysis"), | ||
|
||
# Output | ||
uiOutput("openResultsBtn") | ||
|
||
), | ||
tabPanel("Help"), | ||
tabPanel("About") | ||
) | ||
) | ||
) |
Binary file not shown.
Oops, something went wrong.