Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wela
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Swain Lab
wela
Commits
5bed58fc
Commit
5bed58fc
authored
4 months ago
by
pswain
Browse files
Options
Downloads
Patches
Plain Diff
change: include_whole_cell -> add_whole_cell
Also calculates cell_growth_rate.
parent
859ae25a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/wela/dataloader.py
+13
-9
13 additions, 9 deletions
src/wela/dataloader.py
with
13 additions
and
9 deletions
src/wela/dataloader.py
+
13
−
9
View file @
5bed58fc
...
...
@@ -239,16 +239,20 @@ class dataloader:
# add missing signals to h5 files
add_bud_fluorescence
(
self
.
h5dirpath
/
dataname
,
missing_signals
)
def
include
_whole_cell
(
self
,
fl_channels
=
[
"
GFP
"
]):
def
add
_whole_cell
(
self
,
fl_channels
=
[]):
"""
Create whole-cell signals from mother and bud compartments.
"""
# cell volume and area
for
signal
in
[
"
volume
"
,
"
area
"
]:
self
.
df
[
f
"
cell_
{
signal
}
"
]
=
np
.
nansum
(
[
self
.
df
[
signal
].
values
,
self
.
df
[
f
"
bud_
{
signal
}
"
].
values
],
axis
=
0
,
)
# replace zeros created by np.nansum with nan
self
.
df
.
loc
[
self
.
df
[
signal
].
isna
(),
f
"
cell_
{
signal
}
"
]
=
np
.
nan
# cell volume, area, and growth rate
for
signal
in
[
"
volume
"
,
"
area
"
,
"
growth_rate
"
]:
if
(
signal
in
self
.
df
.
columns
and
f
"
bud_
{
signal
}
"
in
self
.
df
.
columns
):
self
.
df
[
f
"
cell_
{
signal
}
"
]
=
np
.
nansum
(
[
self
.
df
[
signal
].
values
,
self
.
df
[
f
"
bud_
{
signal
}
"
].
values
],
axis
=
0
,
)
# replace zeros created by np.nansum with nan
self
.
df
.
loc
[
self
.
df
[
signal
].
isna
(),
f
"
cell_
{
signal
}
"
]
=
np
.
nan
# fluorescence
for
fl
in
fl_channels
:
for
bg
in
[
""
,
"
_bgsub
"
]:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment