Hello,
I would like to filter one vcf by selecting only SNVs and in addition, those that only match genomic coordinates of a provided GRanges. I know that the filterVcf() function of Variant Annotation can deal with those requirements by using the isSNV() function on filters and by selecting on param argument the ScanVcfParam option. However, when just selecting the SNV filter I got some message errors and I do not know how to proceed. I've been following the Bioconductor tutorial <http://bioconductor.org/help/course-materials/2014/BioC2014/Lawrence_Tutorial.R>, but still I don't know what is the error with extractROWS.
I use the chr7 default vcf in the extdata folder of the package in order to show you my problem.
> library(VariantAnnotation)
> fl <- system.file("extdata", "chr7-sub.vcf.gz", package="VariantAnnotation")
> destination.file <- "~/destination.vcf"
> filterVcf(fl,
+ "hg19",
+ destination.file,
+ filters=FilterRules(list(onlySNV=isSNV)),
+ verbose=TRUE)
starting filter
filtering 3791 records
Error in extractROWS(x, eval(filter, x)) :
error in evaluating the argument 'i' in selecting a method for function 'extractROWS': Error in rule(envir) :
call to standardGeneric("isSNV") apparently not from the body of that generic function
May I pass the isSNV function in another way?
I would appreciate you opinion.
Thank you very much,
Pau.
see this answer: A: filterVcf: error with param argument
Thanks Martin!! And it is even more efficient that I expected.
It would have been better to submit this as a new question. Hopefully someone more familiar with filterVcf can help out here.