jorainer / ensembldb

This is the ensembldb development repository.
https://jorainer.github.io/ensembldb
33 stars 10 forks source link

mapIds(..., multiVal="asNA") returns logical() instead of character() when all ids map multiply #100

Open mtmorgan opened 5 years ago

mtmorgan commented 5 years ago
> class(mapIds(EnsDb.Hsapiens.v86, "BCL2", "TXID", "GENENAME", multiVals="asNA"))
[1] "logical"
jorainer commented 5 years ago

Thanks @mtmorgan ! I will have a look into it.

jorainer commented 5 years ago

Fixed in ensembldb 2.9.3

Kayla-Morrell commented 5 years ago
> class(mapIds(EnsDb.Hsapiens.v86, "BCL2", "TXID", "GENENAME", multiVals="filter"))
[1] "NULL"

Filter has a similar problem. I'd expect a character vector of length 0.

jorainer commented 5 years ago

Thanks for reporting @Kayla-Morrell ! It's fixed in version 2.9.4

Kayla-Morrell commented 5 years ago

https://github.com/jorainer/ensembldb/blob/b0187013ff2c399a27774c8726c6a4f026eaf529/R/select-methods.R#L346

It seems like character(0) should be named so that things such as tibble::enframe() will work properly ('name' column is type character not integer).

> tibble::enframe(character(0))
# A tibble: 0 x 2
# … with 2 variables: name <int>, value <chr>
> tibble::enframe(setNames(nm = character(0)))
# A tibble: 0 x 2
# … with 2 variables: name <chr>, value <chr>
>
jorainer commented 5 years ago

I made the changes - hope it works now. Thanks for reporting @Kayla-Morrell