EnsDb.Hsapiens.v86 包中将 ensembl 转换为符号时出错

Error in EnsDb.Hsapiens.v86 package to convert ensembl to symbol

我安装了软件包 EnsDb.Hsapiens.v86 来将基因组合转换为符号, 在尝试了许多包之后,这是用更少的 NA 进行转换的最佳选择。 我尝试编写代码但出现异常错误,这是我的代码:

library(EnsDb.Hsapiens.v86)
mapIds = mapIds (EnsDb.Hsapiens.v86,
             keys = genes, 
             keytype = "GENEID", 
             column = "SYMBOL")

之后必须完成代码转换,但我得到了这个错误:

Error: 'filter' has to be an 'AnnotationFilter', a list of 'AnnotationFilter' object, an 'AnnotationFilterList' or a valid filter expression!

可能您的密钥有问题,例如不是字符向量。使用下面的可重现示例尝试它是否适合您:

library(EnsDb.Hsapiens.v86)
genes <- c("ENSG00000102145", "ENSG00000179348", "ENSG00000107485")
mapIds(EnsDb.Hsapiens.v86,
             keys = genes, 
             keytype = "GENEID", 
             column = "SYMBOL")
#> ENSG00000102145 ENSG00000179348 ENSG00000107485 
#>         "GATA1"         "GATA2"         "GATA3"

reprex package (v2.0.1)

于 2022-04-10 创建