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
0f2d73ff
Commit
0f2d73ff
authored
Nov 22, 2017
by
dmattek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interpolation of missing frames in tracks only within min and max realtime of a particlar cell id.
parent
9bb17940
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
15 deletions
+35
-15
server.R
server.R
+35
-15
No files found.
server.R
View file @
0f2d73ff
...
...
@@ -592,20 +592,40 @@ shinyServer(function(input, output, session) {
}
}
## Interpolate NA's and data points not included
# dt with a full span of realtime for every group and cell id (here it's already unique across entire dataset) combination
loc.dt.IdRt
=
CJ
(
id
=
loc.out
[[
'id'
]],
realtime
=
loc.out
[[
'realtime'
]],
unique
=
TRUE
,
sorted
=
TRUE
)
# dt with all cell id's and their associated group names
loc.dt.GrId
=
loc.out
[,
.
(
group
=
first
(
group
)),
by
=
id
]
# merge the 2 above to have all id~rt combinations with associated group names
loc.dt.GrIdRt
=
merge
(
loc.dt.IdRt
,
loc.dt.GrId
,
by
=
'id'
)
# join with the original to expand it and create NA's for non-existing group-id-rt combinations
loc.out
=
merge
(
loc.dt.GrIdRt
,
loc.out
,
all.x
=
TRUE
,
by
=
c
(
'group'
,
'id'
,
'realtime'
))
## Interpolate NA's and data points not include
# From: https://stackoverflow.com/questions/28073752/r-how-to-add-rows-for-missing-values-for-unique-group-sequences
# Tracks are interpolated only within min and max realtime of every cell id
setkey
(
loc.out
,
group
,
id
,
realtime
)
loc.out
=
loc.out
[
setkey
(
loc.out
[,
.
(
min
(
realtime
)
:
max
(
realtime
)),
by
=
.
(
group
,
id
)],
group
,
id
,
V1
)]
# # dt with a full span of realtime for every group and cell id
# # (here id is already unique across entire dataset) combination
# loc.dt.IdRt = CJ(id = loc.out[['id']],
# realtime = loc.out[['realtime']],
# unique = TRUE, sorted = TRUE )
#
# print('loc.dt.IdRt:')
# print(loc.dt.IdRt)
#
# # dt with all cell id's and their associated group names
# loc.dt.GrId = loc.out[, .(group = first(group)), by = id]
#
# print('loc.dt.GrId:')
# print(loc.dt.GrId)
#
# # merge the 2 above to have all id~rt combinations with associated group names
# loc.dt.GrIdRt = merge(loc.dt.IdRt, loc.dt.GrId, by = 'id')
#
# print('loc.dt.GrIdRt:')
# print(loc.dt.GrIdRt)
#
# # join with the original to expand it and create NA's for non-existing group-id-rt combinations
# loc.out = merge(loc.dt.GrIdRt, loc.out, all.x = TRUE, by = c('group', 'id', 'realtime'))
#
# print('loc.out:')
# print(loc.out)
#
# x-check: print all rows with NA's
print
(
'Rows with NAs:'
)
...
...
@@ -635,12 +655,12 @@ shinyServer(function(input, output, session) {
# 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
)
{
loc.out
=
loc.out
[
realtime
>=
input
$
slTimeTrim
[[
1
]]
&
realtime
<=
input
$
slTimeTrim
[[
2
]]
]
}
# Normalization
#
#
Normalization
# F-n myNorm adds additional column with .norm suffix
if
(
input
$
chBnorm
)
{
loc.out
=
myNorm
(
...
...
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