Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: lexical error: invalid char in json text. #1

Closed
Cmartinez-arias opened this issue Dec 15, 2020 · 13 comments
Closed

Error: lexical error: invalid char in json text. #1

Cmartinez-arias opened this issue Dec 15, 2020 · 13 comments

Comments

@Cmartinez-arias
Copy link

Cmartinez-arias commented Dec 15, 2020

I'm really new to using R for microbiome data analysis, so sorry in advance if i am not using the language properly.

Last week I succesfully installed FUNGuildR by using this:

install.packages("remotes")
remotes::install_github("brendanf/FUNGuildR")
library(FUNGuildR)

and when using the function funguild_assign () I succesfully obtained a new table with trophicModes, guild, growthForm, ....

Today, i'm trying to analyze new data but i am not capable to obtain anything.

The error that I get when running the funguild_assign function is this:

otu_fun<- funguild_assign(otu_mat, db = get_funguild_db(), tax_col = "Taxonomy")
Error: lexical error: invalid char in json text.

                                   </body>
                 (right here) ------^

Does anybody knows what the problem is?
Thank you.

@brendanf
Copy link
Owner

This sounds like an problem downloading and parsing the database. To check, try db <- get_funguild_db() and see if you get the same error. Could you also post the output of sessionInfo()?

@Cmartinez-arias
Copy link
Author

Cmartinez-arias commented Dec 16, 2020

Yes, the same error appears when I try to download the database by using get_funguild_db().
I have also tried with different computers (Windows 10 and Windows 7) and different internet connections, and I always get the same error.

sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252 LC_MONETARY=Spanish_Spain.1252
[4] LC_NUMERIC=C LC_TIME=Spanish_Spain.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] FUNGuildR_0.1.0.9999 readxl_1.3.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 rstudioapi_0.13 magrittr_2.0.1 tidyselect_1.1.0 R6_2.5.0 rlang_0.4.9
[7] fansi_0.4.1 stringr_1.4.0 httr_1.4.2 dplyr_1.0.2 tools_4.0.3 cli_2.2.0
[13] remotes_2.2.0 ellipsis_0.3.1 assertthat_0.2.1 tibble_3.0.4 lifecycle_0.2.0 crayon_1.3.4
[19] purrr_0.3.4 tidyr_1.1.2 vctrs_0.3.5 curl_4.3 glue_1.4.2 stringi_1.5.3
[25] compiler_4.0.3 pillar_1.4.7 cellranger_1.1.0 generics_0.1.0 jsonlite_1.7.2 pkgconfig_2.0.3

@brendanf
Copy link
Owner

Thanks for that. I've looked into it a bit, and apparently this is due to a new format for the FUNGuild database, which is also causing the web version to not work. I'll see if I can come up with a fix.

@brendanf
Copy link
Owner

@Cmartinez-arias Try reinstalling FUNGuildR. The new version I just pushed should work again for fungi, but not nematodes (there doesn't seem to be a currently available version of the NEMAguild database.)

@Cmartinez-arias
Copy link
Author

It works perfect now!!!
Thank you so much!

@brendanf
Copy link
Owner

Glad to hear it!

@fconstancias
Copy link

Hi there,

I am also experiencing the same issue on a frshly (today) installed FUNGuildR, and I can't reproduce the example from teh github:

funguild_assign(sample_fungi)
Error: lexical error: invalid char in json text. </body> (right here) ------^

I can't load the database:

fung <- get_funguild_db(db = "http://www.stbates.org/funguild_db_2.php")
Error: lexical error: invalid char in json text. </body> (right here) ------^

This is the output of my sessionInfo():

R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

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

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

other attached packages:
[1] reshape2_1.4.4 scales_1.1.1 FUNGuildR_0.2.0.9000 phyloseq_1.36.0 forcats_0.5.1 stringr_1.4.0 dplyr_1.0.7 purrr_0.3.4 readr_2.1.0 tidyr_1.1.4 tibble_3.1.6
[12] ggplot2_3.3.5 tidyverse_1.3.1.9000

loaded via a namespace (and not attached):
[1] colorspace_2.0-2 ellipsis_0.3.2 rprojroot_2.0.2 XVector_0.32.0 fs_1.5.0 rstudioapi_0.13 remotes_2.4.1 fansi_0.5.0 lubridate_1.8.0 xml2_1.3.2
[11] codetools_0.2-18 splines_4.1.2 cachem_1.0.6 knitr_1.36 pkgload_1.2.3 ade4_1.7-18 jsonlite_1.7.2 broom_0.7.10 cluster_2.1.2 dbplyr_2.1.1
[21] compiler_4.1.2 httr_1.4.2 backports_1.4.0 assertthat_0.2.1 Matrix_1.3-4 fastmap_1.1.0 cli_3.1.0 htmltools_0.5.2 prettyunits_1.1.1 tools_4.1.2
[31] igraph_1.2.6 gtable_0.3.0 glue_1.5.0 GenomeInfoDbData_1.2.6 Rcpp_1.0.7 Biobase_2.52.0 cellranger_1.1.0 vctrs_0.3.8 Biostrings_2.60.2 rhdf5filters_1.4.0
[41] multtest_2.48.0 ape_5.5 nlme_3.1-153 iterators_1.0.13 xfun_0.28 ps_1.6.0 testthat_3.1.0 rvest_1.0.2 lifecycle_1.0.1 devtools_2.4.2
[51] zlibbioc_1.38.0 MASS_7.3-54 hms_1.1.1 parallel_4.1.2 biomformat_1.20.0 rhdf5_2.36.0 yaml_2.2.1 curl_4.3.2 memoise_2.0.0 stringi_1.7.5
[61] S4Vectors_0.30.2 desc_1.4.0 foreach_1.5.1 permute_0.9-5 BiocGenerics_0.38.0 pkgbuild_1.2.0 GenomeInfoDb_1.28.4 rlang_0.4.12 pkgconfig_2.0.3 bitops_1.0-7
[71] evaluate_0.14 lattice_0.20-45 Rhdf5lib_1.14.2 tidyselect_1.1.1 processx_3.5.2 plyr_1.8.6 magrittr_2.0.1 R6_2.5.1 IRanges_2.26.0 generics_0.1.1
[81] DBI_1.1.1 pillar_1.6.4 haven_2.4.3 withr_2.4.2 mgcv_1.8-38 survival_3.2-13 RCurl_1.98-1.5 modelr_0.1.8 crayon_1.4.2 utf8_1.2.2
[91] tzdb_0.2.0 rmarkdown_2.11 usethis_2.0.1 grid_4.1.2 readxl_1.3.1 data.table_1.14.2 callr_3.7.0 vegan_2.5-7 reprex_2.0.1 digest_0.6.28
[101] stats4_4.1.2 munsell_0.5.0 sessioninfo_1.1.1

Thanks for your help.

@brendanf
Copy link
Owner

I am not able to replicate your error. The current version (I made a few small changes today, but they should not affect this) works both on my development computer and the GutHub test servers (including OSX). It's possible the database was temporarily unavailable. Try again now and see if it works.

@fconstancias
Copy link

Thanks working now without having to reinstall.

@brendanf
Copy link
Owner

Hi @HBeral,
It looks like the FUNGuild database is down right now; direct database queries at the website http://www.funguild.org/query.php are also not working. I will contact the maintainers to see if they have any estimate for when it will be back in operation. I also have a local copy of the database from Nov 2022 which I could share with you if the main database is not fixed soon.

@brendanf
Copy link
Owner

@HBeral It looks like the FUNGuild database is back up now. Try your code again and let me know if you have any problem.

@hwangumn
Copy link

hwangumn commented Sep 30, 2023

Is the FUNGuild database down at the moment? Having the same issue running my code.

@brendanf
Copy link
Owner

brendanf commented Oct 2, 2023

Reply to @hwangumn at #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants