Commit 0a0636b7 authored by Amine  GHOZLANE's avatar Amine GHOZLANE
Browse files

Debug of export in heatmap, debug of scatterplot and better shape of install tutorial

parent 703b6e0a
......@@ -87,7 +87,7 @@ Plot_Visu_Barplot <- function(input,resDiff)
dataBarPlot_mat$AllVar = factor(dataBarPlot_mat$AllVar,levels = unique(dataBarPlot_mat$AllVar))
gg= ggplot(dataBarPlot_mat, aes(x=AllVar, y=Proportions, fill=Taxonomy))
gg= gg + geom_bar(stat="identity")
gg= gg +geom_bar(position=input$positionBarPlot, stat="identity")
gg= gg + theme_bw()+ scale_fill_manual(values=tax.colors)
gg = gg +theme(panel.grid.minor.x=element_blank(),panel.grid.major.x=element_blank())
if(input$CountsOrProp=="prop") gg = gg+labs(y="Relative abundance (%)",x="")
......@@ -128,7 +128,12 @@ Plot_Visu_Heatmap <- function(input,resDiff,export=FALSE){
height = input$heightVisu, show_grid = FALSE, colors = col, scale = input$scaleHeatmap, cexRow = as.numeric(input$LabelSizeHeatmap), margins=c(12,30),
cexCol=as.numeric(input$LabelSizeHeatmap), offsetCol=input$LabelColOffsetHeatmap, offsetRow=input$LabelRowOffsetHeatmap)
}
if(export){ plot = heatmap.2(counts_tmp_combined, dendrogram = "none", Rowv = (input$SortHeatRow == "Yes"),
if(export){
dendrogram="none"
if(input$SortHeatColumn == "Yes" && input$SortHeatRow == "Yes" ) dendrogram ="both"
else if(input$SortHeatColumn == "Yes") dendrogram ="column"
else if(input$SortHeatRow == "Yes") dendrogram ="row"
plot = heatmap.2(counts_tmp_combined, dendrogram = dendrogram, Rowv = (input$SortHeatRow == "Yes"),
Colv = (input$SortHeatColumn == "Yes"), na.rm = TRUE, density.info="none", margins=c(as.numeric(input$lowerMargin),as.numeric(input$rightMargin)),trace="none",
srtCol=45, col = col, scale = input$scaleHeatmap, cexRow = input$LabelSizeHeatmap,cexCol =input$LabelSizeHeatmap,
offsetCol=input$LabelColOffsetHeatmap,offsetRow=input$LabelRowOffsetHeatmap,symm=FALSE,symkey=FALSE,symbreaks=FALSE)
......@@ -310,8 +315,12 @@ Plot_Visu_Scatterplot<- function(input,resDiff,export=FALSE,lmEst = FALSE,CorEst
{counts = as.data.frame(round(counts(dds, normalized = FALSE)))}
target = as.data.frame(resDiff$target)
#print("target")
#print(target)
## Get the diversity values
tmp_div = Plot_Visu_Diversity(input,resDiff,ForScatter=TRUE)$dataDiv
#print("tmp_div")
#print(tmp_div)
if(!is.null(tmp_div)){
div = cbind(round(tmp_div$value[tmp_div$diversity =="Alpha"],3),
......@@ -322,8 +331,7 @@ Plot_Visu_Scatterplot<- function(input,resDiff,export=FALSE,lmEst = FALSE,CorEst
}
if(input$TransDataScatter =="log2") data = cbind(target,log2(t(counts)+1),div)
else if(input$TransDataScatter =="none") data = cbind(target,t(counts),div)
## Get Input for ScatterPlot
Xvar = input$Xscatter
Yvar = input$Yscatter
......@@ -383,11 +391,16 @@ Plot_Visu_Scatterplot<- function(input,resDiff,export=FALSE,lmEst = FALSE,CorEst
Rsq = sumRes$r.squared
return(list(regCoef=regCoef,Rsq = Rsq))
}
print("HERE")
if(CorEst)
{
typesTarget = sapply(target,class)
numInd = (typesTarget=="numeric")[1:ncol(target)]
print("HERE2")
#typesTarget = sapply(target,class)
#print(typesTarget)
#numInd = (typesTarget=="numeric")[1:ncol(target)]
#print(numInd)
typesTarget = sapply(target,is.numeric)
numInd=which(typesTarget[2:ncol(target)])
if(any(numInd)) data = cbind(target[,numInd],log2(t(counts)+1),div)
if(!any(numInd)) data = cbind(log2(t(counts)+1),div)
......
......@@ -3621,26 +3621,25 @@ shinyServer(function(input, output,session) {
resDiff = ResDiffAnal()
res = list()
namesTarget = colnames(target)[2:ncol(target)]
if(!is.null(data$counts) && !is.null(data$taxo) && nrow(data$counts)>0 && nrow(data$taxo)>0 && !is.null(taxo) && taxo!="..." && !is.null(target))
#!is.null(data$taxo) &&
if(!is.null(data$counts) && nrow(data$counts)>0 && nrow(data$taxo)>0 && !is.null(taxo) && taxo!="..." && !is.null(target))
{
counts = dataMergeCounts()$counts
## Get numeric variables from target
typesTarget = sapply(target,class)
numInd = (typesTarget=="numeric")[2:ncol(target)]
numInd = (typesTarget%in%c("integer","numeric"))[2:ncol(target)]
## Using list slows down the application if the number of rows too high
if(nrow(counts)<300)
{
#if(nrow(counts)<300)
#{
Available_x = list(x1 = c(sort(rownames(counts))),"Diversity" = c("Alpha div","Shannon div","Inv.Simpson div","Simpson div"))
names(Available_x)[1] = taxo
if(any(numInd)) Available_x$Variables = namesTarget[numInd]
} else{
Available_x = c(sort(rownames(counts)),"Alpha div","Shannon div","Inv.Simpson div","Simpson div")
if(any(numInd)) Available_x = c(Available_x,namesTarget[numInd])
}
if(any(numInd)) Available_x$Variables = c(namesTarget[numInd],"")
#} #else{
#Available_x = c(sort(rownames(counts)),"Alpha div","Shannon div","Inv.Simpson div","Simpson div")
#if(any(numInd)) Available_x = c(Available_x,namesTarget[numInd])
#}
Available_y = Available_x
res[[1]] = selectizeInput("Xscatter",h6(strong("X variable")),Available_x, selected = Available_x[1],multiple = FALSE)
res[[2]] = selectizeInput("Yscatter",h6(strong("Y variable")),Available_y, selected = Available_x[2],multiple = FALSE)
res[[3]] = selectizeInput("ColorBy",h6(strong("Color variable")),c("None"="None",namesTarget[!numInd]),multiple = FALSE)
......
......@@ -66,7 +66,12 @@ body <- dashboardBody(
tabPanel("Citing SHAMAN",
p("If you use SHAMAN for your project, please cite our first application of SHAMAN in Quereda et al. 2016.",style = "font-family: 'times'; font-si16pt"),
p("Publication using SHAMAN :",style = "font-family: 'times'; font-si18pt; font-style: strong"),
p(a("Prediction of the intestinal resistome by a three-dimensional structure-based method.", href="https://www.ncbi.nlm.nih.gov/pubmed/30478291"),"Ruppé E, Ghozlane A, Tap J, et al.;Nature microbiology 2018",style = "font-family: 'times'; font-si16pt"),
p(a("Diverse laboratory colonies of Aedes aegypti harbor the same adult midgut bacterial microbiome.", href="https://www.ncbi.nlm.nih.gov/pubmed/29587819"), "Dickson LB, Ghozlane A, Volant S, Bouchier C, Ma L, Vega-Rúa A, Dusfour I, Jiolle D, Paupy C, Mayanja MN, Kohl A, Lutwama JJ, Duong V, Lambrechts L; Parasit Vectors 2018",style = "font-family: 'times'; font-si16pt"),
p(a("Combined bacterial and fungal intestinal microbiota analyses: Impact of storage conditions and DNA extraction protocols", href="https://www.ncbi.nlm.nih.gov/pubmed/30074988"), "Angebault C, Ghozlane A, Volant S, Botterel F, d’Enfert C, Bougnoux ME, PloS one 2018",style = "font-family: 'times'; font-si16pt"),
p(a("Clinical Efficacy and Microbiome Changes Following Fecal Microbiota Transplantation in Children With Recurrent Clostridium Difficile Infection", href="https://www.ncbi.nlm.nih.gov/pubmed/26566371"), "Li X, Gao X, Hu H, Xiao Y, Li D, Yu G, Yu D, Zhang T, Wang Y, Frontiers in Microbiology",style = "font-family: 'times'; font-si16pt"),
p(a("Diverse laboratory colonies of Aedes aegypti harbor the same adult midgut bacterial microbiome", href="https://www.ncbi.nlm.nih.gov/pubmed/29587819"),"Dickson LB, Ghozlane A, Volant S, Bouchier C, Ma L, Vega-Rúa A, Dusfour I, Jiolle D, Paupy C, Mayanja MN, Kohl A, Lutwama JJ, Duong V, Lambrechts L",style = "font-family: 'times'; font-si16pt"),
p(a("Characteristics of Fecal Microbiota in Pediatric Crohn’s Disease and Their Dynamic Changes During Infliximab Therapy.", href="https://www.ncbi.nlm.nih.gov/pubmed/29194468"), "Wang Y, Gao X, Ghozlane A, Hu H, Li X, Xiao Y, Li D, Yu G, Zhang T; Journal of Crohn's & colitis 2017",style = "font-family: 'times'; font-si16pt"),
p(a("Carryover effects of larval exposure to different environmental bacteria drive adult trait variation in a mosquito vector.", href="https://www.ncbi.nlm.nih.gov/pubmed/28835919"), "Dickson LB, Jiolle D, Minard G, Moltini-Conclois I, Volant S, Ghozlane A, Bouchier C, Ayala D, Paupy C, Moro CV, Lambrechts L; Science Advances 2017",style = "font-family: 'times'; font-si16pt"),
p(a("A bacteriocin from epidemic Listeria strains alters the host intestinal microbiota to favor infection.", href="http://www.ncbi.nlm.nih.gov/pubmed/27140611"), "Quereda JJ, Dussurget O, Nahori MA, Ghozlane A, Volant S, Dillies MA, Regnault B, Kennedy S, Mondot S, Villoing B, Cossart P, Pizarro-Cerda J.; PNAS 2016",style = "font-family: 'times'; font-si16pt"),
......@@ -81,6 +86,8 @@ body <- dashboardBody(
box(
title = "What's new in SHAMAN", width = NULL, status = "primary",
div(style = 'overflow-y: scroll; height: 550px',
addNews("April 11th 2019","Debugging","We fixed few bugs in export system and scatterplot visualisation system."),
addNews("March 28th 2019","Packaging","SHAMAN is now available as packrat package. Take a look at download section."),
addNews("April 17th 2018","Bioinformatics","The bioinformatic treatment offers a larger access to parameters. We also worked a lot on the documentation."),
addNews("September 4th 2017","Bioinformatics","The bioinformatic treatment of fastq reads is now available in SHAMAN. For now, SHAMAN allows to compute OTU, build an OTU table and annotate them with the last version of the available database. This application is for 16S/18S/23S/28S/ITS sequencing."),
addNews("July 18th 2017","Normalization and visualisation","A new method for normalization called total counts was added. More options have been added to the abundance tree."),
......@@ -98,7 +105,7 @@ body <- dashboardBody(
addNews("Aug 1st 2016","Biom format","SHAMAN can now support all the Biom format versions."),
addNews("Jun 24th 2016","Comparisons plots","The venn diagram and the heatmap of foldchange
have been added to compare the results of 2 or more contrasts."),
addNews("Jun 17th 2016","Diversity plots","Enhancement of the visualtisation of the diverties.
addNews("Jun 17th 2016","Diversity plots","Enhancement of the visualisation of the diverties.
The shanon and inv. shanon have been added.")
)
)
......@@ -216,17 +223,32 @@ body <- dashboardBody(
p("- Docker update after an update of SHAMAN:"),
wellPanel(div(style = 'max-width: 900px',"docker pull aghozlane/shaman"))
),
tabPanel("R install (RC)",
p("SHAMAN is available for R>3.1.2. The installation, download and execution can all be performed with a small R script :",style = "font-family: 'times'; font-si16pt"),
tabPanel("R install with Packrat",
p("SHAMAN is available for R=3.1.2. Packrat framework installation allow an easy installation of all the dependencies. Of note, raw data submission is not possible with this version. First, install R 3.1.2 as local install as follow:",style = "font-family: 'times'; font-si16pt"),
wellPanel(style = 'width: 150%; word-wrap: break-word;',"# Install R 3.1.2", br(),
"wget https://pbil.univ-lyon1.fr/CRAN/src/base/R-3/R-3.1.2.tar.gz && tar -zxf R-3.1.2.tar.gz",br(),"mkdir /some/location/r_bin",br(),
"cd R-3.1.2/ && ./configure --prefix=/some/location/r_bin/ && make && make install && /some/location/r_bin/bin/R", br(),
"# Download SHAMAN package",br(),"wget ftp://shiny01.hosting.pasteur.fr/pub/shaman_package.tar.gz"), br(),
p("This installation will not interact with other R installation. Then, you can install shaman with packrat:", a("here", target="_blank", href="shamanapp.R"), "and executed as following :"),
wellPanel(style = 'width: 150%; word-wrap: break-word;',"# Install SHAMAN dependencies",br(),
"mkdir /some/location/shaman", br(), "/some/location/r_bin/bin/R",br(),
"install.packages(\"packrat\")",br(),"packrat::unbundle(\"shaman_package.tar.gz\", \"/packrat/location/shaman\")"),
p("Now you can run SHAMAN:"),
wellPanel(style = 'width: 50%; word-wrap: break-word;',"library(packrat)",br(),"packrat::init(\"/packrat/location/shaman\")",br(),"library(shiny)",br(),
"system(\"Rscript -e 'library(\\\"shiny\\\");runGitHub(\\\"pierreLec/KronaRShy\\\",port=5438)'\",wait=FALSE)",
br(),"runGitHub('aghozlane/shaman')")),
tabPanel("R install (DEPRECATED)",
p("SHAMAN is available for R=3.1.2. A more recent installation of R will break the differential abundance interface. The installation, download and execution can all be performed with a small R script:",style = "font-family: 'times'; font-si16pt"),
wellPanel(style = 'width: 50%; word-wrap: break-word;',"# Load shiny packages",br(),
"if(!require('shiny')){",br()," install.packages('shiny')",br()," library(shiny)",br(),"}",br(),
"system(\"Rscript -e 'library(\\\"shiny\\\");runGitHub(\\\"pierreLec/KronaRShy\\\",port=5438)'\",wait=FALSE)",
br(),"# Install dependencies,",br(),"# download last version from github,",br(),"# and run SHAMAN in one command:",br(),"runGitHub('aghozlane/shaman')"),
p("This script can also be dowloaded", a("here", target="_blank", href="shamanapp.R"), "and executed as following :"),
wellPanel(style = 'width: 50%; word-wrap: break-word;',"chmod +x ./shamanapp.R && Rscript ./shamanapp.R")),
p("Of note, the R version has an impact on the contrast definition. DESeq2 contrast are harder to define on R>3.2."),
p("Contribution to SHAMAN code are always welcome and can be performed with the", a("github deposit.",href="https://github.com/aghozlane/shaman")
))
wellPanel(style = 'width: 50%; word-wrap: break-word;',"chmod +x ./shamanapp.R && Rscript ./shamanapp.R"),br(),
p("Of note, contribution to SHAMAN code are always welcome and can be performed with the", a("github deposit.",href="https://github.com/aghozlane/shaman")))
)
)
)
)
......@@ -1050,7 +1072,7 @@ body <- dashboardBody(
## BARPLOT
##################
conditionalPanel(condition="input.PlotVisuSelect=='Barplot'",
radioButtons("positionBarPlot","Position",c("Grouped"="fill","Stacked"="dodge"),inline=TRUE)
radioButtons("positionBarPlot","Position",c("Grouped"="dodge","Stacked"="fill"), selected = "fill",inline=TRUE)
),
selectInput("Exp_format_Visu",h5(strong("Export format")),c("png"="png","pdf"="pdf","eps"="eps","svg"="svg"), multiple = FALSE),
fluidRow(
......
.mainwell {
background-color: #f5f5f5;
border-radius: 4px;
border: 1px solid #e3e3e3;
margin-bottom: 20px;
padding: 19px;
min-height: 20px;
float: none;
}
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