stitam / webseq

Tools for Working with Biological Sequence Databases in R
Other
3 stars 1 forks source link

Should ncbi_link_uid() return a named list instead of a tibble? #79

Closed stitam closed 1 month ago

stitam commented 2 months ago

For example here I cannot pipe the whole thing together because of the tibble:

taxid <- "YP_003347555.1" |> ncbi_get_uid(db = "protein") |> ncbi_link_uid(to = "taxonomy")
taxizedb::classification(taxid$taxonomy)

But this would be more user friendly:

taxid <- "YP_003347555.1" |> ncbi_get_uid(db = "protein") |> ncbi_link_uid(to = "taxonomy") |> taxizedb::classification()
stitam commented 1 month ago

This solves the issue:

taxid <- "YP_003347555.1" |> 
  ncbi_get_uid(db = "protein") |> 
  ncbi_link_uid(to = "taxonomy") |> 
  dplyr::pull(taxonomy) |> 
  taxizedb::classification()

No need to update the package.