Skip to content

Fix filterVcf vignette: wrap isSNV generic in a closure for FilterRules - #123

Open
seandavi wants to merge 1 commit into
develfrom
fix/filtervcf-generic-filter
Open

seandavi wants to merge 1 commit into
develfrom
fix/filtervcf-generic-filter

Conversation

@seandavi

Copy link
Copy Markdown

Problem

VariantAnnotation's source build fails on r-universe (build page, run 42372061105), so every binary build fails as well. One of the two vignette failures is in filterVcf.Rmd:

Filter 'isSNV' failed: call to standardGeneric("isSNV") apparently not from the body of that generic function

The vignette passes the S4 generic directly as a filter rule:

filters <- FilterRules(list(isSNV=isSNV, AD=allelicDepth))

S4Vectors 0.53.0 (Bioconductor/S4Vectors@904dc54) disabled setAs("standardGeneric", "FilterClosure"). A generic is now coerced as a plain function into a FilterClosure, and calling it fails inside standardGeneric().

Fix

Wrap the generic in a closure: isSNV=function(x) isSNV(x). This works with both old and new S4Vectors. No other FilterRules() call in man/ or inst/unitTests/ passes a generic directly.

Verification

Run locally against S4Vectors 0.53.0 (built from the S4Vectors devel branch):

  • filterVcf(..., filters=FilterRules(list(isSNV=isSNV))) reproduces the r-universe error exactly.
  • filterVcf(..., filters=FilterRules(list(isSNV=function(x) isSNV(x)))) completes (1050 lines written from chr7-sub.vcf.gz).
  • rmarkdown::render("vignettes/filterVcf.Rmd") completes.

Related

S4Vectors 0.53.0 (commit 904dc54) removed the standardGeneric ->
FilterClosure coercion, so passing the isSNV generic directly to
FilterRules() now fails at evaluation time with "call to
standardGeneric("isSNV") apparently not from the body of that generic
function". This broke vignette building on r-universe for every
platform. Wrapping the generic in an ordinary closure works with both
old and new S4Vectors.

Co-Authored-By: Claude <noreply@anthropic.com>
@seandavi

Copy link
Copy Markdown
Author

Upstream report: Bioconductor/S4Vectors#146

This branch has not been deployed

No deployments
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.

1 participant