Question: Parsing error with getVariants() from the myvariant package
1
gravatar for Dave Tang
2.4 years ago by
Dave Tang210
Australia/Perth/UWA
Dave Tang210 wrote:

Hello,

I'm trying to use the myvariant package but I'm getting a parsing error. Here's an example:

library(VariantAnnotation)
library(myvariant)

file.path <- system.file("extdata", "dbsnp_mini.vcf", package="myvariant")
vcf <- readVcf(file.path, genome="hg19")
hgvs <- formatHgvs(vcf, variant_type="snp")
variant <- getVariants(hgvs)
Concatenating data, please be patient.
Error: parse error: trailing garbage
          Error transforming results" }{   "responses": [     {       
                     (right here) ------^
traceback()
13: .Call(R_parse, txt, bigint_as_char)
12: parse_string(txt, bigint_as_char)
11: parseJSON(txt, bigint_as_char)
10: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
        simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
9: FUN(X[[i]], ...)
8: lapply(x, fromJSON, flatten = TRUE)
7: lapply(x, fromJSON, flatten = TRUE)
6: .json2df(gene_obj)
5: .return.as(res, return.as = return.as)
4: getVariants(hgvsids, fields, verbose, ..., return.as = return.as, 
       myvariant = myvariant)
3: getVariants(hgvsids, fields, verbose, ..., return.as = return.as, 
       myvariant = myvariant)
2: getVariants(hgvs)
1: getVariants(hgvs)

Here's my sessionInfo():

sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X Yosemite 10.10.5

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

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

other attached packages:
 [1] myvariant_1.4.0            VariantAnnotation_1.20.2   Rsamtools_1.26.1           Biostrings_2.42.1         
 [5] XVector_0.14.0             SummarizedExperiment_1.4.0 Biobase_2.34.0             GenomicRanges_1.26.2      
 [9] GenomeInfoDb_1.10.2        IRanges_2.8.1              S4Vectors_0.12.1           BiocGenerics_0.20.0       

loaded via a namespace (and not attached):
 [1] splines_3.3.2            lattice_0.20-34          colorspace_1.3-2         htmltools_0.3.5         
 [5] rtracklayer_1.34.1       GenomicFeatures_1.26.2   base64enc_0.1-3          survival_2.40-1         
 [9] XML_3.98-1.5             foreign_0.8-67           DBI_0.5-1                BiocParallel_1.8.1      
[13] RColorBrewer_1.1-2       plyr_1.8.4               stringr_1.1.0            zlibbioc_1.20.0         
[17] munsell_0.4.3            gtable_0.2.0             htmlwidgets_0.8          memoise_1.0.0           
[21] knitr_1.15.1             latticeExtra_0.6-28      biomaRt_2.30.0           curl_2.3                
[25] AnnotationDbi_1.36.2     htmlTable_1.9            Rcpp_0.12.9              acepack_1.4.1           
[29] scales_0.4.1             backports_1.0.5          BSgenome_1.42.0          checkmate_1.8.2         
[33] Hmisc_4.0-2              jsonlite_1.2             gridExtra_2.2.1          ggplot2_2.2.1           
[37] digest_0.6.12            stringi_1.1.2            grid_3.3.2               tools_3.3.2             
[41] bitops_1.0-6             magrittr_1.5             RCurl_1.95-4.8           lazyeval_0.2.0          
[45] RSQLite_1.1-2            tibble_1.2               Formula_1.2-1            cluster_2.0.5           
[49] Matrix_1.2-8             data.table_1.10.0        assertthat_0.1           httr_1.2.1              
[53] R6_2.2.0                 rpart_4.1-10             GenomicAlignments_1.10.0 nnet_7.3-12 

Best,

Dave

myvariant • 627 views
ADD COMMENTlink modified 2.4 years ago by cyrus.afrasiabi20 • written 2.4 years ago by Dave Tang210
Answer: Parsing error with getVariants() from the myvariant package
2
gravatar for cyrus.afrasiabi
2.4 years ago by
cyrus.afrasiabi20 wrote:

Hi Dave,

Thanks for the message pointing this out.  This error was caused by a recent server update changing the parsing of the "fields" parameter.  When the R client passed a NULL "fields", it caused an error.  I fixed this on the servers and verified that your example completes correctly, as shown below:

> library(myvariant)
> file.path <- system.file("extdata", "dbsnp_mini.vcf", package="myvariant")
> vcf <- readVcf(file.path, genome="hg19")
> hgvs <- formatHgvs(vcf, variant_type="snp")
> variant <- getVariants(hgvs)
Concatenating data, please be patient.
> length(variant)
[1] 225
> 

Let me know if you have any other issues.

Cyrus

ADD COMMENTlink written 2.4 years ago by cyrus.afrasiabi20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 185 users visited in the last hour