我使用以下代码从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.")发布于 2016-10-18 17:33:55
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的代码行都是一样的。对于您的情况,in attributes = "entrezgene“会比我使用"ensembl_gene_id”更有用。合并是一个重要的步骤。在我的例子中,在合并时,by.x= "X“意味着,在my_ids csv中,ensemblegeneid位于名为"X”的列中。因此,我的基本意思是,在my_ids中,将X列与results_end_1的"ensembl_gene_id“列进行匹配并合并。如果有什么不清楚的地方,请提出来。Fı速率
发布于 2016-10-19 01:40:21
打开Internet Explorer,转到您的ensembl函数的主机参数中使用的网站。
然后转到设置选项卡,并将其添加到您的可信网站列表中。
这为我解决了这个问题。
希望这对你也有帮助。
https://stackoverflow.com/questions/38265798
复制相似问题