【发布时间】:2015-04-17 02:05:45
【问题描述】:
我有一列包含 Ensembl ID 的 data.frame;我想为该列的值找到相应的基因符号,并将它们添加到我的数据框中的新列中。 我使用了 bioMaRt,但它找不到任何 Ensembl ID!
这是我的示例数据 (df[1:2,]):
row.names organism gene
41 Homo-Sapiens ENSP00000335357
115 Homo-Sapiens ENSP00000227378
我想得到这样的东西
row.names organism gene id
41 Homo-Sapiens ENSP00000335357 CDKN3
115 Homo-Sapiens ENSP00000227378 HSPA8
这是我的代码:
library('biomaRt')
mart <- useDataset("hsapiens_gene_ensembl", useMart("ensembl"))
genes <- df$genes
df$id <- NA
G_list <- getBM(filters= "ensembl_gene_id", attributes= c("ensembl_gene_id",
"entrezgene", "description"),values=genes,mart= mart)
然后我在检查 G_list 时得到这个
[1] ensembl_gene_id entrezgene description <0 rows> (or 0-length row.names)
所以我无法将 G_list 添加到我的 df 中!因为没有什么要补充的!
提前致谢,
【问题讨论】:
标签: r dataframe bioinformatics bioconductor