Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amine GHOZLANE
shaman
Commits
5821f7b5
Commit
5821f7b5
authored
Nov 22, 2016
by
svolant
Browse files
Bug fix chargement target
parent
81a6528e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Rfunctions/Data_Management.R
View file @
5821f7b5
...
...
@@ -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
...
...
Rfunctions/Stat_Model.R
View file @
5821f7b5
...
...
@@ -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
)
}
...
...
server.R
View file @
5821f7b5
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment