dynverse / dynbenchmark

Comparison of methods for trajectory inference on single-cell data 🥇
https://doi.org/10.1101/276907
Other
199 stars 41 forks source link

Error: `id` must evaluate to column positions or names, not a function #32

Open pablommesas opened 5 years ago

pablommesas commented 5 years ago

Hi, thanks again for a great job!

I ran into the following problem, not sure if I'm doing something wrong or it is an actual error. I also have a couple of questions regarding the overall structure of the benchmarking repository and how to execute it.

When running the dynbenchmark/scripts/06-benchmark/1-submit_jobs.R in line 23:

 methods <-
    dynwrap::get_ti_methods(method_ids, evaluate = FALSE) %>%
    mapdf(function(m) {
      l <- m$fun()
      l$fun <- m$fun
      l$type <- "function"
      l
    }) %>%
    list_as_tibble() %>%
    select(id, type, fun, everything())

As I see it after modifying the tibble obtained by dynwrap::get_ti_methods() with the mapdf() there is no column 'id'. Therefore, the following operation select() raises the following error:

Error: `id` must evaluate to column positions or names, not a function

This could be easily fixed by keeping the 'id' info in the mapdf(): l$id <- m$id

  methods <-
    dynwrap::get_ti_methods(method_ids, evaluate = FALSE) %>%
    mapdf(function(m) {
      l <- m$fun()
      l$fun <- m$fun
      l$type <- "function"
      l$id <- m$id
      l
    }) %>%
    list_as_tibble() %>%
    select(id, type, fun, everything())

Is this an actual error and proper fix, or I'm missing something?

Thanks again!!