繁体   English   中英

无法使用 biomaRt 包从 Entrez ID 获取基因符号

[英]Unable to use biomaRt package to get Gene Symbols from Entrez IDs

我正在使用以下代码从 Entrez ID 中检索基因符号:

library("biomaRt")
ensembl <- useMart("ENSEMBL_MART_ENSEMBL", dataset = "hsapiens_gene_ensembl", host = "www.ensembl.org")

g <- getBM(c("hgnc_symbol"), filters = "entrezgene", c(entrez), ensembl)

但我收到以下错误:

Error in value[[3L]](cond): Request to BioMart web service failed. Verify if you are still connected to the internet.  Alternatively the BioMart web service is temporarily down.
Traceback:

1. getBM(c("hgnc_symbol"), filters = "entrezgene", c(entrez), ensembl)
2. tryCatch(postForm(paste(martHost(mart), "?", sep = ""), query = xmlQuery), 
 .     error = function(e) {
 .         stop("Request to BioMart web service failed. Verify if you are still connected to the internet.  Alternatively the BioMart web service is temporarily down.")
 .     })
3. tryCatchList(expr, classes, parentenv, handlers)
4. tryCatchOne(expr, names, parentenv, handlers[[1L]])
5. value[[3L]](cond)
6. stop("Request to BioMart web service failed. Verify if you are still connected to the internet.  Alternatively the BioMart web service is temporarily down.")
library(biomaRt)
marts <- listMarts()
ensembl <- useMart("ensembl")
datasets <- listDatasets(ensembl)
ensembl=useDataset("hsapiens_gene_ensembl",mart=ensembl)
attributes <- listAttributes(ensembl)
my_ids <- read.csv("/home/firat/Desktop/ahmet_deseq2_results.csv")
results_end_1 <- getBM(attributes = c("ensembl_gene_id","external_gene_name"), values = my_ids, mart = ensembl )
View(results_end_1)
merged_with_my_ids <- merge(my_ids,results_end_1,by.x = "X",by.y = ,"ensembl_gene_id")
View(merged_with_my_ids)

这是我如何使用 biomaRt。 我认为这是不言自明的。 对于每个脚本,直到 my_ids 的行都是安静的。 对于您的情况,在 attributes = "entrezgene" 中使用“ensembl_gene_id”代替我会很有用。 合并是重要的一步。 就我而言,在合并时,by.x="X" 表示在 my_ids csv 中,ensemblegeneid 位于名为“X”的列中。 所以我基本上要说的是,从 my_ids,将 X 列与 results_end_1 的“ensembl_gene_id”列匹配并合并。 如果有什么不清楚的,请追问。 费拉特

打开Internet Explorer ,转到您的ensembl函数的主机参数中使用的网站。

然后转到设置选项卡,并将其添加到您的受信任网站列表中。

这为我解决了这个问题。

希望对你也有帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM