Commit 1341b3fc authored by Amine  GHOZLANE's avatar Amine GHOZLANE
Browse files

Include Stevenn modification for project number from upload your data section

parent 12721cab
......@@ -574,6 +574,7 @@ GetCountsMerge <- function(input,dataInput,taxoSelect,target,design)
normFactors = NULL
FeatureSize = NULL
CT_Norm = NULL
Error = NULL
## Counts and taxo tables
CT = dataInput$counts
......@@ -607,13 +608,15 @@ GetCountsMerge <- function(input,dataInput,taxoSelect,target,design)
CT=CT_int
} else CT = CT[,ind]
print("start order")
## Order CT according to the target
CT = OrderCounts(counts=CT,labels=labels)$CountsOrder
CT_noNorm = CT
RowProd = sum(apply(CT_noNorm,1,prod))
print("end order")
merged_table = merge(CT, taxo, by="row.names")
save(merged_table, file = "/tmp/wtf.rdata")
print("end merged")
CT = as.data.frame(merged_table[,2: (dim(CT)[2]+1)])
taxo = as.data.frame(merged_table[,(dim(CT)[2]+2):dim(merged_table)[2]])
......@@ -622,96 +625,99 @@ GetCountsMerge <- function(input,dataInput,taxoSelect,target,design)
colnames(taxo) = namesTaxo
#ordOTU = order(rownames(taxo))
counts_annot = CT
## Create the dds object
dds <- DESeqDataSetFromMatrix(countData=CT, colData=target, design=design,ignoreRank=TRUE)
#save(dds,file="testdds.RData")
if(is.null(VarNorm)){
## Counts normalisation
## Normalisation with or without 0
if(input$AccountForNA=="NonNull" || RowProd==0) dds = estimateSizeFactors(dds,locfunc=eval(as.name(input$locfunc)),geoMeans=GeoMeansCT(CT))
if(input$AccountForNA=="All" && RowProd!=0) dds = estimateSizeFactors(dds,locfunc=eval(as.name(input$locfunc)))
if(input$AccountForNA=="Weighted" && input$AccountForNA!="NonNull" ) {dds = estimateSizeFactors(dds,locfunc=eval(as.name(input$locfunc)),geoMeans=GeoMeansCT(CT)); sizeFactors(dds) = w.sizefactor(CT)}
if(input$AccountForNA=="Total counts") { sizeFactors(dds) = colSums(CT)/mean(colSums(CT))}
normFactors = sizeFactors(dds)
} else{
group = as.data.frame(target[,VarNorm])
group = apply(group,1,paste, collapse = "-")
normFactors = c()
mod = unique(group)
## At least 2 samples are needed for the normalization
if(min(table(group))>1){
for(i in unique(group))
{
indgrp = which(group==i)
CT_tmp = CT[,indgrp]
CT_tmp = removeNulCounts(CT_tmp)
target_tmp = data.frame(labels = rownames(target)[indgrp])
dds_tmp <- DESeqDataSetFromMatrix(countData=CT_tmp, colData=target_tmp, design=~labels,ignoreRank=TRUE)
if(input$AccountForNA=="NonNull") {dds_tmp = estimateSizeFactors(dds_tmp,locfunc=eval(as.name(input$locfunc)),geoMeans=GeoMeansCT(CT_tmp)); normFactors[indgrp] = sizeFactors(dds_tmp)}
if(input$AccountForNA=="All") {dds_tmp = estimateSizeFactors(dds_tmp,locfunc=eval(as.name(input$locfunc))); normFactors[indgrp] = sizeFactors(dds_tmp)}
if(input$AccountForNA=="Weighted" && input$AccountForNA!="NonNull" ) {dds_tmp = estimateSizeFactors(dds_tmp,locfunc=eval(as.name(input$locfunc)),geoMeans=GeoMeansCT(CT_tmp)); normFactors[indgrp] = w.sizefactor(CT_tmp)}
if(input$AccountForNA=="Total counts") { normFactors[indgrp] = colSums(CT_tmp)/mean(colSums(CT_tmp))}
}
} else{
if(0%in%colSums(counts_annot)){Error = "At least one of the column of the counts table is 0" }
else{
print("DDS start")
## Create the dds object
dds <- DESeqDataSetFromMatrix(countData=CT, colData=target, design=design,ignoreRank=TRUE)
print("DDS end")
#save(dds,file="testdds.RData")
if(is.null(VarNorm)){
## Counts normalisation
## Normalisation with or without 0
if(input$AccountForNA=="NonNull" || RowProd==0) dds = estimateSizeFactors(dds,locfunc=eval(as.name(input$locfunc)),geoMeans=GeoMeansCT(CT))
if(input$AccountForNA=="All" && RowProd!=0) dds = estimateSizeFactors(dds,locfunc=eval(as.name(input$locfunc)))
if(input$AccountForNA=="Weighted" && input$AccountForNA!="NonNull" ) {dds = estimateSizeFactors(dds,locfunc=eval(as.name(input$locfunc)),geoMeans=GeoMeansCT(CT)); sizeFactors(dds) = w.sizefactor(CT)}
if(input$AccountForNA=="Total counts") { sizeFactors(dds) = colSums(CT)/mean(colSums(CT))}
normFactors = sizeFactors(dds)
} else{
group = as.data.frame(target[,VarNorm])
group = apply(group,1,paste, collapse = "-")
normFactors = c()
mod = unique(group)
## At least 2 samples are needed for the normalization
if(min(table(group))>1){
for(i in unique(group))
{
indgrp = which(group==i)
CT_tmp = CT[,indgrp]
CT_tmp = removeNulCounts(CT_tmp)
target_tmp = data.frame(labels = rownames(target)[indgrp])
dds_tmp <- DESeqDataSetFromMatrix(countData=CT_tmp, colData=target_tmp, design=~labels,ignoreRank=TRUE)
if(input$AccountForNA=="NonNull") {dds_tmp = estimateSizeFactors(dds_tmp,locfunc=eval(as.name(input$locfunc)),geoMeans=GeoMeansCT(CT_tmp)); normFactors[indgrp] = sizeFactors(dds_tmp)}
if(input$AccountForNA=="All") {dds_tmp = estimateSizeFactors(dds_tmp,locfunc=eval(as.name(input$locfunc))); normFactors[indgrp] = sizeFactors(dds_tmp)}
if(input$AccountForNA=="Weighted" && input$AccountForNA!="NonNull" ) {dds_tmp = estimateSizeFactors(dds_tmp,locfunc=eval(as.name(input$locfunc)),geoMeans=GeoMeansCT(CT_tmp)); normFactors[indgrp] = w.sizefactor(CT_tmp)}
if(input$AccountForNA=="Total counts") { normFactors[indgrp] = colSums(CT_tmp)/mean(colSums(CT_tmp))}
}
} else{
if(input$AccountForNA=="NonNull" || RowProd==0) dds = estimateSizeFactors(dds,locfunc=eval(as.name(input$locfunc)),geoMeans=GeoMeansCT(CT))
if(input$AccountForNA=="All" && RowProd!=0) dds = estimateSizeFactors(dds,locfunc=eval(as.name(input$locfunc)))
if(input$AccountForNA=="Weighted" && input$AccountForNA!="NonNull" ) {dds = estimateSizeFactors(dds,locfunc=eval(as.name(input$locfunc)),geoMeans=GeoMeansCT(CT)); sizeFactors(dds) = w.sizefactor(CT)}
if(input$AccountForNA=="Total counts") { sizeFactors(dds) = colSums(CT)/mean(colSums(CT))}
normFactors = sizeFactors(dds)
}
sizeFactors(dds) = normFactors
}
sizeFactors(dds) = normFactors
}
## Keep normalized OTU table
CT_Norm = counts(dds, normalized=TRUE)
# Only interesting OTU
# merged_table = merge(CT, taxo[order(rownames(CT)),], by="row.names")
# merged_table = merge(CT, taxo, by="row.names")
# CT = as.data.frame(merged_table[,2: (dim(CT)[2]+1)])
# taxo = as.data.frame(merged_table[,(dim(CT)[2]+2):dim(merged_table)[2]])
#
# rownames(CT) = merged_table[,1]
# rownames(taxo) = merged_table[,1]
# #ordOTU = order(rownames(taxo))
# counts_annot = CT
# ordOTU = order(rownames(taxo))
# indOTU_annot = which(rownames(CT)%in%rownames(taxo))
# counts_annot = CT[indOTU_annot[ordOTU],]
## Aggregate matrix
if(taxoSelect=="OTU/Gene") counts = counts_annot
else{
if(input$TypeTable == "MGS" && input$FileFormat!="fileBiom"){
MGS_taxocol = which(toupper(colnames(taxo))%in%"MGS")
taxoS = taxo[,MGS_taxocol]
counts = aggregate(counts_annot,by=list(Taxonomy = taxoS),mean)
rownames(counts)=counts[,1]
counts=counts[,-1]
counts_int=t(apply(counts,1,as.integer))
rownames(counts_int)=rownames(counts)
colnames(counts_int)=colnames(counts)
counts=counts_int
}
if(taxoSelect != "MGS" || input$FileFormat=="fileBiom"){
#taxoS = taxo[ordOTU,taxoSelect]
taxoS = taxo[,taxoSelect]
counts = aggregate(counts_annot,by=list(Taxonomy = taxoS),sum)
rownames(counts)=counts[,1];counts=counts[,-1]
## Keep normalized OTU table
CT_Norm = counts(dds, normalized=TRUE)
# Only interesting OTU
# merged_table = merge(CT, taxo[order(rownames(CT)),], by="row.names")
# merged_table = merge(CT, taxo, by="row.names")
# CT = as.data.frame(merged_table[,2: (dim(CT)[2]+1)])
# taxo = as.data.frame(merged_table[,(dim(CT)[2]+2):dim(merged_table)[2]])
#
# rownames(CT) = merged_table[,1]
# rownames(taxo) = merged_table[,1]
# #ordOTU = order(rownames(taxo))
# counts_annot = CT
# ordOTU = order(rownames(taxo))
# indOTU_annot = which(rownames(CT)%in%rownames(taxo))
# counts_annot = CT[indOTU_annot[ordOTU],]
## Aggregate matrix
if(taxoSelect=="OTU/Gene") counts = counts_annot
else{
if(input$TypeTable == "MGS" && input$FileFormat!="fileBiom"){
MGS_taxocol = which(toupper(colnames(taxo))%in%"MGS")
taxoS = taxo[,MGS_taxocol]
counts = aggregate(counts_annot,by=list(Taxonomy = taxoS),mean)
rownames(counts)=counts[,1]
counts=counts[,-1]
counts_int=t(apply(counts,1,as.integer))
rownames(counts_int)=rownames(counts)
colnames(counts_int)=colnames(counts)
counts=counts_int
}
if(taxoSelect != "MGS" || input$FileFormat=="fileBiom"){
#taxoS = taxo[ordOTU,taxoSelect]
taxoS = taxo[,taxoSelect]
counts = aggregate(counts_annot,by=list(Taxonomy = taxoS),sum)
rownames(counts)=counts[,1];counts=counts[,-1]
}
}
## Ordering the counts table according to the target labels
tmpOrder = OrderCounts(counts,normFactors,labels)
counts = tmpOrder$CountsOrder
normFactors = tmpOrder$normFactorsOrder
CheckTarget = TRUE
}
## Ordering the counts table according to the target labels
tmpOrder = OrderCounts(counts,normFactors,labels)
counts = tmpOrder$CountsOrder
normFactors = tmpOrder$normFactorsOrder
CheckTarget = TRUE
}
return(list(counts=counts,CheckTarget=CheckTarget,normFactors=normFactors, CT_noNorm=CT_noNorm, CT_Norm =CT_Norm))
return(list(counts=counts,CheckTarget=CheckTarget,normFactors=normFactors, CT_noNorm=CT_noNorm, CT_Norm =CT_Norm, Error = Error))
#return(list(counts=counts,target=target[ind,],labeled=labeled,normFactors=normFactors, CT_noNorm=CT_noNorm))
}
......
shinyServer(function(input, output,session) {
hide(id = "loading-content", anim = TRUE, animType = "fade",time=1.5)
hide(id = "loading-content-bar", anim = TRUE, animType = "fade",time=1.5)
#####################################################
......@@ -20,7 +20,7 @@ shinyServer(function(input, output,session) {
## JSON name for masque
curdir = getwd()
json_name = tempfile(pattern = "file", tmpdir = paste(curdir,"www","masque","todo",sep= .Platform$file.sep), fileext = ".json")
## Pass for MASQUE
pass = gsub("file","",basename(file_path_sans_ext(json_name)))
......@@ -41,7 +41,7 @@ shinyServer(function(input, output,session) {
inFile <- input$fileCounts
if (is.null(inFile) && is.null(values$count_table_masque)) return(NULL)
#if (is.null(inFile)) return(NULL)
if (!is.null(values$count_table_masque) && file.exists(values$count_table_masque)){
tryCatch(read.csv(values$count_table_masque,sep="\t",header=TRUE,check.names=FALSE)->data,
error=function(e) sendSweetAlert(messageId="ErrorCounts",
......@@ -61,7 +61,7 @@ shinyServer(function(input, output,session) {
if(!TRUE%in%duplicated(data[,1])) rownames(data)=data[,1];data=data[,-1]
try(round(data, 0)->data, silent=T)
}
return(as.data.frame(data))
})
......@@ -71,17 +71,17 @@ shinyServer(function(input, output,session) {
dataInputTaxo <-reactive({
inFile <- input$fileTaxo
if (is.null(inFile) && is.null(values$rdp_annot_masque)) return(NULL)
#if (is.null(inFile)) return(NULL)
if(input$TypeTaxo=="Table" && !is.null(inFile))
{
tryCatch(read.csv(inFile$datapath,sep=input$septaxo,header=TRUE)->data,
error=function(e) sendSweetAlert(messageId="ErrorTaxo",
title = "Oops",
text=paste("Your file can not be read in SHAMAN.\n \n",e),type ="error"))
## Rownames
if(!is.null(data))
{
......@@ -126,14 +126,14 @@ shinyServer(function(input, output,session) {
data = NULL
inFile <- input$fileBiom
if (!is.null(inFile) && is.null(values$biom_masque)){
tryCatch(read_biom(inFile$datapath)->data,
error=function(e) sendSweetAlert(messageId="ErrorBiom1",
title = "Oops",
text=paste("Your file can not be read in SHAMAN.\n \n",e),type ="error"))
}
}
if (!is.null(values$biom_masque) && file.exists(values$biom_masque)){
tryCatch(read_biom(values$biom_masque)->data,
error=function(e) sendSweetAlert(messageId="ErrorBiom2",
......@@ -153,14 +153,14 @@ shinyServer(function(input, output,session) {
observeEvent(input$fileBiom,{
values$biom_masque=NULL;
})
## Unifrac File (tree)
dataInputTree <-reactive({
data = NULL
inFile <- input$fileTree
if (!is.null(inFile) && is.null(values$tree_masque)) {
try(read.tree(inFile$datapath)->data, silent=T)
CheckTree = CheckTreeFile(data)
......@@ -176,7 +176,7 @@ shinyServer(function(input, output,session) {
try(readLines(values$tree_masque)->treeseq, silent=T)
return(list(data=data, Error=CheckTree$Error, Warning=CheckTree$Warning, treeseq=treeseq))
}
})
......@@ -205,7 +205,7 @@ shinyServer(function(input, output,session) {
}
return(res)
})
observe({
val <- input$annotationKingdomthreshold
# Control the value, min, max, and step.
......@@ -292,17 +292,17 @@ shinyServer(function(input, output,session) {
}
# if(input$FileFormat=="fileRData")
# {
# inFile <- input$fileRData
# load(inFile)
# if(!is.null(inputData)){
# data = inputData$data
# check = inputData$check
# percent = inputData$percent
# }
# }
# if(input$FileFormat=="fileRData")
# {
# inFile <- input$fileRData
# load(inFile)
# if(!is.null(inputData)){
# data = inputData$data
# check = inputData$check
# percent = inputData$percent
# }
# }
return(list(data=data,check=check,percent=percent))
})
......@@ -362,36 +362,47 @@ shinyServer(function(input, output,session) {
CT_noNorm = NULL
CT_Norm = NULL
ChTM = NULL
ChMC = NULL
data = isolate(dataInput()$data)
target = isolate(values$TargetWorking)
labeled= isolate(values$labeled)
taxo = isolate(input$TaxoSelect)
print("here-1")
withProgress(
if(!is.null(data$counts) && !is.null(data$taxo) && nrow(data$counts)>0 && nrow(data$taxo)>0 && !is.null(taxo) && taxo!="..." && !is.null(target))
{
design = GetDesign(isolate(input),target)
ChTM = CheckTargetModel(input,target,labeled,data$counts)$Error
if(!is.null(design) && is.null(ChTM))
if(!is.null(data$counts) && !is.null(data$taxo) && nrow(data$counts)>0 && nrow(data$taxo)>0 && !is.null(taxo) && taxo!="..." && !is.null(target))
{
tmp = isolate(GetCountsMerge(input,data,taxo,target,design))
counts = tmp$counts
## Filtering the counts
if(isolate(input$AddFilter) && !is.null(isolate(input$SliderThSamp)) && !is.null(isolate(input$SliderThAb)))
print("here0")
design = GetDesign(isolate(input),target)
ChTM = CheckTargetModel(input,target,labeled,data$counts)$Error
if(!is.null(design) && is.null(ChTM))
{
ind.filter =Filtered_feature(counts,isolate(input$SliderThSamp),isolate(input$SliderThAb))$ind
counts = counts[-ind.filter,]
print("here")
tmp = isolate(GetCountsMerge(input,data,taxo,target,design))
ChMC = tmp$Error
if (!is.null(ChMC))
{
print("here_getcount")
counts = tmp$counts
## Filtering the counts
if(isolate(input$AddFilter) && !is.null(isolate(input$SliderThSamp)) && !is.null(isolate(input$SliderThAb)))
{
print("here1")
ind.filter =Filtered_feature(counts,isolate(input$SliderThSamp),isolate(input$SliderThAb))$ind
counts = counts[-ind.filter,]
}
print("here2")
CheckTarget = tmp$CheckTarget
#target = tmp$target
#labeled = tmp$labeled
normFactors = tmp$normFactors
## OTU table, norm and no norm
CT_noNorm = tmp$CT_noNorm
CT_Norm = tmp$CT_Norm
}
}
CheckTarget = tmp$CheckTarget
#target = tmp$target
#labeled = tmp$labeled
normFactors = tmp$normFactors
## OTU table, norm and no norm
CT_noNorm = tmp$CT_noNorm
CT_Norm = tmp$CT_Norm
}
}
,message="Merging the counts ...")
return(list(counts=counts,CheckTarget=CheckTarget,normFactors=normFactors,CT_noNorm=CT_noNorm, CT_Norm=CT_Norm))
,message="Merging the counts ...")
return(list(counts=counts,CheckTarget=CheckTarget,normFactors=normFactors,CT_noNorm=CT_noNorm, CT_Norm=CT_Norm, Error = ChMC))
#return(list(counts=counts,target=target,labeled=labeled,normFactors=normFactors,CT_noNorm=CT_noNorm))
})
......@@ -444,7 +455,7 @@ shinyServer(function(input, output,session) {
check = tmp$check
cond = (!is.null(data$counts) && nrow(data$counts)>0 && !is.null(data$taxo) && nrow(data$taxo)>0)
res = shinydashboard::valueBox(paste0(0, "%"),h6(strong("Annotated features")), color = "light-blue",width=NULL,icon = icon("list"))
if(cond)
{
percent = round(100*tmp$percent,2)
......@@ -500,7 +511,7 @@ shinyServer(function(input, output,session) {
plot_filter(counts,input$SliderThSamp,input$SliderThAb,type="Abundance")
})
output$Plot_ThSamp <- renderPlot({
counts = dataMergeCounts()$counts
## output of plot_filter is ggplot class
......@@ -530,22 +541,22 @@ shinyServer(function(input, output,session) {
CheckOK = (is.null(check$CheckCounts$Error) && is.null(check$CheckTaxo$Error) && is.null(check$CheckPercent))
if(!is.null(data$counts) && !is.null(data$taxo) && nrow(data$counts)>0 && nrow(data$taxo)>0 && CheckOK)
{
sidebarMenu(id = "side",
menuItem("Statistical analysis",
menuSubItem("Run differential analysis",tabName="RunDiff"),
menuSubItem("Diagnostic plots",tabName="DiagPlotTab"),
menuSubItem("Tables",tabName="TableDiff"),
icon = icon("bar-chart-o"), tabName = "AnaStat"
),
menuItem("Visualization",icon = icon("area-chart"),
menuSubItem("Global views",tabName="GlobVisu"),
menuSubItem("Comparison plots",tabName="CompPlot"),
tabName = "Visu")
#menuItem("Perspective plots", icon = icon("pie-chart"), tabName = "Krona")
menuItem("Statistical analysis",
menuSubItem("Run differential analysis",tabName="RunDiff"),
menuSubItem("Diagnostic plots",tabName="DiagPlotTab"),
menuSubItem("Tables",tabName="TableDiff"),
icon = icon("bar-chart-o"), tabName = "AnaStat"
),
menuItem("Visualization",icon = icon("area-chart"),
menuSubItem("Global views",tabName="GlobVisu"),
menuSubItem("Comparison plots",tabName="CompPlot"),
tabName = "Visu")
#menuItem("Perspective plots", icon = icon("pie-chart"), tabName = "Krona")
)
} else{ sidebarMenu(id = "side",NULL)}
})
......@@ -569,10 +580,10 @@ shinyServer(function(input, output,session) {
#resDiff = ResDiffAnal()
#BaseContrast = read.table(namesfile,header=TRUE)
GetData_venn(input,input$ContrastList_table_FC,read.table(namesfile,header=TRUE),ResDiffAnal())$df.tot,
#}
options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')),
pageLength = 10,scrollX=TRUE, processing=FALSE
))
#}
options = list(lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')),
pageLength = 10,scrollX=TRUE, processing=FALSE
))
## Taxonomy table
......@@ -590,23 +601,23 @@ shinyServer(function(input, output,session) {
res=NULL
if(!is.null(tree))
{
res = tabBox(width = NULL, selected = "Count table",
tabPanel("Count table",DT::dataTableOutput("DataCounts")),
tabPanel("Taxonomy",DT::dataTableOutput("DataTaxo")),
tabPanel("Summary",h5(strong("Percentage of annotation")),htmlOutput("SummaryView"),
br(),h5(strong("Number of features by level:")),plotOutput("SummaryViewBarplot",width = 1200,height=500)),
tabPanel("Phylogeny", PhyloTreeMetaROutput('PhyloTreeMetaR'))
)
res = tabBox(width = NULL, selected = "Count table",
tabPanel("Count table",DT::dataTableOutput("DataCounts")),
tabPanel("Taxonomy",DT::dataTableOutput("DataTaxo")),
tabPanel("Summary",h5(strong("Percentage of annotation")),htmlOutput("SummaryView"),
br(),h5(strong("Number of features by level:")),plotOutput("SummaryViewBarplot",width = 1200,height=500)),
tabPanel("Phylogeny", PhyloTreeMetaROutput('PhyloTreeMetaR'))
)
}
else if(is.null(tree))
{
res = tabBox(width = NULL,selected = "Count table",
tabPanel("Count table",DT::dataTableOutput("DataCounts")),
tabPanel("Taxonomy",DT::dataTableOutput("DataTaxo")),
tabPanel("Summary",h5(strong("Percentage of annotation")),htmlOutput("SummaryView"),
br(),h5(strong("Number of features by level:")),plotOutput("SummaryViewBarplot",width = 1200,height=500))
)
res = tabBox(width = NULL,selected = "Count table",
tabPanel("Count table",DT::dataTableOutput("DataCounts")),
tabPanel("Taxonomy",DT::dataTableOutput("DataTaxo")),
tabPanel("Summary",h5(strong("Percentage of annotation")),htmlOutput("SummaryView"),
br(),h5(strong("Number of features by level:")),plotOutput("SummaryViewBarplot",width = 1200,height=500))
)
}
return(res)
......@@ -616,7 +627,7 @@ shinyServer(function(input, output,session) {
data=dataInput()$data
if(!is.null(data$counts) && !is.null(data$taxo) && nrow(data$counts)>0 && nrow(data$taxo)>0)
{
showElement("tabboxdata_col",anim=TRUE)
showElement("tabboxdata_col",anim=TRUE)
} else hideElement("tabboxdata_col",anim=TRUE)
})
......@@ -632,7 +643,7 @@ shinyServer(function(input, output,session) {
counts = data$counts
check = tmp$check
cond = (!is.null(data$counts) && nrow(data$counts)>0 && !is.null(data$taxo) && nrow(data$taxo)>0 && is.null(check$CheckTaxo$Error) && is.null(check$CheckCounts$Error))
res = NULL
if(cond)
{
......@@ -672,7 +683,7 @@ shinyServer(function(input, output,session) {
counts = data$counts
check = tmp$check
cond = (!is.null(data$counts) && nrow(data$counts)>0 && !is.null(data$taxo) && nrow(data$taxo)>0 && is.null(check$CheckTaxo$Error) && is.null(check$CheckCounts$Error))
res = NULL
if(cond)
{
......@@ -734,8 +745,8 @@ shinyServer(function(input, output,session) {
}
values$TargetWorking = as.data.frame(data)
# ind_sel = Target_selection()
# if(length(ind))
# ind_sel = Target_selection()
# if(length(ind))
# target = as.data.frame(apply(target,2,gsub,pattern = "-",replacement = "."))
#ord = order(rownames(data))
......@@ -753,7 +764,7 @@ shinyServer(function(input, output,session) {
# return(list(target = target, labeled=labeled))
})
#############################################################
......@@ -769,13 +780,13 @@ shinyServer(function(input, output,session) {
inFiles <- input$dir
if (!is.null(inFiles)){
# values$fastq_names_only = unique(paste(values$fastq_names_only,inFiles$name))
values$paths_fastq_tmp = rbind(isolate(values$paths_fastq_tmp),inFiles)
values$fastq_names_only = isolate(unique(values$paths_fastq_tmp[,"name"]))
# values$fastq_names_only = unique(paste(values$fastq_names_only,inFiles$name))
values$paths_fastq_tmp = rbind(isolate(values$paths_fastq_tmp),inFiles)
values$fastq_names_only = isolate(unique(values$paths_fastq_tmp[,"name"]))
}
})
## Create a fasta file containing the contaminant
CreateFasta <- reactive({
......@@ -796,9 +807,9 @@ shinyServer(function(input, output,session) {
#activate check_mail
CMP = CheckMasque(input, values,check_mail = TRUE)
Error = CMP$Error
isJSONalreadyExist = file.exists(paste(values$curdir,"www","masque","doing",basename(json_name),sep= .Platform$file.sep))
if(is.null(Error) && !isJSONalreadyExist)
{
CreateFasta()
......@@ -807,8 +818,8 @@ shinyServer(function(input, output,session) {
# home <- normalizePath("~")
home <- ""<