Commit 8f5dcb5a authored by NAVRATIL VINCENT's avatar NAVRATIL VINCENT
Browse files

Add DGINN input file browser

parent 1e84ce41
library(shinythemes)
library(shiny)
library(ggtree)
library(ggplot2)
dginn_data = read.csv2("/Users/navratil/PRABI/git/shinyapps-virhostevol/data/TMPRSS2/DGINN_202103062052_summary.tab",sep="\t")
\ No newline at end of file
library(ggplot2)
dginn_msaplot <- function(p, fasta, offset=0, width=1, color=NULL, window=NULL, dginn_position=NULL, bg_line = TRUE, height = 0.8){
......@@ -45,14 +44,6 @@ dginn_msaplot <- function(p, fasta, offset=0, width=1, color=NULL, window=NULL,
names(seqs) <- labels(x)
if(is.null(color)) {
alphabet <- unlist(seqs) %>% unique
alphabet <- alphabet[alphabet != '-']
## color <- rainbow_hcl(length(alphabet))
color <- getCols(length(alphabet))
names(color) <- alphabet
color <- c(color, '-'=NA)
}
df <- p$data
## if (is.null(width)) {
......@@ -101,7 +92,7 @@ dginn_msaplot <- function(p, fasta, offset=0, width=1, color=NULL, window=NULL,
ymin=ymin, ymax=ymax,
fill=seq),
data=msa.df, inherit.aes = FALSE) +
scale_fill_manual(values=c(NA,"black","yellow"))
scale_fill_manual(values=c(NA,"lightgrey","red"))
breaks <- graphics::hist(seq_along(slice), breaks=10, plot=FALSE)$breaks
pos <- start + breaks * width
......
......@@ -11,14 +11,22 @@ shinyServer(
#
dginn_df_reactive <- reactive({
dginn_data
dginn_file <- input$dginn_file_tsv
if (is.null(dginn_file)){
return(NULL)
}
else{
read.csv2(dginn_file$datapath,sep="\t")
}
})
# renderDataTable -- DGINN data table
output$dginn_data <- DT::renderDataTable({
print("renderDataTable")
df <- dginn_df_reactive()
},
selection = 'single')
......
library(shinythemes)
library(shiny)
# Define UI for application that draws a histogram
shinyUI(fluidPage(
......@@ -11,10 +10,13 @@ shinyUI(fluidPage(
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
),
# Input: Select a file ----
fileInput("dginn_file_tsv", "Choose DGINN tab File",
multiple = FALSE,
accept = c("text/tsv",
"text/tabulated-separated-values,text/plain",
"tsv"))
),
# Show a plot of the generated distribution
mainPanel(
tabsetPanel(type = "tabs",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment