rvandewater / YAIB

πŸ§ͺYet Another ICU Benchmark: a holistic framework for the standardization of clinical prediction model experiments. Provide custom datasets, cohorts, prediction tasks, endpoints, preprocessing, and models. Paper: https://arxiv.org/abs/2306.05109
https://github.com/rvandewater/YAIB/wiki
MIT License
47 stars 8 forks source link

'x is not a list '-- YAIB-cohorts #141

Closed njtp111 closed 4 months ago

njtp111 commented 1 year ago

hi, Robin

When I run Rscript "base_cohort.R" --src mimic_demo, there is a error. Before that , I run ricu::import_src('mimic_demo','/data/mjc/icu/mimic-iii-clinical-database-demo-1.4/') to import data to ricu.

Thanks for your help.

Best, Jiacong Mi

image

prockenschaub commented 1 year ago

Hi Jiacong,

Thanks for raising this issue!

Your dataset import does not seem to work (none of the datasets are enabled for you yet, indicated by the red x next to each dataset). Have you tried installing the demo data as a package yet? This should automatically enable the demo data for you. You can install the package via:

install.packages(
  "mimic.demo",
  repos = "https://eth-mds.github.io/physionet-demo"
)

I suspect that the above is the reason for your error. Could you please try the above and see if this fixes it? Once we have done that, we can then figure out why your import_src didn't work.

anothersin commented 1 year ago

Hi Jiacong,

Thanks for raising this issue!

Your dataset import does not seem to work (none of the datasets are enabled for you yet, indicated by the red x next to each dataset). Have you tried installing the demo data as a package yet? This should automatically enable the demo data for you. You can install the package via:

install.packages(
  "mimic.demo",
  repos = "https://eth-mds.github.io/physionet-demo"
)

I suspect that the above is the reason for your error. Could you please try the above and see if this fixes it? Once we have done that, we can then figure out why your import_src didn't work.

hi, Robin,

I'm having the same problem as him. And when installing the demo packages no dataset was added.

> install.packages(
+     "mimic.demo",
+     repos = "https://eth-mds.github.io/physionet-demo"
+ )

trying URL 'https://eth-mds.github.io/physionet-demo/src/contrib/mimic.demo_1.0.1.tar.gz'
Content type 'application/gzip' length 9987043 bytes (9.5 MB)
downloaded 9.5 MB

── ricu 0.5.3 ──────────────────────────────────────────────────────────────────

The following data sources are configured to be attached:
(the environment variable `RICU_SRC_LOAD` controls this)

βœ– mimic: 0 of 26 tables available
βœ– mimic_demo: 0 of 25 tables available
βœ– eicu: 0 of 31 tables available
βœ– eicu_demo: 0 of 31 tables available
βœ– hirid: 0 of 5 tables available
βœ– aumc: 0 of 7 tables available
βœ– miiv: 0 of 27 tables available

────────────────────────────────────────────────────────────────────────────────

Error in `assert_that()` at prockenschaub-ricu-package-1942e93/R/concept-utils.R:701:2:
! x is not a list
Backtrace:
     β–†
  1. └─ricu::load_dictionary(cfg_dirs = concept_path)
  2.   └─ricu:::parse_dictionary(...) at prockenschaub-ricu-package-1942e93/R/concept-utils.R:1313:2
  3.     └─ricu (local) do_new(concepts, dict) at prockenschaub-ricu-package-1942e93/R/concept-utils.R:1428:2
  4.       └─base::lapply(lst_xtr(sub, "concepts"), do_new, ful) at prockenschaub-ricu-package-1942e93/R/concept-utils.R:1414:6
  5.         └─ricu (local) FUN(X[[i]], ...)
  6.           └─base::lapply(lst_xtr(sub, "concepts"), do_new, ful) at prockenschaub-ricu-package-1942e93/R/concept-utils.R:1414:6
  7.             └─ricu (local) FUN(X[[i]], ...)
  8.               └─base::lapply(Map(c, name = names(sub), sub), do_call, do_cncpt) at prockenschaub-ricu-package-1942e93/R/concept-utils.R:1418:4
  9.                 └─ricu (local) FUN(X[[i]], ...)
 10.                   β”œβ”€base::do.call(fun, c(x, list(...))) at prockenschaub-ricu-package-1942e93/R/utils-misc.R:190:11
 11.                   └─ricu (local) `<fn>`(...)
 12.                     └─ricu::new_item(itms) at prockenschaub-ricu-package-1942e93/R/concept-utils.R:1381:6
 13.                       └─ricu:::assert_that(is.list(x), all_fun(x, is_itm)) at prockenschaub-ricu-package-1942e93/R/concept-utils.R:701:2
 14.                         └─rlang::abort(msg, class = cls) at prockenschaub-ricu-package-1942e93/R/assertions.R:24:2
Execution halted
rvandewater commented 1 year ago

Thank you for your reaching out. I believe you are both running into an issue where the R profile will try to load the proper scripts which it can not do without the dependencies that do not get installed.

This should at least get your environment up and running. You can try out the cohort generation with: Rscript "base_cohort.R" --src mimic_demo