ropensci / taxize

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

db="worms" not working for classification() #878

Closed cclaver001 closed 3 years ago

cclaver001 commented 3 years ago

Hello! First, congratulations for the taxize package. I use it a lot and I find it very useful. I am facing a problem when using the classification() function with the Worms database. It perfectly works with other datasets (ncbi, itis...). This function worked before as I am running an old script. I have searched on the internet but I didn't find any answer... Any help will be apreciated. Thanks in advance :)

Here there is a simple reprex to show the problem:

library(taxize)
#> Warning: package 'taxize' was built under R version 4.0.5
classification('Gadus morhua', db = 'worms')
#> ==  1 queries  ===============
#> 
#> Retrieving data for taxon 'Gadus morhua'
#> x  Not Found:  Gadus morhua
#> ==  Results  =================
#> 
#> * Total: 1 
#> * Found: 0 
#> * Not Found: 1
#> $`Gadus morhua`
#> [1] NA
#> 
#> attr(,"class")
#> [1] "classification"
#> attr(,"db")
#> [1] "worms"
classification('Gadus morhua', db = 'ncbi')
#> No ENTREZ API key provided
#>  Get one via taxize::use_entrez()
#> See https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/
#> ==  1 queries  ===============
#> 
#> Retrieving data for taxon 'Gadus morhua'
#> v  Found:  Gadus+morhua
#> ==  Results  =================
#> 
#> * Total: 1 
#> * Found: 1 
#> * Not Found: 0
#> No ENTREZ API key provided
#>  Get one via taxize::use_entrez()
#> See https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/
#> $`Gadus morhua`
#>                   name         rank      id
#> 1   cellular organisms      no rank  131567
#> 2            Eukaryota superkingdom    2759
#> 3         Opisthokonta        clade   33154
#> 4              Metazoa      kingdom   33208
#> 5            Eumetazoa        clade    6072
#> 6            Bilateria        clade   33213
#> 7        Deuterostomia        clade   33511
#> 8             Chordata       phylum    7711
#> 9             Craniata    subphylum   89593
#> 10          Vertebrata        clade    7742
#> 11       Gnathostomata        clade    7776
#> 12          Teleostomi        clade  117570
#> 13        Euteleostomi        clade  117571
#> 14      Actinopterygii   superclass    7898
#> 15         Actinopteri        class  186623
#> 16         Neopterygii     subclass   41665
#> 17           Teleostei   infraclass   32443
#> 18 Osteoglossocephalai        clade 1489341
#> 19       Clupeocephala      no rank  186625
#> 20   Euteleosteomorpha       cohort 1489388
#> 21        Neoteleostei        clade  123365
#> 22        Eurypterygia        clade  123366
#> 23       Ctenosquamata        clade  123367
#> 24     Acanthomorphata        clade  123368
#> 25  Paracanthopterygii        clade 1489838
#> 26         Zeiogadaria        clade 1489841
#> 27            Gadariae        clade 1489843
#> 28          Gadiformes        order    8043
#> 29            Gadoidei     suborder 1489845
#> 30             Gadidae       family    8045
#> 31               Gadus        genus    8048
#> 32        Gadus morhua      species    8049
#> 
#> attr(,"class")
#> [1] "classification"
#> attr(,"db")
#> [1] "ncbi"
classification('Gadus morhua', db = 'itis')
#> ==  1 queries  ===============
#> 
#> Retrieving data for taxon 'Gadus morhua'
#> v  Found:  Gadus morhua
#> ==  Results  =================
#> 
#> * Total: 1 
#> * Found: 1 
#> * Not Found: 0
#> $`Gadus morhua`
#>                  name         rank     id
#> 1            Animalia      kingdom 202423
#> 2           Bilateria   subkingdom 914154
#> 3       Deuterostomia infrakingdom 914156
#> 4            Chordata       phylum 158852
#> 5          Vertebrata    subphylum 331030
#> 6       Gnathostomata  infraphylum 914179
#> 7      Actinopterygii   superclass 161061
#> 8           Teleostei        class 161105
#> 9  Paracanthopterygii   superorder 164385
#> 10         Gadiformes        order 164665
#> 11            Gadidae       family 164701
#> 12            Gadinae    subfamily 550569
#> 13              Gadus        genus 164710
#> 14       Gadus morhua      species 164712
#> 
#> attr(,"class")
#> [1] "classification"
#> attr(,"db")
#> [1] "itis"
classification('Gadus morhua', db = 'bold')
#> ==  1 queries  ===============
#> 
#> Retrieving data for taxon 'Gadus morhua'
#> v  Found:  Gadus morhua
#> ==  Results  =================
#> 
#> * Total: 1 
#> * Found: 1 
#> * Not Found: 0
#> $`Gadus morhua`
#>             name      rank     id
#> 1       Chordata    phylum     18
#> 2 Actinopterygii     class     77
#> 3     Gadiformes     order    241
#> 4        Gadidae    family   1152
#> 5        Gadinae subfamily 515578
#> 6   Gadus morhua   species  26136
#> 7          Gadus     genus   3451
#> 
#> attr(,"class")
#> [1] "classification"
#> attr(,"db")
#> [1] "bold"

Created on 2021-06-24 by the reprex package (v2.0.0)

bart-v commented 3 years ago

This is a temporary issue, which happens now and then. See https://github.com/ropensci/taxize/issues/847#issuecomment-703135145

Works just fine now

✓  Found:  Gadus morhua
══  Results  ═════════════════

• Total: 1 
• Found: 1 
• Not Found: 0
$`Gadus morhua`
# A tibble: 10 x 3
   name           rank            id
   <chr>          <chr>        <int>
 1 Animalia       Kingdom          2
 2 Chordata       Phylum        1821
 3 Vertebrata     Subphylum   146419
 4 Gnathostomata  Infraphylum   1828
 5 Pisces         Superclass   11676
 6 Actinopterygii Class        10194
 7 Gadiformes     Order        10313
 8 Gadidae        Family      125469
 9 Gadus          Genus       125732
10 Gadus morhua   Species     126436

attr(,"class")
[1] "classification"
attr(,"db")
[1] "worms"
cclaver001 commented 3 years ago

Oh, I see. Thank you for your help!

sckott commented 3 years ago

thanks for the issue @cclaver001 and thanks for the explanation @bart-v