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

plot_differential_outcomes: Arguments imply differing number of rows #23

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

Comments

@HDash
Copy link
Contributor

HDash commented Jan 9, 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.

One of the test cases for plot_differential_outcomes fails.

Reprex

Code taken from test_plot_differential_outcomes-

devtools::load_all()
#> ℹ Loading MSTExplorer

results <- load_example_results()
results <- add_symptom_results(results = results,
                                 celltype_col="cl_name",
                                 proportion_driver_genes_symptom_threshold=.25)
#> Adding symptom-level results.
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2024-02-08
#> Subsetting results by q_threshold and effect.
#> 46,514 associations remain after filtering.
#> Mapping cell types to cell ontology terms.
#> Adding stage information.
#> Adding genes and disease IDs.
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2024-02-08
#> Loading ctd_DescartesHuman.rds
#> Loading ctd_HumanCellLandscape.rds
results <- HPOExplorer::add_gpt_annotations(results)
#> Translating ontology terms to ids.
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2024-12-12
#> 151 phenotypes do not have matching HPO IDs.
#> Reading in GPT annotations for 16,982 phenotypes.
annot <- HPOExplorer::load_phenotype_to_genes(3)
#> Reading cached RDS file: phenotype.hpoa
#> + Version: v2024-02-08
diseases_with_hypotonia <- annot[hpo_id=="HP:0001319"]$disease_id |>unique()## Neonatal hypotonia
phenotypes_with_hypotonia <- annot[disease_id %in% diseases_with_hypotonia]$hpo_id |> unique()
results[,group:="Hypotonia"]
p1b <- plot_differential_outcomes(results,
                                    max_facets=10,
                                   facet_var = "disease_name",
                                   y_var = "blindness",
                                   run_stats = TRUE)
#> Adding disease_name and disease_description.
#> Loading required namespace: paletteer
#> Loading required namespace: ggstatsplot
#> Valid facets: 8210
#> Error in data.frame(..., check.names = FALSE): arguments imply differing number of rows: 0, 1

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

Using the 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 9, 2025
@HDash
Copy link
Contributor Author

HDash commented Jan 9, 2025

R CMD Check output

── Error ('test-plot_differential_outcomes.R:39:3'): plot_differential_outcomes works ──
Error in `data.frame(..., check.names = FALSE)`: arguments imply differing number of rows: 0, 1
Backtrace:1. └─MSTExplorer::plot_differential_outcomes(...) at test-plot_differential_outcomes.R:39:3
 2.   └─MSTExplorer:::plot_differential_outcomes_ggstatsplot(...)
 3.     └─base::lapply(...)
 4.       └─MSTExplorer (local) FUN(X[[i]], ...)
 5.         └─base::tryCatch(...)
 6.           └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 7.             └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 8.               └─value[[3L]](cond)

[ FAIL 2 | WARN 1873 | SKIP 0 | PASS 60 ]

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