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
e3b5f13f
Commit
e3b5f13f
authored
Feb 14, 2019
by
dmattek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed interpolation when measurements are integer; fixed by explicit conversion to numeric.
parent
f2b565a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
server.R
server.R
+16
-5
No files found.
server.R
View file @
e3b5f13f
...
...
@@ -427,10 +427,10 @@ shinyServer(function(input, output, session) {
if
(
input
$
chBtrackUni
)
{
# create unique track ID based on columns specified in input$inSelSite field and combine with input$inSelTrackLabel
loc.dt
[,
trackObjectsLabelUni
:=
do.call
(
paste
,
c
(
.SD
,
sep
=
"_"
)),
.SDcols
=
c
(
input
$
inSelSite
,
input
$
inSelTrackLabel
)
]
loc.dt
[,
(
COLIDUNI
)
:=
do.call
(
paste
,
c
(
.SD
,
sep
=
"_"
)),
.SDcols
=
c
(
input
$
inSelSite
,
input
$
inSelTrackLabel
)
]
}
else
{
# stay with track ID provided in the loaded dataset; has to be unique
loc.dt
[,
trackObjectsLabelUni
:=
get
(
input
$
inSelTrackLabel
)]
loc.dt
[,
(
COLIDUNI
)
:=
get
(
input
$
inSelTrackLabel
)]
}
...
...
@@ -603,10 +603,10 @@ shinyServer(function(input, output, session) {
## Interpolate missing data and NA data points
# From: https://stackoverflow.com/questions/28073752/r-how-to-add-rows-for-missing-values-for-unique-group-sequences
# Tracks are interpolated only within first and last time points of every
cell
id
# Tracks are interpolated only within first and last time points of every
track
id
# Datasets can have different realtime frequency (e.g. every 1', 2', etc),
# or the frame number metadata can be missing, as is the case for tCourseSelected files that already have realtime column.
# Therefore, we cannot rely on that info to get time frequency; user
provides
this number!
# Therefore, we cannot rely on that info to get time frequency; user
must provide
this number!
setkey
(
loc.out
,
group
,
id
,
realtime
)
...
...
@@ -625,7 +625,18 @@ shinyServer(function(input, output, session) {
else
s.cols
=
c
(
COLY
)
loc.out
[,
(
s.cols
)
:=
lapply
(
.SD
,
na.interpolation
),
by
=
c
(
COLID
),
.SDcols
=
s.cols
]
# Interpolated columns should be of type numeric (float)
# This is to ensure that interpolated columns are of porper type.
# Apparently the loop is faster than lapply+SDcols
for
(
col
in
s.cols
)
{
#loc.out[, (col) := as.numeric(get(col))]
data.table
::
set
(
loc.out
,
j
=
col
,
value
=
as.numeric
(
loc.out
[[
col
]]))
loc.out
[,
(
col
)
:=
na.interpolation
(
get
(
col
)),
by
=
c
(
COLID
)]
}
# loc.out[, (s.cols) := lapply(.SD, na.interpolation), by = c(COLID), .SDcols = s.cols]
# !!! Current issue with interpolation:
...
...
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