Commit 48c8be30 authored by NAVRATIL VINCENT's avatar NAVRATIL VINCENT
Browse files

add ggmsa around PSS

parent bda682fc
......@@ -6,3 +6,5 @@ library(ggtree)
library(ggplot2)
library(gridExtra)
library(DT)
library(ggmsa)
......@@ -39,6 +39,38 @@ shinyServer(
})
dginn_site_df_reactive <- reactive({
selected <- input$dginn_data_rows_selected
if (is.null(selected)){
return(NULL)
}
else{
raw_selected <- dginn_df_reactive()[selected,]
models <- c("BppM1M2","BppM7M8","codemlM1M2","codemlM7M8")
df <- data.frame()
for(i in 1:length(models)){
if(dginn_df_reactive()[selected,paste(models[i],"NbSites",sep="_")] >0){
dginn_position <- as.integer(strsplit(as.character(dginn_df_reactive()[selected,paste(models[i],"PSS",sep="_")]),",")[[1]])
dginn_pvalue <- as.integer(strsplit(as.character(dginn_df_reactive()[selected,paste(models[i],"p-value",sep="_")]),",")[[1]])
dginn_position_df <- data.frame("models" = models[i],"site" = dginn_position,"p-value" = dginn_pvalue )
df <- rbind(df,dginn_position_df)
}
}
return(df)
}
})
#
# Tree data reactive
#
......@@ -107,6 +139,7 @@ shinyServer(
# get dginn_data_model_summary
#
models <- c("BppM1M2","BppM7M8","codemlM1M2","codemlM7M8")
dginn_data_model_summary <- list()
dginn_data_model_summary[1] <- c()
......@@ -170,6 +203,45 @@ shinyServer(
}
)
#renderDataTable -- DGINN sites
output$dginn_site_data <- DT::renderDataTable({
df <- dginn_site_df_reactive()
},
selection = 'single',
rownames= FALSE,
options = list(pageLength = 5)
)
#renderPlotOutput -- ggTree + msa around sites
output$ggtree_ggmsa_site_plot <- renderPlot({
selected <- input$dginn_data_rows_selected
selected_site <- input$dginn_site_data_rows_selected
if (! is.null(selected_site)){
species=dginn_df_reactive()[selected,"Name"]
file=dginn_df_reactive()[selected,"File"]
path="../data/"
gene=dginn_df_reactive()[selected,"Gene"]
file_url=paste(path,species,file,sep="/")
tree=read.tree(paste(file_url,".phylip_phyml_tree.txt",sep=""))
site <- dginn_site_df_reactive()[selected_site,"site"]
ggmsa(paste(file_url,".best.fas",sep=""), site-3, site+3, color = "Chemistry_NT", seq_name = T,consensus_views = FALSE, disagreement = FALSE)+ geom_seqlogo()+ geom_msaBar()
#p <- ggtree(tree) + geom_tiplab()
#data = tidy_msa(paste(file_url,".best.fas",sep=""), site-10, site+10)
#p + geom_facet(geom = geom_msa, data = data, panel = 'msa', color = "Chemistry_NT") +xlim_tree(1)
}
})
output$tree <- downloadHandler(
filename = function() {
paste0(input$tree, ".tree")
......
......@@ -8,26 +8,38 @@ shinyUI(
lang = "en",
# Application title
titlePanel("VirHostEvol - Positive selection on gene encoding the SARSCov-2 Viral Interaction Proteins."),
titlePanel("VirHostEvol - Positive selection on genes encoding the SARSCov-2 Viral Interaction Proteins."),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
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 ..."),
HTML("Online 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 - gene centered",
tabPanel("DGINN dataset",
tags$div(class="header", checked=NA,
HTML("This table is the output of DGINN software and highlights the nucleotide sites under positive selection infered by the BppM1M2, BppM7M8, codemlM1M2, codemlM7M8 models in either primates and bats taxonomic lineages for as selection of genes encoding SARSCov-2 Viral Interacting Proteins (aka VIP) identified by the Krogan Lab.<br><br><b>Please select a row</b> to visualise canidates sites on top of the phylogenetic tree and a simplified Multiple Sequence Alignment representation where lightgrey and darkgrey regions of the MSA corresponds respectively to substitution and insertion evolutionary events.<br>At the bottom of the phylogenetic tree and MSA, users you can download data by following the <b>.tree</b> and <b>.fas</b> hyperlinks. </br>Add other informatio stuff ...<br><br>"),
),
HTML("<br><br><b>Please select a row</b> to visualise canidates sites on top of the phylogenetic tree and a simplified Multiple Sequence Alignment representation where lightgrey and darkgrey regions of the MSA corresponds respectively to substitution and insertion evolutionary events.<br>At the bottom of the phylogenetic tree and MSA, users 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")
tags$div(class="header", checked=NA,
HTML("<br><br><b>Table: DGINN gene summary output table.</b> This table is the output of DGINN software and highlights the nucleotide sites under positive selection (PSS) infered by the BppM1M2, BppM7M8, codemlM1M2, codemlM7M8 models in either primates and bats taxonomic lineages for a selection of genes encoding SARSCov-2 Viral Interacting Proteins (aka VIP) identified by the Krogan Lab.")),
plotOutput("ggtree_plot",height = "800px"),
tags$div(class="header", checked=NA,
HTML("<br><br><b>Figure: Phylogenetic tree + MSA</b>. This is a back to back representation of the phylogentic tree and a simplified MSA.<br><br>")),
tags$div(class="header", checked=NA,
HTML("<br><br><b>Please select a row</b> to visualiser candidates sites in the context of the MSA.<br><br>")),
DT::dataTableOutput("dginn_site_data"),
tags$div(class="header", checked=NA,
HTML("<br><br><b>Table: DGINN output by PSS.</b>This table contains a list of candidate PSS with their p-values.")),
plotOutput("ggtree_ggmsa_site_plot",width="400px",height = "800px"),
tags$div(class="header", checked=NA,
HTML("<br><br><b>Figure PSS MSA.</b> This is a representation of the MSA around the candidate PSS.<br><br>")),
#, radioButtons("model_parameter_rb", label = "Select model:",choices = list("BppM1M2","BppM7M8","BppDFP07_0DFP07","codemlM1M2","codemlM7M8"), selected = "BppM1M2")
)
)
......
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