Skip to content

Commit

Permalink
Fix col mapping bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nictru committed Mar 8, 2024
1 parent 3ffba68 commit 28ca539
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ def column_card(column: str):
interface = ui.input_selectize(f"select_{column}", "Columns", _input_columns.get(), multiple=True)
elif type_string == "Map existing":
mapcol_accession = f"select_mapcol_{column}"
colselect = ui.input_select(mapcol_accession, "Column", _input_columns.get())

series = adata.obs[input[mapcol_accession].get()] if mapcol_accession in input else None

interface = ui.div(
ui.input_select(mapcol_accession, "Column", _input_columns.get()),
*([ui.input_text(f"mapping_{column}_{col}", col, placeholder="New value") for col in series.unique()] if series is not None else [])
colselect,
ui.accordion(
ui.accordion_panel("Mapping",
*([ui.input_text(f"mapping_{column}_{col}", col, placeholder="New value") for col in series.unique()] if series is not None else [])
))
)
else:
interface = ui.input_text(f"input_{column}", "Value", placeholder="Unknown")
Expand Down

0 comments on commit 28ca539

Please sign in to comment.