phenoscape / rphenoscape

R package to make phenotypic traits from the Phenoscape Knowledgebase available from within R.
https://rphenoscape.phenoscape.org/
Other
5 stars 5 forks source link

Fix similarity frequency 500 errors #282

Closed johnbradley closed 8 months ago

johnbradley commented 8 months ago

When running the tests locally the following 500 errors occur:

══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-semsim.R:66:3'): Resnik similarity ─────────────────────────────
<http_500/error/condition>
Error in `get_csv_data(pkb_api("/similarity/frequency"), query = query, 
    header = FALSE, row.names = 1, check.names = FALSE)`: (500) Internal Server Error: There was an internal server error.
Backtrace:
    ▆
 1. └─rphenoscape::resnik_similarity(...) at test-semsim.R:66:3
 2.   ├─base::do.call(wt, wt_args)
 3.   └─rphenoscape (local) `<fn>`(as = "phenotype", corpus = "taxon-variation", x = `<chr>`)
 4.     └─rphenoscape:::get_csv_data(...)
 5.       └─rphenoscape:::stop_for_pk_status(res)
── Error ('test-semsim.R:135:3'): profile similarity with Resnik ───────────────
<http_500/error/condition>
Error in `get_csv_data(pkb_api("/similarity/frequency"), query = query, 
    header = FALSE, row.names = 1, check.names = FALSE)`: (500) Internal Server Error: There was an internal server error.
Backtrace:
    ▆
 1. └─rphenoscape::term_freqs(...) at test-semsim.R:135:3
 2.   └─rphenoscape:::get_csv_data(...)
 3.     └─rphenoscape:::stop_for_pk_status(res)

[ FAIL 2 | WARN 0 | SKIP 0 | PASS 640 ]

One of the errors can be also seen by running the following code:

phens <- get_phenotypes("basihyal bone", taxon = "Cyprinidae")
subs.mat <- subsumer_matrix(phens$id, .colnames = "label", .labels = phens$label, preserveOrder = TRUE)
> sm.ic <- resnik_similarity(subs.mat, wt_args = list(as = "phenotype", corpus = "taxon-variation"))
Error in get_csv_data(pkb_api("/similarity/frequency"), query = query,  : 
  (500) Internal Server Error: There was an internal server error.

This error does not occur during the CircleCI tests because of the skip_on_cran() function.

johnbradley commented 8 months ago

@balhoff fixed this by increasing Qlever resources in the phenoscape KB API service.