-
Notifications
You must be signed in to change notification settings - Fork 61
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
taxize::downstream() result is length 0 error using WoRMS #847
Comments
Thanks - taxonomy is a deep dark hole from which many weird taxonomic ranks emerge from time to time. one of the taxa had the rank "epifamily" https://www.marinespecies.org/aphia.php?p=taxdetails&id=1459303 fixed, if you reinstall it should work |
awesome - thanks so much! If I run into another odd rank in the next round
of searching I will post it here.
…On Mon, Sep 28, 2020 at 4:28 PM Scott Chamberlain ***@***.***> wrote:
Thanks - taxonomy is a deep dark hole from which many weird taxonomic
ranks emerge from time to time. one of the taxa had the rank "epifamily"
https://www.marinespecies.org/aphia.php?p=taxdetails&id=1459303
fixed, if you reinstall it should work
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#847 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRXZV4PO2ACAGOQRKIT5XLSIEL3PANCNFSM4R47GSXQ>
.
|
thanks |
I encountered this same error with the WoRMS database again, but seems to be for a different reason.
Knowing that prior issues were due to oddball ranks, so I checked the downstream ranks. Here the problem is an
However, when accessing this species in the other direction, using the |
- ignore_missing_rank=TRUE will set any ranks that are NA to "no rank" - then they are treated as NCBI no ranks are treated, for the most part dropped - change worms_downstream to use the new param ignore_missing_rank
Thanks for the report. |
I emailed the WoRMS folks and their response was that they couldn't replicate the |
Thanks for the follow up. Well glad it was an intermittent thing; hopefully it doesn't come back. |
A new instance of the zero-length error in WoRMS
In case this is a similar problem to those noted before, where odd taxonomic ranks would create this error, I checked the children of this sequentially to identify any unusual ranks.
|
thanks! will have a look |
@oharac should be fixed now. the missing rank was infraphylum |
EDITED... getting back into this project, ran across this error again
Reprex: library(taxize)
downstream(sci_id = 1821, db = 'worms', downto = 'class')
#> Error in vapply(x$rank, function(z) which_rank(z, zoo = zoo), 1): values must be length 1,
#> but FUN(X[[3]]) result is length 0 Created on 2021-08-20 by the reprex package (v1.0.0) Sequential calls to parvphylum, megaclass, gigaclass More reprex: library(taxize)
### chokes on 1821:
downstream(1821, db = 'worms', downto = 'class')
#> Error in vapply(x$rank, function(z) which_rank(z, zoo = zoo), 1): values must be length 1,
#> but FUN(X[[3]]) result is length 0
children(sci_id = 1821, db = 'worms')
#> $`1821`
#> # A tibble: 4 x 3
#> childtaxa_id childtaxa_name childtaxa_rank
#> <int> <chr> <chr>
#> 1 1824 Cephalochordata Subphylum
#> 2 146420 Tunicata Subphylum
#> 3 1822 Urochordata Subphylum
#> 4 146419 Vertebrata Subphylum
#>
#> attr(,"class")
#> [1] "children"
#> attr(,"db")
#> [1] "worms"
### chokes on subphylum Vertebrata:
downstream(146419, downto = 'class', db = 'worms')
#> Error in vapply(x$rank, function(z) which_rank(z, zoo = zoo), 1): values must be length 1,
#> but FUN(X[[3]]) result is length 0
children(146419, db = 'worms')
#> $`146419`
#> # A tibble: 2 x 3
#> childtaxa_id childtaxa_name childtaxa_rank
#> <int> <chr> <chr>
#> 1 1829 Agnatha Infraphylum
#> 2 1828 Gnathostomata Infraphylum
#>
#> attr(,"class")
#> [1] "children"
#> attr(,"db")
#> [1] "worms"
### chokes on infraphylum Gnathostomata:
downstream(1828, downto = 'class', db = 'worms')
#> Error in vapply(x$rank, function(z) which_rank(z, zoo = zoo), 1): values must be length 1,
#> but FUN(X[[1]]) result is length 0
children(1828, db = 'worms')
#> $`1828`
#> # A tibble: 4 x 3
#> childtaxa_id childtaxa_name childtaxa_rank
#> <int> <chr> <chr>
#> 1 1517375 Chondrichthyes Parvphylum
#> 2 152352 Osteichthyes Parvphylum
#> 3 11676 Pisces Superclass
#> 4 1831 Tetrapoda Megaclass
#>
#> attr(,"class")
#> [1] "children"
#> attr(,"db")
#> [1] "worms"
### chokes on parvphylum Osteichthyes
downstream(152352, downto = 'class', db = 'worms')
#> Error in vapply(x$rank, function(z) which_rank(z, zoo = zoo), 1): values must be length 1,
#> but FUN(X[[1]]) result is length 0
children(152352, db = 'worms')
#> $`152352`
#> # A tibble: 2 x 3
#> childtaxa_id childtaxa_name childtaxa_rank
#> <int> <chr> <chr>
#> 1 10194 Actinopterygii Gigaclass
#> 2 163509 Sarcopterygii Gigaclass
#>
#> attr(,"class")
#> [1] "children"
#> attr(,"db")
#> [1] "worms"
### finally is OK at this stage
downstream(10194, downto = 'class', db = 'worms')
#> $`10194`
#> id name rank
#> 1 843664 Actinopteri class
#>
#> attr(,"class")
#> [1] "downstream"
#> attr(,"db")
#> [1] "worms"
downstream(163509, downto = 'class', db = 'worms')
#> $`163509`
#> id name rank
#> 1 843665 Coelacanthi class
#>
#> attr(,"class")
#> [1] "downstream"
#> attr(,"db")
#> [1] "worms"
# both OK Created on 2021-08-21 by the reprex package (v1.0.0) |
Thanks for the info! I will look into this and see about adding those ranks. |
Sorry for the delay. I have added the ranks and made the error message better. You can try out the change by installing this version that will be pushed to CRAN soon hopefully, but note this version has many other changes and might break other code. install.packages("remotes")
remotes::install_github("ropensci/taxize") |
Hi,
I'm finding this package to be really useful, but I'm running into a bug. I am using
taxize::downstream
to access the WoRMS database to get all families related to a set of specific orders. For nearly everything, it works fine, but for decapoda (1130) and amphipoda (1135) it returns this error:EDIT: I see that this is similar to #821 and #824 - those were related to a problem with rank name - perhaps something similar happening here?
Reproducible example:
Session Info
The text was updated successfully, but these errors were encountered: