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

Models where endpoints are defined after they are used #96

Open
john-harrold opened this issue Dec 20, 2024 · 0 comments
Open

Models where endpoints are defined after they are used #96

john-harrold opened this issue Dec 20, 2024 · 0 comments

Comments

@john-harrold
Copy link
Contributor

In this rxode2 issue it describes the problem. Essentially the endpoint is being defined after it's being used. Because of this the endpoint (Cc) is being flagged as a covariate.

nlmixr2/rxode2#829

There are a few models where this is happening. See the code below.

I'll fix them and submit a pull request over the weekend.

library(nlmixr2lib)
#> Warning: package 'nlmixr2lib' was built under R version 4.4.2

for(ridx in 1:nrow(modeldb)){

  fn = modeldb[ridx, ]$filename
  mn  = modeldb[ridx, ]$name
  ffn = file.path(system.file(package="nlmixr2lib", "modeldb"), fn)
  source(ffn)
  rx_fun = get(mn)
  rx_obj = rxode2::rxode2(rx_fun)

  if(length(rx_obj$allCovs) > 0){
    mod_ele = c(rx_obj$props$output$endpoint, rx_obj$props$output$secondary)

    if(any(rx_obj$allCovs %in% mod_ele)){
      badCovs = rx_obj$allCovs[rx_obj$allCovs %in% mod_ele]
      message(paste0("Bad covariate detected (", mn, "): ", badCovs))
    }
  }
}
#> Bad covariate detected (indirect_1cpt_inhi_kout_r0rmaxcrmax): Cc
#> Bad covariate detected (indirect_circ_1cpt_inhi_kin_kin_t): Cc
#> Bad covariate detected (indirect_circ_1cpt_inhi_kin_kout_t): Cc
#> Bad covariate detected (indirect_circ_1cpt_inhi_kout_kin_t): Cc
#> Bad covariate detected (indirect_circ_1cpt_inhi_kout_kout_t): Cc
#> Bad covariate detected (indirect_circ_1cpt_stim_kin_kin_t): Cc
#> Bad covariate detected (indirect_circ_1cpt_stim_kin_kout_t): Cc
#> Bad covariate detected (indirect_circ_1cpt_stim_kout_kin_t): Cc
#> Bad covariate detected (indirect_circ_1cpt_stim_kout_kout_t): Cc
#> Bad covariate detected (indirect_prec_1cpt_inhi_CLV): Cc
#> Bad covariate detected (indirect_prec_1cpt_inhi_r0rmaxcrmax): Cc
#> Bad covariate detected (indirect_prec_1cpt_stim_CLV): Cc
#> Bad covariate detected (indirect_prec_1cpt_stim_r0rmaxcrmax): Cc
#> ℹ parameter labels from comments will be replaced by 'label()'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant