Skip to content

lexical error when parsing multiqc json from nf-co.re/rnaseq #6

Closed

Description

@cmatKhan

I am getting an error when trying to use this package with the output from the nf-co.re/rnaseq pipeline.

> multiqc = TidyMultiqc::load_multiqc(
+   paths = "multiqc_data.json"
+ )

Error in parse_con(txt, bigint_as_char) : 
  lexical error: invalid char in json text.
                  "mapped_failed_pct": NaN,                 "paired in
                     (right here) ------^

Session Info

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.6 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /opt/intel/compilers_and_libraries_2020.0.166/linux/mkl/lib/intel64_lin/libmkl_rt.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] TidyMultiqc_1.0.0           SummarizedExperiment_1.24.0 Biobase_2.54.0              GenomicRanges_1.46.1       
 [5] GenomeInfoDb_1.30.0         IRanges_2.28.0              S4Vectors_0.32.3            BiocGenerics_0.40.0        
 [9] MatrixGenerics_1.6.0        matrixStats_0.61.0         

loaded via a namespace (and not attached):
 [1] pillar_1.6.4           compiler_4.1.2         XVector_0.34.0         zlibbioc_1.40.0        bitops_1.0-7          
 [6] tools_4.1.2            jsonlite_1.7.2         lattice_0.20-45        lifecycle_1.0.1        tibble_3.1.6          
[11] gtable_0.3.0           pkgconfig_2.0.3        rlang_0.4.12           Matrix_1.3-4           DelayedArray_0.20.0   
[16] DBI_1.1.1              cli_3.1.0              rstudioapi_0.13        GenomeInfoDbData_1.2.7 dplyr_1.0.7           
[21] generics_0.1.1         vctrs_0.3.8            grid_4.1.2             tidyselect_1.1.1       glue_1.5.1            
[26] R6_2.5.1               fansi_0.5.0            ggplot2_3.3.5          purrr_0.3.4            magrittr_2.0.1        
[31] scales_1.1.1           ellipsis_0.3.2         assertthat_0.2.1       colorspace_2.0-2       utf8_1.2.2            
[36] RCurl_1.98-1.5         munsell_0.5.0          crayon_1.4.2  

Activity

  1. cmatKhan commented on Jan 6, 2022

    @cmatKhan
    Author

    Replacing the NaN with "NA" in the multiqc_data.json does make TidyMultqc::load_multiqc() work

    sed -i 's/NaN/"NA"/g' multiqc_data.json
    

    An easy fix would be to put a note in the docs, though maybe this is too obvious to bother with.

  2. multimeric commented on Jan 6, 2022

    @multimeric
    Owner

    Unless I'm misunderstanding, that JSON is actually invalid. So it's actually a bug in MultiQC which should be filed there. Thanks for the workaround, though.

  3. multimeric commented on Jan 8, 2022

    @multimeric
    Owner

    If you could provide a sample MultiQC report with this issue (or even better, the pipeline and sample data that produces the report), I'm happy to file the issue to MultiQC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions