Skip to content
Snippets Groups Projects
Commit 001e309a authored by Alán Muñoz's avatar Alán Muñoz
Browse files

refactor(grouper): update imports for filtering

parent 5efe7349
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,11 @@ import pandas as pd
import seaborn as sns
from pathos.multiprocessing import Pool
from agora.utils.kymograph import drop_level, intersection_matrix
from agora.utils.kymograph import (
drop_level,
get_mother_ilocs_from_daughters,
intersection_matrix,
)
from postprocessor.chainer import Chainer
......@@ -403,13 +407,7 @@ def concat_signal_ind(
elif mode == "families":
combined = chainer.get_raw(path, **kwargs)
daughter_ids = combined.index[
combined.index.get_level_values("mother_label") > 0
]
mother_id_mask = intersection_matrix(
daughter_ids.droplevel("cell_label"),
drop_level(combined, "mother_label", as_list=False),
).any(axis=0)
mother_id_mask = get_mother_ilocs_from_daughters(df)
combined = combined.loc[
combined.index[mother_id_mask].union(daughter_ids)
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment