Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aliby-mirror
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
aliby
aliby-mirror
Commits
869b7f86
Commit
869b7f86
authored
2 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
fix(picker): update lineage format wrangling
parent
1c5117cd
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/postprocessor/core/reshapers/picker.py
+29
-21
29 additions, 21 deletions
src/postprocessor/core/reshapers/picker.py
with
29 additions
and
21 deletions
src/postprocessor/core/reshapers/picker.py
+
29
−
21
View file @
869b7f86
...
@@ -81,7 +81,8 @@ class picker(LineageProcess):
...
@@ -81,7 +81,8 @@ class picker(LineageProcess):
idx
=
idx
[
valid_indices
]
idx
=
idx
[
valid_indices
]
mothers_daughters
=
mothers_daughters
[
valid_lineage
]
mothers_daughters
=
mothers_daughters
[
valid_lineage
]
return
mothers_daughters
,
idx
# return mothers_daughters, idx
return
idx
def
loc_lineage
(
self
,
kymo
:
pd
.
DataFrame
,
how
:
str
,
lineage
=
None
):
def
loc_lineage
(
self
,
kymo
:
pd
.
DataFrame
,
how
:
str
,
lineage
=
None
):
_
,
valid_indices
=
self
.
pick_by_lineage
(
_
,
valid_indices
=
self
.
pick_by_lineage
(
...
@@ -96,26 +97,33 @@ class picker(LineageProcess):
...
@@ -96,26 +97,33 @@ class picker(LineageProcess):
def
run
(
self
,
signals
):
def
run
(
self
,
signals
):
self
.
orig_signals
=
signals
self
.
orig_signals
=
signals
indices
=
set
(
signals
.
index
)
indices
=
set
(
signals
.
index
)
self
.
mothers
,
self
.
daughters
=
self
.
cells
.
mothers_daughters
lineage
=
self
.
cells
.
mothers_daughters
for
alg
,
op
,
*
params
in
self
.
sequence
:
if
lineage
.
any
():
new_indices
=
tuple
()
self
.
mothers
=
lineage
[:,
:
2
]
if
indices
:
self
.
daughters
=
lineage
[:,
[
0
,
2
]]
if
alg
==
"
lineage
"
:
param1
=
params
[
0
]
for
alg
,
op
,
*
params
in
self
.
sequence
:
new_indices
=
getattr
(
self
,
"
pick_by_
"
+
alg
)(
new_indices
=
tuple
()
signals
.
loc
[
list
(
indices
)],
param1
if
indices
:
)
if
alg
==
"
lineage
"
:
else
:
param1
=
params
[
0
]
param1
,
*
param2
=
params
new_indices
=
getattr
(
self
,
"
pick_by_
"
+
alg
)(
new_indices
=
getattr
(
self
,
"
pick_by_
"
+
alg
)(
signals
.
loc
[
list
(
indices
)],
param1
signals
.
loc
[
list
(
indices
)],
param1
,
param2
)
)
else
:
param1
,
*
param2
=
params
if
op
==
"
union
"
:
new_indices
=
getattr
(
self
,
"
pick_by_
"
+
alg
)(
# new_indices = new_indices.intersection(set(signals.index))
signals
.
loc
[
list
(
indices
)],
param1
,
param2
new_indices
=
indices
.
union
(
new_indices
)
)
new_indices
=
[
tuple
(
x
)
for
x
in
new_indices
]
indices
=
indices
.
intersection
(
new_indices
)
if
op
==
"
union
"
:
new_indices
=
indices
.
union
(
new_indices
)
indices
=
indices
.
intersection
(
new_indices
)
else
:
print
(
"
WARNING:Picker: No lineage assignment
"
)
indices
=
np
.
array
([])
return
np
.
array
(
list
(
indices
))
return
np
.
array
(
list
(
indices
))
...
...
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