Commit 440c37a3 authored by Stevenn Volant's avatar Stevenn Volant
Browse files

Modif VarInt Visu + correction density + correction clustering

parent 79ab161a
......@@ -365,12 +365,12 @@ CheckCountsTable <- function(counts)
if(type=="hori")
{
par(cex=input$cexTitleDiag,mar = c(0.3,2,0.3,2))
par(cex=input$cexTitleDiag,mar=c(6,6,4,5))
res = plot(dend, main = "Cluster dendrogram",xlab = paste(input$DistClust,"distance, Ward criterion",sep=" "),cex=input$cexLabelDiag)
}
if(type!="hori")
{
par(cex=input$cexTitleDiag,mar = c(0.3,2,0.3,2))
par(cex=input$cexTitleDiag,mar=c(6,6,4,5))
res = circlize_dendrogram(dend, labels_track_height = 0.2, dend_track_height = .3, main = "Cluster dendrogram",xlab = paste(input$DistClust,"distance, Ward criterion",sep=" "))
}
return(res)
......@@ -475,19 +475,19 @@ CheckCountsTable <- function(counts)
par(cex=input$cexTitleDiag,mar=c(8,5,4,5))
plot(density(log2(counts[, 1] + 1)), las = 1, lwd = 2, main = "Density of counts distribution",
xlab = expression(log[2] ~ (raw ~ count + 1)),
ylim = c(0, max(apply(counts, 2, function(x) {max(density(log2(x + 1))$y)})) * 1.05),
ylim = c(-0.2, max(apply(counts, 2, function(x) {max(density(log2(x + 1))$y)})) * 1.05),
lty = if (ncol1) {1}
else{c(1, 2, 3, 4)[as.integer(group[, 2])[1]]},
else{rep(seq(1:6),ceiling(nlevels(group[, 2])/6))[as.integer(group[, 2])[1]]},
col = col[as.integer(group[, 1])[1]])
for (i in 2:ncol(counts))
{
lines(density(log2(counts[, i] + 1)), col = col[as.integer(group[,1])[i]], lwd = 2,
lty = if (ncol1) {1}
else {c(1, 2, 3, 4)[as.integer(group[, 2])[i]]})
else{rep(seq(1:6),ceiling(nlevels(group[, 2])/6))[as.integer(group[, 2])[i]]})
}
legend("topright", levels(group[, 1]), lty = 1, col = col[1:nlevels(group[,1])], lwd = 2, bty = "n")
if (!ncol1) legend("topleft", levels(group[, 2]), lty = c(1, 2, 3, 4)[1:nlevels(group[, 2])], col = 1, lwd = 2, bty = "n")
if (!ncol1) legend("topleft", levels(group[, 2]), lty = rep(seq(1:6),ceiling(nlevels(group[, 2])/6))[1:nlevels(group[, 2])], col = 1, lwd = 2, bty = "n")
}
......
......@@ -410,7 +410,7 @@ shinyServer(function(input, output,session) {
if(!is.null(target))
{
namesTarget = colnames(target)[2:ncol(target)]
selectInput("InterestVar",h6(strong("Select the variables")),namesTarget,selected=namesTarget,multiple=TRUE)
selectInput("InterestVar",h6(strong("Select the variables")),namesTarget,selected=namesTarget[1],multiple=TRUE)
}
})
......@@ -943,11 +943,13 @@ shinyServer(function(input, output,session) {
output$VarIntDiag <- renderUI({
int = input$InterestVar
if(length(int)>=2) intSel = int[c(1,2)]
else intSel = int[1]
target=dataInputTarget()
selectizeInput("VarInt",h6(strong("Select the variables of interest (max 2)")),int, selected = intSel,multiple = TRUE,options = list(maxItems = 2))
if(!is.null(target))
{
namesTarget = colnames(target)[2:ncol(target)]
selectizeInput("VarInt",h6(strong("Select the variables of interest (max 2)")),namesTarget, selected = namesTarget[1],multiple = TRUE,options = list(maxItems = 2))
}
})
......@@ -1382,11 +1384,17 @@ output$RunButton <- renderUI({
output$VarIntVisu <- renderUI({
int = input$InterestVar
if(length(int)>=2) intSel = int[c(1,2)]
else intSel = int[1]
selectizeInput("VisuVarInt",h6(strong("Select the variables of interest")),int, selected = intSel,multiple = TRUE)
# int = input$InterestVar
# if(length(int)>=2) intSel = int[c(1,2)]
# else intSel = int[1]
target=dataInputTarget()
if(!is.null(target))
{
namesTarget = colnames(target)[2:ncol(target)]
selectizeInput("VisuVarInt",h6(strong("Select the variables of interest")),namesTarget, selected = namesTarget[1],multiple = TRUE)
}
})
#####################################################
......
......@@ -306,8 +306,7 @@ body <- dashboardBody(
box(title = "Select your plot", width = NULL, status = "primary", solidHeader = TRUE,collapsible = FALSE,collapsed= FALSE,
selectInput("DiagPlot","",c("Total barplot"="barplotTot","Nul barplot"="barplotNul",
"Maj. taxonomy"="MajTax", "Density"="densityPlot",
"Size factors VS total"="SfactorsVStot", "PCA"="pcaPlot", "PCoA"="pcoaPlot","Clustering" = "clustPlot",
"SERE" = "SERE"))
"Size factors VS total"="SfactorsVStot", "PCA"="pcaPlot", "PCoA"="pcoaPlot","Clustering" = "clustPlot"))
),
box(title = "Options", width = NULL, status = "primary", solidHeader = TRUE,collapsible = TRUE,collapsed= FALSE,
......
Supports Markdown
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