ropensci / taxize

A taxonomic toolbelt for R
https://docs.ropensci.org/taxize
Other
270 stars 61 forks source link

get_tsn() function failing to retreive data #912

Closed giligone closed 1 year ago

giligone commented 1 year ago
I noticed just within the past week that the get_tsn() function now fails to return any information from ITIS. 
I have a script that pulls the ITIS information for a list of genera. Without changing my code or system configuration, 
it now no longer returns any information where previously it worked smoothly. 
I'm not sure if ITIS has changed their API or something... Any help would be greatly appreciated!

Here's an image of the console output.
![get_tsn_error](https://user-images.githubusercontent.com/47872403/229017830-acd10183-04c9-4b21-bdb9-380afc046076.png)

> devtools::session_info()
- Session info ----------------------------------------------
 setting  value                       
 version  R version 4.0.4 (2021-02-15)
 os       Windows 10 x64              
 system   x86_64, mingw32             
 ui       RStudio                     
 language (EN)                        
 collate  English_United States.1252  
 ctype    English_United States.1252  
 tz       Australia/Adelaide          
 date     2023-03-31                  

- Packages --------------------------------------------------
 package      * version   date       lib source        
 ape            5.4-1     2020-08-13 [1] CRAN (R 4.0.4)
 assertthat     0.2.1     2019-03-21 [1] CRAN (R 4.0.4)
 bold           1.1.0     2020-06-17 [1] CRAN (R 4.0.4)
 boot           1.3-26    2021-01-25 [2] CRAN (R 4.0.4)
 cachem         1.0.4     2021-02-13 [1] CRAN (R 4.0.4)
 callr          3.7.0     2021-04-20 [1] CRAN (R 4.0.5)
 cellranger     1.1.0     2016-07-27 [1] CRAN (R 4.0.4)
 cli            2.5.0     2021-04-26 [1] CRAN (R 4.0.5)
 cluster        2.1.0     2019-06-19 [2] CRAN (R 4.0.4)
 codetools      0.2-18    2020-11-04 [2] CRAN (R 4.0.4)
 colorspace     2.0-0     2020-11-11 [1] CRAN (R 4.0.4)
 conditionz     0.1.0     2019-04-24 [1] CRAN (R 4.0.4)
 crayon         1.4.1     2021-02-08 [1] CRAN (R 4.0.4)
 crul           1.1.0     2021-02-15 [1] CRAN (R 4.0.4)
 curl           4.3       2019-12-02 [1] CRAN (R 4.0.4)
 data.table   * 1.14.0    2021-02-21 [1] CRAN (R 4.0.4)
 DBI            1.1.1     2021-01-15 [1] CRAN (R 4.0.5)
 desc           1.3.0     2021-03-05 [1] CRAN (R 4.0.5)
 devtools       2.4.2     2021-06-07 [1] CRAN (R 4.0.5)
 digest         0.6.27    2020-10-24 [1] CRAN (R 4.0.4)
 directlabels * 2021.1.13 2021-01-16 [1] CRAN (R 4.0.4)
 dplyr        * 1.0.5     2021-03-05 [1] CRAN (R 4.0.4)
 DT             0.18      2021-04-14 [1] CRAN (R 4.0.5)
 ellipsis       0.3.2     2021-04-29 [1] CRAN (R 4.0.5)
 evaluate       0.15      2022-02-18 [1] CRAN (R 4.0.5)
 fansi          0.4.2     2021-01-15 [1] CRAN (R 4.0.4)
 fastmap        1.1.0     2021-01-25 [1] CRAN (R 4.0.4)
 foreach        1.5.1     2020-10-15 [1] CRAN (R 4.0.4)
 fs             1.5.0     2020-07-31 [1] CRAN (R 4.0.4)
 gargle         1.1.0     2021-04-02 [1] CRAN (R 4.0.4)
 gdata        * 2.18.0    2017-06-06 [1] CRAN (R 4.0.4)
 generics       0.1.0     2020-10-31 [1] CRAN (R 4.0.4)
 ggplot2      * 3.3.3     2020-12-30 [1] CRAN (R 4.0.4)
 glue           1.4.2     2020-08-27 [1] CRAN (R 4.0.4)
 gtable         0.3.0     2019-03-25 [1] CRAN (R 4.0.4)
 gtools         3.8.2     2020-03-31 [1] CRAN (R 4.0.3)
 htmltools      0.5.1.1   2021-01-22 [1] CRAN (R 4.0.4)
 htmlwidgets    1.5.3     2020-12-10 [1] CRAN (R 4.0.5)
 httpcode       0.3.0     2020-04-10 [1] CRAN (R 4.0.4)
 iterators      1.0.13    2020-10-15 [1] CRAN (R 4.0.4)
 jsonlite       1.7.2     2020-12-09 [1] CRAN (R 4.0.4)
 Kendall      * 2.2       2011-05-18 [1] CRAN (R 4.0.4)
 knitr          1.39      2022-04-26 [1] CRAN (R 4.0.4)
 lattice      * 0.20-41   2020-04-02 [2] CRAN (R 4.0.4)
 lifecycle      1.0.0     2021-02-15 [1] CRAN (R 4.0.4)
 magrittr       2.0.1     2020-11-17 [1] CRAN (R 4.0.4)
 MASS           7.3-53    2020-09-09 [2] CRAN (R 4.0.4)
 Matrix         1.3-2     2021-01-06 [2] CRAN (R 4.0.4)
 memoise        2.0.0     2021-01-26 [1] CRAN (R 4.0.4)
 mgcv           1.8-33    2020-08-27 [2] CRAN (R 4.0.4)
 munsell        0.5.0     2018-06-12 [1] CRAN (R 4.0.4)
 nlme           3.1-152   2021-02-04 [2] CRAN (R 4.0.4)
 openxlsx     * 4.2.3     2020-10-27 [1] CRAN (R 4.0.4)
 permute      * 0.9-5     2019-03-12 [1] CRAN (R 4.0.4)
 pillar         1.6.1     2021-05-16 [1] CRAN (R 4.0.5)
 pkgbuild       1.2.0     2020-12-15 [1] CRAN (R 4.0.5)
 pkgconfig      2.0.3     2019-09-22 [1] CRAN (R 4.0.4)
 pkgload        1.2.1     2021-04-06 [1] CRAN (R 4.0.5)
 plyr         * 1.8.6     2020-03-03 [1] CRAN (R 4.0.4)
 prettyunits    1.1.1     2020-01-24 [1] CRAN (R 4.0.4)
 processx       3.5.2     2021-04-30 [1] CRAN (R 4.0.5)
 ps             1.6.0     2021-02-28 [1] CRAN (R 4.0.5)
 purrr          0.3.4     2020-04-17 [1] CRAN (R 4.0.4)
 quadprog       1.5-8     2019-11-20 [1] CRAN (R 4.0.3)
 R6             2.5.0     2020-10-28 [1] CRAN (R 4.0.4)
 Rcpp           1.0.8.3   2022-03-17 [1] CRAN (R 4.0.5)
 readxl       * 1.3.1     2019-03-13 [1] CRAN (R 4.0.4)
 remotes        2.4.0     2021-06-02 [1] CRAN (R 4.0.5)
 reshape        0.8.8     2018-10-23 [1] CRAN (R 4.0.4)
 reshape2     * 1.4.4     2020-04-09 [1] CRAN (R 4.0.4)
 ritis          1.0.0     2021-02-02 [1] CRAN (R 4.0.4)
 rlang          0.4.10    2020-12-30 [1] CRAN (R 4.0.4)
 rmarkdown      2.14      2022-04-25 [1] CRAN (R 4.0.4)
 rprojroot      2.0.2     2020-11-15 [1] CRAN (R 4.0.5)
 rstudioapi     0.13      2020-11-12 [1] CRAN (R 4.0.4)
 scales       * 1.1.1     2020-05-11 [1] CRAN (R 4.0.4)
 sessioninfo    1.1.1     2018-11-05 [1] CRAN (R 4.0.5)
 shinyjs        2.1.0     2021-12-23 [1] CRAN (R 4.0.5)
 solrium        1.1.4     2019-11-02 [1] CRAN (R 4.0.4)
 stringi        1.5.3     2020-09-09 [1] CRAN (R 4.0.3)
 stringr      * 1.4.0     2019-02-10 [1] CRAN (R 4.0.4)
 taxize       * 0.9.100   2022-04-22 [1] CRAN (R 4.0.4)
 testthat       3.0.4     2021-07-01 [1] CRAN (R 4.0.5)
 tibble         3.1.0     2021-02-25 [1] CRAN (R 4.0.4)
 tidyselect     1.1.0     2020-05-11 [1] CRAN (R 4.0.4)
 triebeard      0.3.0     2016-08-04 [1] CRAN (R 4.0.4)
 urltools       1.7.3     2019-04-14 [1] CRAN (R 4.0.4)
 usethis        2.0.1     2021-02-10 [1] CRAN (R 4.0.5)
 utf8           1.2.1     2021-03-12 [1] CRAN (R 4.0.4)
 uuid           0.1-4     2020-02-26 [1] CRAN (R 4.0.3)
 vctrs          0.3.8     2021-04-29 [1] CRAN (R 4.0.5)
 vegan        * 2.5-7     2020-11-28 [1] CRAN (R 4.0.4)
 withr          2.5.0     2022-03-03 [1] CRAN (R 4.0.5)
 xfun           0.31      2022-05-10 [1] CRAN (R 4.0.4)
 xml2           1.3.2     2020-04-23 [1] CRAN (R 4.0.4)
 yaml           2.2.1     2020-02-01 [1] CRAN (R 4.0.4)
 zip            2.1.1     2020-08-27 [1] CRAN (R 4.0.4)
 zoo            1.8-9     2021-03-09 [1] CRAN (R 4.0.4)
HDF94 commented 1 year ago

Hello, I have the same issue with both get_tsn() and classification(db = 'itis'); code lines that worked just fine a few weeks ago now return NAs for every single query.

zachary-foster commented 1 year ago

Hmm, I am not seeing that right now:

library(taxize)
splist <- c("annona cherimola", 'annona muricata', "quercus robur",
            "shorea robusta", "pandanus patina", "oryza sativa", "durio zibethinus")
get_tsn(splist)
#> ══  7 queries  ═══════════════
#> 
#> Retrieving data for taxon 'annona cherimola'
#> ✔  Found:  annona cherimola
#> 
#> Retrieving data for taxon 'annona muricata'
#> ✔  Found:  annona muricata
#> 
#> Retrieving data for taxon 'quercus robur'
#> ✔  Found:  quercus robur
#> 
#> Retrieving data for taxon 'shorea robusta'
#> ✔  Found:  shorea robusta
#> 
#> Retrieving data for taxon 'pandanus patina'
#> ✔  Found:  pandanus patina
#> 
#> Retrieving data for taxon 'oryza sativa'
#> ✔  Found:  oryza sativa
#> 
#> Retrieving data for taxon 'durio zibethinus'
#> ✔  Found:  durio zibethinus
#> ══  Results  ═════════════════
#> 
#> • Total: 7 
#> • Found: 7 
#> • Not Found: 0
#> [1] "506198" "18098"  "19405"  "506787" "507376" "41976"  "506099"
#> attr(,"class")
#> [1] "tsn"
#> attr(,"match")
#> [1] "found" "found" "found" "found" "found" "found" "found"
#> attr(,"multiple_matches")
#> [1] FALSE FALSE  TRUE FALSE FALSE  TRUE FALSE
#> attr(,"pattern_match")
#> [1] FALSE FALSE  TRUE FALSE FALSE  TRUE FALSE
#> attr(,"uri")
#> [1] "https://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506198"
#> [2] "https://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=18098" 
#> [3] "https://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19405" 
#> [4] "https://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506787"
#> [5] "https://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=507376"
#> [6] "https://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=41976" 
#> [7] "https://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506099"
classification(splist, db = 'itis')
#> ══  7 queries  ═══════════════
#> 
#> Retrieving data for taxon 'annona cherimola'
#> ✔  Found:  annona cherimola
#> 
#> Retrieving data for taxon 'annona muricata'
#> ✔  Found:  annona muricata
#> 
#> Retrieving data for taxon 'quercus robur'
#> ✔  Found:  quercus robur
#> 
#> Retrieving data for taxon 'shorea robusta'
#> ✔  Found:  shorea robusta
#> 
#> Retrieving data for taxon 'pandanus patina'
#> ✔  Found:  pandanus patina
#> 
#> Retrieving data for taxon 'oryza sativa'
#> ✔  Found:  oryza sativa
#> 
#> Retrieving data for taxon 'durio zibethinus'
#> ✔  Found:  durio zibethinus
#> ══  Results  ═════════════════
#> 
#> • Total: 7 
#> • Found: 7 
#> • Not Found: 0
#> $`annona cherimola`
#>                name          rank     id
#> 1           Plantae       kingdom 202422
#> 2     Viridiplantae    subkingdom 954898
#> 3      Streptophyta  infrakingdom 846494
#> 4       Embryophyta superdivision 954900
#> 5      Tracheophyta      division 846496
#> 6   Spermatophytina   subdivision 846504
#> 7     Magnoliopsida         class  18063
#> 8       Magnolianae    superorder 846543
#> 9       Magnoliales         order  18065
#> 10       Annonaceae        family  18092
#> 11           Annona         genus  18095
#> 12 Annona cherimola       species 506198
#> 
#> $`annona muricata`
#>               name          rank     id
#> 1          Plantae       kingdom 202422
#> 2    Viridiplantae    subkingdom 954898
#> 3     Streptophyta  infrakingdom 846494
#> 4      Embryophyta superdivision 954900
#> 5     Tracheophyta      division 846496
#> 6  Spermatophytina   subdivision 846504
#> 7    Magnoliopsida         class  18063
#> 8      Magnolianae    superorder 846543
#> 9      Magnoliales         order  18065
#> 10      Annonaceae        family  18092
#> 11          Annona         genus  18095
#> 12 Annona muricata       species  18098
#> 
#> $`quercus robur`
#>               name          rank     id
#> 1          Plantae       kingdom 202422
#> 2    Viridiplantae    subkingdom 954898
#> 3     Streptophyta  infrakingdom 846494
#> 4      Embryophyta superdivision 954900
#> 5     Tracheophyta      division 846496
#> 6  Spermatophytina   subdivision 846504
#> 7    Magnoliopsida         class  18063
#> 8          Rosanae    superorder 846548
#> 9          Fagales         order  19273
#> 10        Fagaceae        family  19275
#> 11         Quercus         genus  19276
#> 12   Quercus robur       species  19405
#> 
#> $`shorea robusta`
#>                name          rank     id
#> 1           Plantae       kingdom 202422
#> 2     Viridiplantae    subkingdom 954898
#> 3      Streptophyta  infrakingdom 846494
#> 4       Embryophyta superdivision 954900
#> 5      Tracheophyta      division 846496
#> 6   Spermatophytina   subdivision 846504
#> 7     Magnoliopsida         class  18063
#> 8           Rosanae    superorder 846548
#> 9          Malvales         order  21500
#> 10 Dipterocarpaceae        family  21367
#> 11           Shorea         genus 500828
#> 12   Shorea robusta       species 506787
#> 
#> $`pandanus patina`
#>               name          rank     id
#> 1          Plantae       kingdom 202422
#> 2    Viridiplantae    subkingdom 954898
#> 3     Streptophyta  infrakingdom 846494
#> 4      Embryophyta superdivision 954900
#> 5     Tracheophyta      division 846496
#> 6  Spermatophytina   subdivision 846504
#> 7    Magnoliopsida         class  18063
#> 8         Lilianae    superorder 846542
#> 9       Pandanales         order  42518
#> 10     Pandanaceae        family  42519
#> 11        Pandanus         genus 500462
#> 12 Pandanus patina       species 507376
#> 
#> $`oryza sativa`
#>               name          rank     id
#> 1          Plantae       kingdom 202422
#> 2    Viridiplantae    subkingdom 954898
#> 3     Streptophyta  infrakingdom 846494
#> 4      Embryophyta superdivision 954900
#> 5     Tracheophyta      division 846496
#> 6  Spermatophytina   subdivision 846504
#> 7    Magnoliopsida         class  18063
#> 8         Lilianae    superorder 846542
#> 9           Poales         order 846620
#> 10         Poaceae        family  40351
#> 11           Oryza         genus  41975
#> 12    Oryza sativa       species  41976
#> 
#> $`durio zibethinus`
#>                name          rank     id
#> 1           Plantae       kingdom 202422
#> 2     Viridiplantae    subkingdom 954898
#> 3      Streptophyta  infrakingdom 846494
#> 4       Embryophyta superdivision 954900
#> 5      Tracheophyta      division 846496
#> 6   Spermatophytina   subdivision 846504
#> 7     Magnoliopsida         class  18063
#> 8           Rosanae    superorder 846548
#> 9          Malvales         order  21500
#> 10        Malvaceae        family  21608
#> 11            Durio         genus 500686
#> 12 Durio zibethinus       species 506099
#> 
#> attr(,"class")
#> [1] "classification"
#> attr(,"db")
#> [1] "itis"

Created on 2023-04-06 with reprex v2.0.2

Can you include an example of a query that fails?

giligone commented 1 year ago

I am also now getting results again. I've changed nothing again so I am uncertain what happened. Perhaps an issue with ITIS? I guess it's resolved for now. Thanks

zachary-foster commented 1 year ago

Yea, probably an issue with the ITIS servers. Thanks for the update!