# make the filtering function
filterfun <- MakeTasselVcfFilter(300, 15)
# \donttest{
# Executable code excluded from CRAN testing for taking >10 s:
require(VariantAnnotation)
# get the example VCF installed with polyRAD
exampleVCF <- system.file("extdata", "Msi01genes.vcf", package = "polyRAD")
exampleBGZ <- paste(exampleVCF, "bgz", sep = ".")
# zip and index the file using Tabix (if not done already)
if(!file.exists(exampleBGZ)){
exampleBGZ <- bgzip(exampleVCF)
indexTabix(exampleBGZ, format = "vcf")
}
# make a temporary file
# (for package checks; you don't need to do this in your own code)
outfile <- tempfile(fileext = ".vcf")
# filter to a new file
filterVcf(exampleBGZ, destination = outfile,
prefilters = FilterRules(list(filterfun)))
# }
Run the code above in your browser using DataLab