Commit a67b11b4 authored by svolant's avatar svolant
Browse files

Correction bug Processing + modif merge table

parent 02d02eb6
...@@ -195,6 +195,7 @@ GetCountsMerge <- function(input,dataInput,taxoSelect,target,design) ...@@ -195,6 +195,7 @@ GetCountsMerge <- function(input,dataInput,taxoSelect,target,design)
CT=CT_int CT=CT_int
} else CT = CT[,ind] } else CT = CT[,ind]
save.image("test.RData")
## Order CT according to the target ## Order CT according to the target
CT = OrderCounts(counts=CT,labels=labels)$CountsOrder CT = OrderCounts(counts=CT,labels=labels)$CountsOrder
CT_noNorm = CT CT_noNorm = CT
...@@ -239,9 +240,10 @@ GetCountsMerge <- function(input,dataInput,taxoSelect,target,design) ...@@ -239,9 +240,10 @@ GetCountsMerge <- function(input,dataInput,taxoSelect,target,design)
## Keep normalized OTU table ## Keep normalized OTU table
CT_Norm = counts(dds, normalized=TRUE) CT_Norm = counts(dds, normalized=TRUE)
save(CT_Norm,dds,CT,taxo,taxoSelect,file="test.RData")
# Only interesting OTU # Only interesting OTU
merged_table = merge(CT, taxo[order(rownames(CT)),], by="row.names") # merged_table = merge(CT, taxo[order(rownames(CT)),], by="row.names")
merged_table = merge(CT, taxo, by="row.names")
CT = merged_table[,2: (dim(CT)[2]+1)] CT = merged_table[,2: (dim(CT)[2]+1)]
taxo = merged_table[,(dim(CT)[2]+2):dim(merged_table)[2]] taxo = merged_table[,(dim(CT)[2]+2):dim(merged_table)[2]]
rownames(CT) = merged_table[,1] rownames(CT) = merged_table[,1]
......
...@@ -46,7 +46,7 @@ shinyServer(function(input, output,session) { ...@@ -46,7 +46,7 @@ shinyServer(function(input, output,session) {
inFile <- input$fileTaxo inFile <- input$fileTaxo
if (is.null(inFile)) return(NULL) if (is.null(inFile)) return(NULL)
print(input$TypeTaxo)
if(input$TypeTaxo=="Table") if(input$TypeTaxo=="Table")
{ {
data = read.csv(inFile$datapath,sep="\t",header=TRUE) data = read.csv(inFile$datapath,sep="\t",header=TRUE)
...@@ -315,7 +315,7 @@ shinyServer(function(input, output,session) { ...@@ -315,7 +315,7 @@ shinyServer(function(input, output,session) {
output$DataCounts <- renderDataTable( output$DataCounts <- renderDataTable(
dataInput()$data$counts, dataInput()$data$counts,
options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')), options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')),
pageLength = 10,scrollX=TRUE pageLength = 10,scrollX=TRUE, processing=FALSE
)) ))
## Counts Table ## Counts Table
...@@ -325,7 +325,7 @@ shinyServer(function(input, output,session) { ...@@ -325,7 +325,7 @@ shinyServer(function(input, output,session) {
BaseContrast = read.table(namesfile,header=TRUE) BaseContrast = read.table(namesfile,header=TRUE)
GetData_venn(input,SelContrast,BaseContrast,resDiff)$df.tot GetData_venn(input,SelContrast,BaseContrast,resDiff)$df.tot
}, options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')), }, options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')),
pageLength = 10,scrollX=TRUE pageLength = 10,scrollX=TRUE, processing=FALSE
)) ))
...@@ -362,7 +362,7 @@ shinyServer(function(input, output,session) { ...@@ -362,7 +362,7 @@ shinyServer(function(input, output,session) {
if(!is.null(data$counts) && !is.null(data$taxo) && nrow(data$counts)>0 && nrow(data$taxo)>0) if(!is.null(data$counts) && !is.null(data$taxo) && nrow(data$counts)>0 && nrow(data$taxo)>0)
{ {
taxo = rbind(taxo,rep(NA,ncol(taxo))) taxo = rbind(taxo,rep(NA,ncol(taxo)))
tmpPercent = round(apply(is.na(taxo),2,table)["FALSE",]/nrow(counts)*100,2) tmpPercent = round(apply(is.na(taxo),2,table)["FALSE",]/(nrow(taxo)-1)*100,2)
#print(tmpPercent) #print(tmpPercent)
df <- data.frame(Label = colnames(taxo),Value = tmpPercent) df <- data.frame(Label = colnames(taxo),Value = tmpPercent)
...@@ -531,14 +531,14 @@ shinyServer(function(input, output,session) { ...@@ -531,14 +531,14 @@ shinyServer(function(input, output,session) {
output$DataTarget <- renderDataTable( output$DataTarget <- renderDataTable(
dataInputTarget()$target, dataInputTarget()$target,
options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')), options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')),
pageLength = 10,scrollX=TRUE pageLength = 10,scrollX=TRUE, processing=FALSE
)) ))
## Counts table for the selected taxonomy level ## Counts table for the selected taxonomy level
output$CountsMerge <- renderDataTable( output$CountsMerge <- renderDataTable(
round(counts(ResDiffAnal()$dds,normalized=TRUE)), round(counts(ResDiffAnal()$dds,normalized=TRUE)),
options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')), options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')),
pageLength = 10,scrollX=TRUE pageLength = 10,scrollX=TRUE, processing=FALSE
)) ))
...@@ -1140,7 +1140,7 @@ shinyServer(function(input, output,session) { ...@@ -1140,7 +1140,7 @@ shinyServer(function(input, output,session) {
output$SizeFactTable <- renderDataTable( output$SizeFactTable <- renderDataTable(
SizeFactor_table(), SizeFactor_table(),
options = list(scrollX=TRUE,searching = FALSE options = list(scrollX=TRUE,searching = FALSE, processing=FALSE
)) ))
...@@ -1336,21 +1336,21 @@ shinyServer(function(input, output,session) { ...@@ -1336,21 +1336,21 @@ shinyServer(function(input, output,session) {
output$DataDiffcomplete <- renderDataTable( output$DataDiffcomplete <- renderDataTable(
datatable(dataDiff()$complete,rownames = FALSE), datatable(dataDiff()$complete,rownames = FALSE),
options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')), options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')),
pageLength = 10,scrollX=TRUE pageLength = 10,scrollX=TRUE, processing=FALSE
)) ))
## Up diff table ## Up diff table
output$DataDiffup <- renderDataTable( output$DataDiffup <- renderDataTable(
datatable(dataDiff()$up,rownames = FALSE), datatable(dataDiff()$up,rownames = FALSE),
options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')), options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')),
pageLength = 10,scrollX=TRUE pageLength = 10,scrollX=TRUE, processing=FALSE
)) ))
## Down diff table ## Down diff table
output$DataDiffdown <- renderDataTable( output$DataDiffdown <- renderDataTable(
datatable(dataDiff()$down,rownames = FALSE), datatable(dataDiff()$down,rownames = FALSE),
options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')), options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')),
pageLength = 10,scrollX=TRUE pageLength = 10,scrollX=TRUE, processing=FALSE
)) ))
...@@ -1496,14 +1496,14 @@ shinyServer(function(input, output,session) { ...@@ -1496,14 +1496,14 @@ shinyServer(function(input, output,session) {
output$lmRegScatter <- renderDataTable( output$lmRegScatter <- renderDataTable(
Plot_Visu_Scatterplot(input,ResDiffAnal(),lmEst=TRUE)$regCoef, Plot_Visu_Scatterplot(input,ResDiffAnal(),lmEst=TRUE)$regCoef,
options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')), options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')),
pageLength = 10,scrollX=TRUE pageLength = 10,scrollX=TRUE, processing=FALSE
)) ))
## Correlation coefficients Table ## Correlation coefficients Table
output$CorTable <- renderDataTable( output$CorTable <- renderDataTable(
Plot_Visu_Scatterplot(input,ResDiffAnal(),CorEst=TRUE)$cor.est, Plot_Visu_Scatterplot(input,ResDiffAnal(),CorEst=TRUE)$cor.est,
options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')), options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')),
pageLength = 10,scrollX=TRUE pageLength = 10,scrollX=TRUE, processing=FALSE
)) ))
output$lmEquation <- renderPrint({ output$lmEquation <- renderPrint({
...@@ -1550,7 +1550,7 @@ shinyServer(function(input, output,session) { ...@@ -1550,7 +1550,7 @@ shinyServer(function(input, output,session) {
datatable(tmp[,c(4,5,1,2,3)],rownames= FALSE) datatable(tmp[,c(4,5,1,2,3)],rownames= FALSE)
}, },
options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')), options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')),
pageLength = 10,scrollX=TRUE pageLength = 10,scrollX=TRUE, processing=FALSE
)) ))
## Export Diversitytable in .csv ## Export Diversitytable in .csv
......
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