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

term_to_node_id(dag, term): Cannot find some of the terms in the DAG #22

Open
HDash opened this issue Jan 8, 2025 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@HDash
Copy link
Contributor

HDash commented Jan 8, 2025

New error on check(), appearing after all the January merges. I can confirm this error was not present when I was working on my branch back in December.

Fails tests and example for plot_bar_dendro.

Reprex

devtools::load_all()
#> ℹ Loading MSTExplorer
results <- load_example_results()
out <- plot_bar_dendro(results = results)
#> Loading required namespace: ggdendro
#> Adding HPO names.
#> Translating ontology terms to names.
#> Adding level-2 ancestor to each HPO ID.
#> Adding ancestor metadata.
#> Ancestor metadata already present. Use force_new=TRUE to overwrite.
#> 2,206,994 associations remain after filtering.
#> Mapping cell types to cell ontology terms.
#> Adding stage information.
#> Filtered 'ancestor_name' : 999,488 / 2,206,994 rows dropped.
#> Translating ontology terms to ids.
#> Loading cached ontology: /Users/hdash/Library/Caches/org.R-project.R/R/KGExplorer/cl.rds
#> Translating ontology terms to ids.
#> Translating ontology terms to ids.
#> Translating ontology terms to ids.
#> Translating ontology terms to ids.
#> Translating ontology terms to ids.
#> Translating ontology terms to ids.
#> Error in term_to_node_id(dag, term): Cannot find some of the terms in the DAG.

Created on 2025-01-08 with reprex v2.1.1

I tried using the older tag in get_target_celltypes(..., cl = KGExplorer::get_ontology(...)) but to no avail. (Issue #20).
Using latest version of HPOExplorer@master and KGExplorer@master.

Session Info

devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.4.2 (2024-10-31)
#>  os       macOS Sequoia 15.2
#>  system   aarch64, darwin20
#>  ui       X11
#>  language (EN)
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       Europe/London
#>  date     2025-01-08
#>  pandoc   3.5 @ /opt/homebrew/bin/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version  date (UTC) lib source
#>  cachem        1.1.0    2024-05-16 [1] CRAN (R 4.4.0)
#>  cli           3.6.3    2024-06-21 [1] CRAN (R 4.4.0)
#>  devtools      2.4.5    2022-10-11 [1] CRAN (R 4.4.0)
#>  digest        0.6.37   2024-08-19 [1] CRAN (R 4.4.1)
#>  ellipsis      0.3.2    2021-04-29 [1] CRAN (R 4.4.0)
#>  evaluate      1.0.1    2024-10-10 [1] CRAN (R 4.4.1)
#>  fastmap       1.2.0    2024-05-15 [1] CRAN (R 4.4.0)
#>  fs            1.6.5    2024-10-30 [1] CRAN (R 4.4.1)
#>  glue          1.8.0    2024-09-30 [1] CRAN (R 4.4.1)
#>  htmltools     0.5.8.1  2024-04-04 [1] CRAN (R 4.4.0)
#>  htmlwidgets   1.6.4    2023-12-06 [1] CRAN (R 4.4.0)
#>  httpuv        1.6.15   2024-03-26 [1] CRAN (R 4.4.0)
#>  knitr         1.49     2024-11-08 [1] CRAN (R 4.4.1)
#>  later         1.4.1    2024-11-27 [1] CRAN (R 4.4.1)
#>  lifecycle     1.0.4    2023-11-07 [1] CRAN (R 4.4.0)
#>  magrittr      2.0.3    2022-03-30 [1] CRAN (R 4.4.0)
#>  memoise       2.0.1    2021-11-26 [1] CRAN (R 4.4.0)
#>  mime          0.12     2021-09-28 [1] CRAN (R 4.4.0)
#>  miniUI        0.1.1.1  2018-05-18 [1] CRAN (R 4.4.1)
#>  pkgbuild      1.4.5    2024-10-28 [1] CRAN (R 4.4.1)
#>  pkgload       1.4.0    2024-06-28 [1] CRAN (R 4.4.0)
#>  profvis       0.4.0    2024-09-20 [1] CRAN (R 4.4.1)
#>  promises      1.3.2    2024-11-28 [1] CRAN (R 4.4.1)
#>  purrr         1.0.2    2023-08-10 [1] CRAN (R 4.4.0)
#>  R6            2.5.1    2021-08-19 [1] CRAN (R 4.4.0)
#>  Rcpp          1.0.13-1 2024-11-02 [1] CRAN (R 4.4.1)
#>  remotes       2.5.0    2024-03-17 [1] CRAN (R 4.4.0)
#>  reprex        2.1.1    2024-07-06 [1] CRAN (R 4.4.0)
#>  rlang         1.1.4    2024-06-04 [1] CRAN (R 4.4.0)
#>  rmarkdown     2.29     2024-11-04 [1] CRAN (R 4.4.1)
#>  rstudioapi    0.17.1   2024-10-22 [1] CRAN (R 4.4.1)
#>  sessioninfo   1.2.2    2021-12-06 [1] CRAN (R 4.4.0)
#>  shiny         1.10.0   2024-12-14 [1] CRAN (R 4.4.1)
#>  urlchecker    1.0.1    2021-11-30 [1] CRAN (R 4.4.0)
#>  usethis       3.1.0    2024-11-26 [1] CRAN (R 4.4.1)
#>  vctrs         0.6.5    2023-12-01 [1] CRAN (R 4.4.0)
#>  withr         3.0.2    2024-10-28 [1] CRAN (R 4.4.1)
#>  xfun          0.50     2025-01-07 [1] CRAN (R 4.4.1)
#>  xtable        1.8-4    2019-04-21 [1] CRAN (R 4.4.0)
#>  yaml          2.3.10   2024-07-26 [1] CRAN (R 4.4.0)
#> 
#>  [1] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────

Created on 2025-01-08 with reprex v2.1.1

@HDash HDash added the bug Something isn't working label Jan 8, 2025
@HDash
Copy link
Contributor Author

HDash commented Jan 8, 2025

R CMD Check output

Last 13 lines of output:
  Error in `term_to_node_id(dag, term)`: Cannot find some of the terms in the DAG.
  Backtrace:1. └─MSTExplorer::plot_bar_dendro(results = results) at test-plot_bar_dendro.R:4:3
   2.   └─MSTExplorer:::get_target_celltypes(target_branches = target_branches)
   3.     └─KGExplorer::get_ontology_descendants(ont = cl, terms = target_branches)
   4.       ├─base::lapply(...)
   5.       └─base::lapply(...)
   6.         └─KGExplorer (local) FUN(X[[i]], ...)
   7.           └─simona::dag_offspring(...)
   8.             └─simona:::term_to_node_id(dag, term)
  
  [ FAIL 1 | WARN 1870 | SKIP 0 | PASS 58 ]
  Error: Test failures
  Execution halted

Possible issue with KGExplorer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants