Skip to content

Fix ensemblVEP.Rmd: guard API-dependent chunks against Ensembl REST failures - #121

Draft
lwaldron with Copilot wants to merge 2 commits into
develfrom
copilot/fix-bioconductor-actions-job
Draft

Fix ensemblVEP.Rmd: guard API-dependent chunks against Ensembl REST failures#121
lwaldron with Copilot wants to merge 2 commits into
develfrom
copilot/fix-bioconductor-actions-job

Conversation

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown

The bioccheck / check (devel) CI job was failing because ensemblVEP.Rmd makes a live POST to https://rest.ensembl.org/vep/homo_sapiens/region during the package build. A transient HTTP 500 from Ensembl caused httr::stop_for_status() to throw, crashing vignette compilation.

Changes to vignettes/ensemblVEP.Rmd

  • setup chunk: initialise vep_avail <- FALSE so the flag is always defined before any chunk references it.
  • lksnv chunk: wrap vep_by_region() in tryCatch; on any error, emit a message and return NULL. Set vep_avail <- !is.null(res) and compute jans only on success.
  • All API-dependent chunks (doj1, doj2, doj3, lktaaaa, lkmakeg, lkmc): add eval=vep_avail so they are skipped when the API is unavailable.
res = tryCatch(
    vep_by_region(r22[1:100], snv_only=FALSE, chk_max=FALSE),
    error = function(e) {
        message("Ensembl VEP REST API not available: ", conditionMessage(e))
        NULL
    }
)
vep_avail = !is.null(res)
if (vep_avail) jans = toJSON(content(res))

When the API is reachable the vignette renders in full; when it is not, the dependent chunks are skipped and the build succeeds.

The magick warnings in VariantAnnotation.Rmd are non-blocking and are expected to be addressed upstream in the bioconductor_docker image.

The vignette was calling vep_by_region() -> post_Hs_region() during
package build, which makes a live POST to the Ensembl REST API. When
the API returned HTTP 500, the vignette build failed hard.

Fix: wrap the API call in tryCatch, set a vep_avail flag, and gate all
API-dependent chunks on eval=vep_avail. When the API is unavailable,
the chunks are skipped and the build succeeds; when available, the
vignette runs in full.

Also add vep_avail <- FALSE default to setup chunk so the flag is
always defined before any chunk references it.
Copilot AI changed the title [WIP] Fix failing GitHub Actions job bioccheck / check (devel) Fix ensemblVEP.Rmd: guard API-dependent chunks against Ensembl REST failures Jul 28, 2026
Copilot AI requested a review from lwaldron July 28, 2026 11:50
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

Successfully merging this pull request may close these issues.

2 participants