Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shiny-timecourse-inspector
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pertz-lab
shiny-timecourse-inspector
Commits
a168f75e
Commit
a168f75e
authored
Apr 26, 2018
by
dmattek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added: checkbox for NA interpolation. Time frequency input shows only when NA interpolation = T.
parent
7b7d8294
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
35 deletions
+41
-35
server.R
server.R
+40
-35
ui.R
ui.R
+1
-0
No files found.
server.R
View file @
a168f75e
...
@@ -144,14 +144,16 @@ shinyServer(function(input, output, session) {
...
@@ -144,14 +144,16 @@ shinyServer(function(input, output, session) {
output
$
varSelTimeFreq
=
renderUI
({
output
$
varSelTimeFreq
=
renderUI
({
cat
(
file
=
stderr
(),
'UI varSelTimeFreq\n'
)
cat
(
file
=
stderr
(),
'UI varSelTimeFreq\n'
)
numericInput
(
if
(
input
$
chBtrajInter
)
{
'inSelTimeFreq'
,
numericInput
(
'Provide time frequency:'
,
'inSelTimeFreq'
,
min
=
1
,
'Provide time frequency:'
,
step
=
1
,
min
=
1
,
width
=
'100%'
,
step
=
1
,
value
=
1
width
=
'100%'
,
)
value
=
1
)
}
})
})
# This is main field to select plot facet grouping
# This is main field to select plot facet grouping
...
@@ -619,34 +621,37 @@ shinyServer(function(input, output, session) {
...
@@ -619,34 +621,37 @@ shinyServer(function(input, output, session) {
# Therefore, we cnanot rely on that info to get time frequency; user provides this number!
# Therefore, we cnanot rely on that info to get time frequency; user provides this number!
setkey
(
loc.out
,
group
,
id
,
realtime
)
setkey
(
loc.out
,
group
,
id
,
realtime
)
# here we fill missing data with NA's
loc.out
=
loc.out
[
setkey
(
loc.out
[,
.
(
seq
(
min
(
realtime
),
max
(
realtime
),
input
$
inSelTimeFreq
)),
by
=
.
(
group
,
id
)],
group
,
id
,
V1
)]
# x-check: print all rows with NA's
if
(
input
$
chBtrajInter
)
{
print
(
'Rows with NAs:'
)
# here we fill missing data with NA's
print
(
loc.out
[
rowSums
(
is.na
(
loc.out
))
>
0
,
])
loc.out
=
loc.out
[
setkey
(
loc.out
[,
.
(
seq
(
min
(
realtime
),
max
(
realtime
),
input
$
inSelTimeFreq
)),
by
=
.
(
group
,
id
)],
group
,
id
,
V1
)]
# NA's may be already present in the dataset'.
# x-check: print all rows with NA's
# Interpolate (linear) them with na.interpolate as well
print
(
'Rows with NAs:'
)
if
(
locPos
)
print
(
loc.out
[
rowSums
(
is.na
(
loc.out
))
>
0
,
])
s.cols
=
c
(
'y'
,
'pos.x'
,
'pos.y'
)
else
# NA's may be already present in the dataset'.
s.cols
=
c
(
'y'
)
# Interpolate (linear) them with na.interpolate as well
if
(
locPos
)
loc.out
[,
(
s.cols
)
:=
lapply
(
.SD
,
na.interpolation
),
by
=
id
,
.SDcols
=
s.cols
]
s.cols
=
c
(
'y'
,
'pos.x'
,
'pos.y'
)
else
s.cols
=
c
(
'y'
)
# !!! Current issue with interpolation:
# The column mid.in is not taken into account.
loc.out
[,
(
s.cols
)
:=
lapply
(
.SD
,
na.interpolation
),
by
=
id
,
.SDcols
=
s.cols
]
# If a trajectory is selected in the UI,
# the mid.in column is added (if it doesn't already exist in the dataset),
# and for the interpolated point, it will still be NA. Not really an issue.
# !!! Current issue with interpolation:
#
# The column mid.in is not taken into account.
# Also, think about the current option of having mid.in column in the uploaded dataset.
# If a trajectory is selected in the UI,
# Keep it? Expand it?
# the mid.in column is added (if it doesn't already exist in the dataset),
# Create a UI filed for selecting the column with mid.in data.
# and for the interpolated point, it will still be NA. Not really an issue.
# What to do with that column during interpolation (see above)
#
# Also, think about the current option of having mid.in column in the uploaded dataset.
# Keep it? Expand it?
# Create a UI filed for selecting the column with mid.in data.
# What to do with that column during interpolation (see above)
}
## Trim x-axis (time)
## Trim x-axis (time)
if
(
input
$
chBtimeTrim
)
{
if
(
input
$
chBtimeTrim
)
{
...
...
ui.R
View file @
a168f75e
...
@@ -42,6 +42,7 @@ shinyUI(fluidPage(
...
@@ -42,6 +42,7 @@ shinyUI(fluidPage(
uiOutput
(
'uiButLoadTrajRem'
),
uiOutput
(
'uiButLoadTrajRem'
),
tags
$
hr
(),
tags
$
hr
(),
checkboxInput
(
'chBtrajInter'
,
'Interpolate NAs?'
,
value
=
T
),
checkboxInput
(
'chBtrackUni'
,
'Create unique TrackLabel'
,
T
),
checkboxInput
(
'chBtrackUni'
,
'Create unique TrackLabel'
,
T
),
helpPopup
(
helpPopup
(
title
=
'Create unique cell ID'
,
title
=
'Create unique cell ID'
,
...
...
Write
Preview
Markdown
is supported
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