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

clean dir

parent a30d0225
This diff is collapsed.
......@@ -3,4 +3,5 @@ library(shiny)
library(ggtree)
library(ggplot2)
library(gridExtra)
library(ggimage)
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
......@@ -103,8 +102,7 @@ dginn_msaplot <- function(p, fasta,dginn_position=NULL, offset=0, width=1, color
return(p)
}
dginn_msaplot_summary <- function(p, fasta, offset=0, width=1, color=NULL, window=NULL, dginn_summary=NULL, bg_line = TRUE, height = 0.8){
dginn_msaplot_summary <- function(p, fasta, offset=0, width=1, color=NULL, window=NULL, dginn_summary=NULL, bg_line = TRUE, height = 0.1){
if (missingArg(fasta)) {
x <- NULL
} else if (is(fasta, "DNAbin") || is(fasta, "AAbin") ) {
......
......@@ -16,7 +16,7 @@ shinyServer(
return(NULL)
}
else{
read.csv2(dginn_file$datapath,sep="\t")
df=read.csv2(dginn_file$datapath,sep="\t")
}
})
......@@ -36,10 +36,11 @@ shinyServer(
selected <- input$dginn_data_rows_selected
if (! is.null(selected)){
species=dginn_df_reactive()[selected,"Name"]
file=dginn_df_reactive()[selected,"File"]
path="../data/"
gene=dginn_df_reactive()[selected,"Gene"]
file_url=paste(path,gene,file,sep="/")
file_url=paste(path,file,sep="/")
tree=read.tree(paste(file_url,".phylip_phyml_tree.txt",sep=""))
model=input$model_parameter_rb
......@@ -63,13 +64,24 @@ shinyServer(
}
names(dginn_data_model_summary) <- c("summary",models)
dginn_data_model_summary$summary <- table(dginn_data_model_summary$summary)
print(dginn_data_model_summary)
p <- ggtree(tree) + geom_tiplab(size=3)
phylopic_id=""
if(species=="Primates"){
phylopic_id="2d078b25-e6a0-4beb-a5d3-5d6f16be8ebf"
}
if(species=="Bats"){
phylopic_id="18bfd2fc-f184-4c3a-b511-796aafcc70f6"
}
#geom_phylopic(image=phylopic_id,color="black", alpha = .1, size=Inf)
p <- ggtree(tree) + geom_tiplab(size=5)
p_msa <- dginn_msaplot(p, paste(file_url,".fas",sep=""),dginn_position=as.numeric(names(dginn_data_model_summary$summary)), offset=1, width=5)
p_msa_summary <- dginn_msaplot_summary(p, paste(file_url,".fas",sep=""),dginn_summary=dginn_data_model_summary, offset=1, width=5)
grid.arrange(p_msa+ theme(legend.position = "none"),p_msa_summary + theme(legend.position = "none"),nrow=2,ncol=1)
grid.arrange(p_msa_summary+ theme(legend.position = "none") ,p_msa+ theme(legend.position = "none"),nrow=2,ncol=1,heights=c(4,2*dginn_df_reactive()[selected,"NbSpecies"]))
}
}
)
......
......@@ -23,7 +23,7 @@ shinyUI(fluidPage(
tabPanel("DGINN dataset",
DT::dataTableOutput("dginn_data"),
plotOutput("ggtree_plot")
plotOutput("ggtree_plot",height = "800px")
#, 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