Valerie,
Thanks. You will get the same cryptic error if you use the wrong file as
the TabixFile.

vcfFile <- system.file("extdata", "ex2.vcf", package="VariantAnnotation")
from <- vcfFile
to <- tempfile()
compressVcf <- bgzip(from, to)
idx <- indexTabix(compressVcf, "vcf")
rng <- GRanges(seqnames="20", ranges=IRanges(start=c(14000,
1230000),end=c(15000,1240000)))
myparam<-ScanVcfParam(which=rng)

#incorrect - the idx file does not match up with the vcf here, it matches
up with the compressed one
tab <- TabixFile(vcfFile,idx)
vcf <- readVcf(tab, "hg19",myparam)
Error in lapply(names(vcf[[1]]), function(elt) { :
  error in evaluating the argument 'X' in selecting a method for function
'lapply': Error in vcf[[1]] : subscript out of bounds

#correct
tab <- TabixFile(compressVcf,idx)
vcf <- readVcf(tab, "hg19",myparam)

Regards,
Jeremy

	[[alternative HTML version deleted]]

