Commit 5821f7b5 authored by svolant's avatar svolant
Browse files

Bug fix chargement target

parent 81a6528e
......@@ -158,7 +158,7 @@ CheckTargetModel <- function(input,target,labeled,CT)
## Full rank matrix
if(is.null(Error) && length(InterVar)>0)
{
design = GetDesign(input)
design = GetDesign(input,target)
testRank = CheckMatrixRank(design,target)
if(!testRank){
Error = "The model matrix is not full rank. One or more variables or interaction terms
......
......@@ -72,15 +72,17 @@ Get_dds_object <- function(input,counts,target,design,normFactorsOTU,CT_noNorm,C
## Get the design according to the input
GetDesign <- function(input)
GetDesign <- function(input,target)
{
design = NULL
Interaction = NULL
InterVar = input$InterestVar
if(length(InterVar)>1) Interaction = input$Interaction2
alltmp = c(InterVar,Interaction)
if(length(alltmp)>0) design = as.formula(paste("~", paste0(alltmp, collapse= "+")))
if(!any(!InterVar%in%colnames(target)))
{
if(length(InterVar)>1) Interaction = input$Interaction2
alltmp = c(InterVar,Interaction)
if(length(alltmp)>0) design = as.formula(paste("~", paste0(alltmp, collapse= "+")))
}
return(design)
}
......
......@@ -193,7 +193,7 @@ shinyServer(function(input, output,session) {
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))
design = GetDesign(isolate(input),target)
ChTM = CheckTargetModel(input,target,labeled,data$counts)$Error
if(!is.null(design) && is.null(ChTM))
......@@ -481,6 +481,7 @@ shinyServer(function(input, output,session) {
inFile <- input$fileTarget
counts = dataInput()$data$counts
labeled = 0
data = NULL
if (is.null(inFile)) return(NULL)
......@@ -493,7 +494,7 @@ shinyServer(function(input, output,session) {
names = colnames(data)
## Change the rownames
rownames(data) <- as.character(data[, 1])
if(!TRUE%in%duplicated(data[,1])) rownames(data)=as.character(data[,1])
## Keep only the row which are in the count table
ind = which(rownames(data)%in%colnames(counts))
......@@ -1141,7 +1142,7 @@ shinyServer(function(input, output,session) {
ResDiffAnal <-eventReactive(input$RunDESeq,withProgress({
target = dataInputTarget()$target
design = GetDesign(input)
design = GetDesign(input,target)
dMC = dataMergeCounts()
counts = dMC$counts
CT_noNorm = dMC$CT_noNorm
......
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