Skip to content

Commit

Permalink
Fix #9 and #15
Browse files Browse the repository at this point in the history
  • Loading branch information
gtca committed Oct 22, 2024
1 parent b4e4f35 commit e4821fe
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions mofax/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@


def _load_samples_metadata(model):
samples_metadata = pd.DataFrame(
[
[cell, group]
for group, cell_list in model.samples.items()
for cell in cell_list
],
columns=["sample", "group"],
samples_metadata = pd.concat(
[pd.DataFrame({"sample": model.samples[g], "group": g}) for g in model.groups]
)
if "samples_metadata" in model.model:
if len(list(model.model["samples_metadata"][model.groups[0]].keys())) > 0:
Expand Down Expand Up @@ -64,13 +59,16 @@ def _load_samples_metadata(model):


def _load_features_metadata(model):
features_metadata = pd.DataFrame(
features_metadata = pd.concat(
[
[feature, view]
for view, feature_list in model.features.items()
for feature in feature_list
],
columns=["feature", "view"],
pd.DataFrame(
{
"feature": model.features[v],
"view": v,
}
)
for v in model.views
]
)
if "features_metadata" in model.model:
if len(list(model.model["features_metadata"][model.views[0]].keys())) > 0:
Expand Down

0 comments on commit e4821fe

Please sign in to comment.