Commit ec03cb8b authored by NAVRATIL VINCENT's avatar NAVRATIL VINCENT
Browse files

Remove input file, simplified table output and add some informations

parent dd20fbc6
#Modified msaplot function to deal with DGINN data formats
dginn_msaplot <- function(p, fasta,dginn_position=NULL, offset=0, width=1, color=NULL, window=NULL, bg_line = TRUE, height = 0.8){
if (missingArg(fasta)) {
x <- NULL
......@@ -87,12 +87,11 @@ dginn_msaplot <- function(p, fasta,dginn_position=NULL, offset=0, width=1, color
})
msa.df <- do.call("rbind", msa)
p <- p + geom_rect(aes(xmin=xmin, xmax=xmax,
ymin=ymin, ymax=ymax,
fill=seq),
data=msa.df, inherit.aes = FALSE) +
scale_fill_manual(values=c(NA,"lightgrey","red"))
scale_fill_manual(values=c("darkgrey","lightgrey","red"))
breaks <- graphics::hist(seq_along(slice), breaks=10, plot=FALSE)$breaks
pos <- start + breaks * width
......
......@@ -7,19 +7,20 @@ shinyServer(
# reactive function
#
# Taxonomy reactive
# DGINN reactive
#
dginn_df_reactive <- reactive({
dginn_file <- input$dginn_file_tsv
dginn_file <- "../data/covid_comp_DGINNscreen.csv"
if (is.null(dginn_file)){
return(NULL)
}
else{
colnames <- c("File","Name","Gene","Description","GeneSize","NbSpecies","omegaM0Bpp","omegaM0codeml","BUSTED","BUSTED_p-value","MEME_NbSites","MEME_PSS","BppM1M2","BppM1M2_p-value","BppM1M2_NbSites","BppM1M2_PSS","BppM7M8","BppM7M8_p-value","BppM7M8_NbSites","BppM7M8_PSS","codemlM1M2","codemlM1M2_p-value","codemlM1M2_NbSites","codemlM1M2_PSS","codemlM7M8","codemlM7M8_p-value","codemlM7M8_NbSites","codemlM7M8_PSS")
df <- read.csv2(dginn_file$datapath,sep=",")
df <- read.csv2(dginn_file,sep=",")
#split primates and bat data
df_primates <- df[,c(5,6,2,3,7:30)]
......@@ -38,6 +39,10 @@ shinyServer(
})
#
# Tree data reactive
#
tree_data_reactive <- reactive({
selected <- input$dginn_data_rows_selected
......@@ -52,19 +57,26 @@ shinyServer(
})
#
# MSA data reactive
#
msa_data_reactive <- reactive({
selected <- input$dginn_data_rows_selected
file=dginn_df_reactive()[selected,"File"]
species=dginn_df_reactive()[selected,"Name"]
path="../data/"
gene=dginn_df_reactive()[selected,"Gene"]
file_url=paste(path,file,sep="/")
read_file(paste(file_url,".fas",sep=""))
file_url=paste(path,species,file,sep="/")
read_file(paste(file_url,".best.fas",sep=""))
})
# rendering functions
# renderDataTable -- DGINN data table
output$dginn_data <- DT::renderDataTable({
......@@ -73,7 +85,10 @@ shinyServer(
},
selection = 'single')
selection = 'single',
rownames= FALSE,
options = list( columnDefs = list( list(targets = 0, visible = FALSE))),
)
#renderPlotOutput -- ggTree + msa + summary
output$ggtree_plot <- renderPlot({
......@@ -174,5 +189,6 @@ shinyServer(
}
)
})
}
)
# Define UI for application that draws a histogram
shinyUI(fluidPage(
shinyUI(
fluidPage(
theme = shinytheme("cerulean"),
lang = "en",
# Application title
titlePanel("VirHostEvol"),
titlePanel("VirHostEvol - Positive selection of the SARSCov-2 viral interaction proteins."),
# 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"))
tags$div(class="header", checked=NA,
HTML("Supplementary materials of the manuscript entitled <b>'Evolutionary history of SARS-CoV-2 interacting proteins in primates and bats reveals major host determinants, including TMPRSS2, FYCO1, RIPK1, and TBK1.'</b> by Cariou M. et <i>al.</i><br><br>Add other informatio stuff ..."),
)
),
# Show a plot of the generated distribution
mainPanel(
tabsetPanel(type = "tabs",
tabPanel("DGINN dataset",
tags$div(class="header", checked=NA,
HTML("This table highlights the sites under positive selection infered by BppM1M2, BppM7M8, codemlM1M2, codemlM7M8 models in either primates and bats lineages for SARSCov-2 Viral Interacting proteins<br><br><b>Please select a row</b> to visualise canidates sites on top of the phylogenetic tree and the simplified Multiple Sequence Alignment (lightgrey and darkgrey region of the MSA corresponds respectively to substitution and insertion) <br>At the bottom of the phylogenetic tree and msa you can download data by following the <b>.tree</b> and <b>.fas</b> hyperlinks. </br>Add other informatio stuff ...<br><br>"),
),
DT::dataTableOutput("dginn_data"),
plotOutput("ggtree_plot",height = "800px")
......@@ -30,5 +33,5 @@ shinyUI(fluidPage(
)
)
)
)
)
)
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