Commit b13aaf5c authored by svolant's avatar svolant
Browse files

check en fonction de la version de R pour DESeq functions

parent 661b06f1
......@@ -37,7 +37,8 @@ Get_dds_object <- function(input,counts,target,design,normFactorsOTU,CT_noNorm,C
{
dds <- DESeqDataSetFromMatrix(countData=counts, colData=target, design=design,ignoreRank = TRUE)
sizeFactors(dds) = normFactorsOTU
ddstmp = NULL
# dds <- estimateDispersions(dds, fitType=input$fitType)
# if(as.numeric(R.Version()$major)>=3 && as.numeric(R.Version()$minor) >=1.3){
# dds <- nbinomWaldTest(dds)
......@@ -47,9 +48,20 @@ Get_dds_object <- function(input,counts,target,design,normFactorsOTU,CT_noNorm,C
# countsNorm = counts(dds, normalized = TRUE)
if(as.numeric(R.Version()$major)>=3 && as.numeric(R.Version()$minor) >=1.3){
dds <- dds <- DESeq(dds,fitType=input$fitType,parallel = TRUE,minReplicatesForReplace = Inf)
if(nrow(counts)*nrow(target)>=50000)
{
try(DESeq(dds,fitType=input$fitType,parallel = TRUE,minReplicatesForReplace = Inf) ->ddstmp,silent = TRUE)
if(!is.null(ddstmp)) dds = ddstmp
}
if(nrow(counts)*nrow(target)<50000 || is.null(ddstmp))
{
dds <- estimateDispersions(dds, fitType=input$fitType)
dds <- nbinomWaldTest(dds)
}
}else{
dds <- dds <- DESeq(dds,fitType=input$fitType,modelMatrixType = "expanded",parallel = TRUE)
dds <- estimateDispersions(dds, fitType=input$fitType)
dds <- nbinomWaldTest(dds,modelMatrixType = "expanded")
# dds <- DESeq(dds,fitType=input$fitType,modelMatrixType = "expanded",parallel = TRUE)
}
countsNorm = counts(dds, normalized = TRUE)
......
......@@ -1228,9 +1228,7 @@ shinyServer(function(input, output,session) {
## Return NULL if there is no error
if(!is.null(target)) ChTM = CheckTargetModel(input,target,labeled,CT)
print(ChTM$Error)
if(!is.null(ChTM$Error)) {
print("OK")
box(title = "Error", status = "danger",width = 6,
h6(strong(ChTM$Error)),
footer = em("Reminder: Your target file must contain at least 2 columns and 2 rows. NA's values are not allowed and the variables must not be collinear.")
......
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