Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: MAE with matrix assay cannot be snapshoted and restored (from UI or from file) #625

Open
3 tasks done
averissimo opened this issue Oct 23, 2024 · 0 comments
Open
3 tasks done
Labels
bug Something isn't working core

Comments

@averissimo
Copy link
Contributor

averissimo commented Oct 23, 2024

What happened?

The state of slices_global does not store the experiment name in the teal app, so

How to reproduce?

  • Run app below
  • Add filter in mae -> Mutations
  • Create snapshot
  • Option 1
    • Reset all filters
    • Apply snapshot
  • Option 2
    • Save snapshot to file
    • Reset all filters
    • Upload snapshot file

Notice that the mutations filter is missing

App

Click here to see teal app definition
pkgload::load_all("/home/averissimo/work/roche🟦/packages📦/teal.slice")
pkgload::load_all("/home/averissimo/work/roche🟦/packages📦/teal")

options(
  teal.log_level = "TRACE",
  teal.log_layout = paste(
    "{crayon::bold(logger::colorize_by_log_level(level, levelr))}",
    "from {namespace}",
    "[{crayon::italic(format(time, \"%Y-%m-%d %H:%M:%S\"))}]",
    "{logger::grayscale_by_log_level(msg, levelr)}"
  ),
  teal.show_js_log = TRUE,
  # teal.bs_theme = bslib::bs_theme(version = 5),
  shiny.bookmarkStore = "server"
)

app <- init(
  data = teal_data() |> within({
    env_temp <- new.env()
    data("miniACC", package = "MultiAssayExperiment", envir = env_temp)
    mae <- env_temp$miniACC
    rm(env_temp)
  }),
  filter = teal_slices(
    # teal_slice("mae", "TCGA-OR-A5J3-01A-11D-A29I-10", selected = character(0), experiment = "Mutations", arg = "subset")
  ),
  modules = modules(
    example_module("example")
  )
)

shiny::runApp(app)

Origin of bug

The FilterStatesMatrix class inherits the srv_add method that generates a teal_slice that doesn't store the experiment / arg attributes.

Snapshot file inspected

Notice the missing experiment and arg attributes

{
  "slices": [
    {
      "dataname"       : "mae",
      "varname"        : "TCGA-OR-A5J5-01A-11D-A29I-10",
      "id"             : "mae TCGA-OR-A5J5-01A-11D-A29I-10",
      "choices"        : ["0", "1"],
      "selected"       : ["0", "1"],
      "fixed"          : false,
      "anchored"       : false,
      "multiple"       : true
    }
  ],
  "..."
}

sessionInfo()

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.
@averissimo averissimo added bug Something isn't working core labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

No branches or pull requests

1 participant