[BioC] A problem with getting promoter variants with the function locateVariants (from package VariantAnnotation)

Jarno Tuimala jtuimala at gmail.com
Sun Nov 4 14:14:01 CET 2012


Hello!

I have a script that worked with Bioconductor version 2.10 packages,
but does not work anymore with the latest 2.11 release. More
specifically, I've used locateVariants() from package
VariantAnnotation to locate all variants in a specific vcf file.

With the latest package version I can't get locateVariants() to work
with values AllVariants() or PromoterVariants() for the region
argument (see below for an example). This seems to work with the
example file structural.vcf from the same package, though.

What am I doing wrong?

Of course, as a quick fix I can generate coding, intronic etc.
variants as separate objects, and then combine them together, but it
would be simpler to get them all with a single function call.

- Jarno


> input.vcf<-system.file("extdata", "chr22.vcf.gz", package="VariantAnnotation")
> library(VariantAnnotation)
> genome<-"hg19"
> vcf<-readVcf(input.vcf, genome)
> rd <- rowData(vcf)
> newnames <- paste("chr", seqlevels(vcf), sep="")
> names(newnames) <- seqlevels(vcf)
> vcf_adj <- renameSeqlevels(vcf, newnames)
> rd_adj <- renameSeqlevels(rd, newnames)
> library("TxDb.Hsapiens.UCSC.hg19.knownGene")
> txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
> loc_coding <- locateVariants(vcf_adj, txdb, AllVariants())
Error in if ((nrx == 0) || (nrx%%lv != 0)) stop(paste(lv, "elements in
value to replace",  :missing value where TRUE/FALSE needed
> loc_coding <- locateVariants(vcf_adj, txdb, CodingVariants())
> loc_coding <- locateVariants(vcf_adj, txdb, PromoterVariants())
Error in if ((nrx == 0) || (nrx%%lv != 0)) stop(paste(lv, "elements in
value to replace",  :missing value where TRUE/FALSE needed
> sessionInfo()
R version 2.15.2 Patched (2012-11-01 r61067)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=Finnish_Finland.1252  LC_CTYPE=Finnish_Finland.1252
LC_MONETARY=Finnish_Finland.1252 LC_NUMERIC=C
LC_TIME=Finnish_Finland.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
 [1] VariantAnnotation_1.4.2                 Rsamtools_1.10.1
              Biostrings_2.26.2
TxDb.Hsapiens.UCSC.hg19.knownGene_2.8.0 GenomicFeatures_1.10.0
 [6] AnnotationDbi_1.20.2                    Biobase_2.18.0
              GenomicRanges_1.10.3                    IRanges_1.16.4
                       BiocGenerics_0.4.0
[11] BiocInstaller_1.8.3

loaded via a namespace (and not attached):
 [1] biomaRt_2.14.0     bitops_1.0-4.1     BSgenome_1.26.1
DBI_0.2-5          parallel_2.15.2    RCurl_1.95-1.1
RSQLite_0.11.2     rtracklayer_1.18.0 stats4_2.15.2      tools_2.15.2
     XML_3.95-0.1       zlibbioc_1.4.0



More information about the Bioconductor mailing list