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
10cfc741
Commit
10cfc741
authored
Jun 20, 2017
by
svolant
Browse files
add create forked task
parent
ae9d0b6a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Rfunctions/Data_Management.R
View file @
10cfc741
#@ This file contains all the functions needed to
#@ This file contains all the functions needed to
#@ to load, check, filter and transform the data
#@ to load, check, filter and transform the data
create_forked_task
<-
function
(
expr
)
{
makeReactiveBinding
(
"state"
)
state
<-
factor
(
"running"
,
levels
=
c
(
"running"
,
"success"
,
"error"
,
"cancel"
),
ordered
=
TRUE
)
result
<-
NULL
# Launch the task in a forked process. This always returns
# immediately, and we get back a handle we can use to monitor
# or kill the job.
task_handle
<-
parallel
::
mcparallel
({
force
(
expr
)
})
# Poll every 100 milliseconds until the job completes
o
<-
observe
({
res
<-
parallel
::
mccollect
(
task_handle
,
wait
=
FALSE
)
if
(
is.null
(
res
))
{
invalidateLater
(
100
)
}
else
{
o
$
destroy
()
if
(
!
is.list
(
res
)
||
length
(
res
)
!=
1
||
!
inherits
(
res
[[
1
]],
"try-error"
))
{
state
<<-
"success"
result
<<-
res
[[
1
]]
}
else
{
state
<<-
"error"
result
<<-
attr
(
res
[[
1
]],
"condition"
,
exact
=
TRUE
)
}
}
})
list
(
completed
=
function
()
{
state
!=
"running"
},
result
=
function
()
{
if
(
state
==
"running"
)
{
# If running, abort the current context silently.
# We've taken a reactive dependency on "state" so if
# the state changes the context will invalidate.
req
(
FALSE
)
}
else
if
(
state
==
"success"
)
{
return
(
result
)
}
else
if
(
state
==
"error"
)
{
stop
(
result
)
}
else
if
(
state
==
"cancel"
)
{
validate
(
need
(
FALSE
,
"The operation was cancelled"
))
}
},
cancel
=
function
()
{
if
(
state
==
"running"
)
{
state
<<-
"cancel"
o
$
destroy
()
tools
::
pskill
(
task_handle
$
pid
,
tools
::
SIGTERM
)
tools
::
pskill
(
-
task_handle
$
pid
,
tools
::
SIGTERM
)
parallel
::
mccollect
(
task_handle
,
wait
=
FALSE
)
}
}
)
}
## Add news to the home page
## Add news to the home page
addNews
<-
function
(
date
=
""
,
title
=
""
,
text
=
""
)
addNews
<-
function
(
date
=
""
,
title
=
""
,
text
=
""
)
{
{
...
@@ -509,9 +573,7 @@ GetCountsMerge <- function(input,dataInput,taxoSelect,target,design)
...
@@ -509,9 +573,7 @@ GetCountsMerge <- function(input,dataInput,taxoSelect,target,design)
## Create the dds object
## Create the dds object
dds
<-
DESeqDataSetFromMatrix
(
countData
=
CT
,
colData
=
target
,
design
=
design
,
ignoreRank
=
TRUE
)
dds
<-
DESeqDataSetFromMatrix
(
countData
=
CT
,
colData
=
target
,
design
=
design
,
ignoreRank
=
TRUE
)
print
(
head
(
CT
))
print
(
GeoMeansCT
(
CT
))
#save(dds,file="testdds.RData")
#save(dds,file="testdds.RData")
if
(
is.null
(
VarNorm
)){
if
(
is.null
(
VarNorm
)){
## Counts normalisation
## Counts normalisation
...
...
server.R
View file @
10cfc741
...
@@ -2059,7 +2059,7 @@ shinyServer(function(input, output,session) {
...
@@ -2059,7 +2059,7 @@ shinyServer(function(input, output,session) {
if
(
!
is.null
(
resDiff
))
if
(
!
is.null
(
resDiff
))
{
{
## Check the R version
## Check the R version
if
(
as.numeric
(
R.Version
()
$
major
)
<=
3
&&
as.numeric
(
R.Version
()
$
minor
)
<=
1.2
){
#
if(as.numeric(R.Version()$major)<=3 && as.numeric(R.Version()$minor) <=1.2){
box
(
title
=
"Contrasts (New)"
,
width
=
NULL
,
status
=
"primary"
,
solidHeader
=
TRUE
,
collapsible
=
TRUE
,
collapsed
=
FALSE
,
box
(
title
=
"Contrasts (New)"
,
width
=
NULL
,
status
=
"primary"
,
solidHeader
=
TRUE
,
collapsible
=
TRUE
,
collapsed
=
FALSE
,
fluidRow
(
fluidRow
(
column
(
width
=
3
,
selectInput
(
"Select1_contrast"
,
"Compare"
,
""
)),
column
(
width
=
3
,
selectInput
(
"Select1_contrast"
,
"Compare"
,
""
)),
...
@@ -2068,7 +2068,7 @@ shinyServer(function(input, output,session) {
...
@@ -2068,7 +2068,7 @@ shinyServer(function(input, output,session) {
column
(
width
=
3
,
br
(),
actionButton
(
"AddContrastEasy"
,
"Add"
,
icon
=
icon
(
"plus"
)))
column
(
width
=
3
,
br
(),
actionButton
(
"AddContrastEasy"
,
"Add"
,
icon
=
icon
(
"plus"
)))
)
)
)
)
}
#
}
}
}
...
@@ -2284,7 +2284,7 @@ shinyServer(function(input, output,session) {
...
@@ -2284,7 +2284,7 @@ shinyServer(function(input, output,session) {
## Run DESeq2 via RunDESeq button
## Run DESeq2 via RunDESeq button
observeEvent
(
input
$
RunDESeq
,{
observeEvent
(
input
$
RunDESeq
,{
ResDiffAnal
()
create_forked_task
(
ResDiffAnal
()
)
})
})
...
...
ui.R
View file @
10cfc741
...
@@ -13,7 +13,7 @@ sidebar <- dashboardSidebar(
...
@@ -13,7 +13,7 @@ sidebar <- dashboardSidebar(
menuItem
(
"Home"
,
tabName
=
"Home"
,
icon
=
icon
(
"home"
)),
menuItem
(
"Home"
,
tabName
=
"Home"
,
icon
=
icon
(
"home"
)),
menuItem
(
"Tutorial"
,
tabName
=
"Tutorial"
,
icon
=
icon
(
"book"
)),
menuItem
(
"Tutorial"
,
tabName
=
"Tutorial"
,
icon
=
icon
(
"book"
)),
menuItem
(
"Download/Install"
,
tabName
=
"Download"
,
icon
=
icon
(
"download"
)),
menuItem
(
"Download/Install"
,
tabName
=
"Download"
,
icon
=
icon
(
"download"
)),
menuItem
(
"Raw data"
,
tabName
=
"RawData"
,
icon
=
icon
(
"upload"
)),
#
menuItem("Raw data", tabName = "RawData", icon = icon("upload")),
menuItem
(
"Upload your data"
,
tabName
=
"Upload"
,
icon
=
icon
(
"upload"
)),
menuItem
(
"Upload your data"
,
tabName
=
"Upload"
,
icon
=
icon
(
"upload"
)),
# bookmarkButton(),
# bookmarkButton(),
menuItemOutput
(
"dymMenu"
),
menuItemOutput
(
"dymMenu"
),
...
...
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