R中的Biomart将rssnp转换为基因名称

时间:2017-07-31 21:15:09

标签: r

我在R中有以下代码。

library(biomaRt)

snp_mart = useMart("ENSEMBL_MART_SNP", dataset="hsapiens_snp")
snp_attributes = c("refsnp_id", "chr_name", "chrom_start", 
"associated_gene", "ensembl_gene_stable_id", "minor_allele_freq")

getENSG <- function(rs, mart = snp_mart) {
results <- getBM(attributes = snp_attributes,
               filters    = "snp_filter", values = rs, mart = mart)
return(results)
}

getENSG("rs144864312")

    refsnp_id chr_name chrom_start associated_gene ensembl_gene_stable_id
1 rs144864312        8    20254959              NA        ENSG00000061337
    minor_allele_freq
1       0.000399361

我没有生物学背景所以如果这是一个明显的问题,请原谅我。我被告知rs144864312应该与基因名称相匹配&#34; LZTS1&#34;。 上面的代码我主要来自互联网。我的问题是我从哪里提取基因名称?我得到listAttributes(snp_mart)给出了所有可能输出的列表,但是我没有看到任何给我上述基因名称&#34;。我从哪里提取这个基因名称使用biomart(并给出rs号)?提前谢谢。

PS:我需要为500个条目(不仅仅是1个)这样做。因此,为什么我创建了一个简单的函数来提取基因名称。

1 个答案:

答案 0 :(得分:0)

首先,我认为您的问题会在https://www.biostars.org/

上引起更多专业关注

据说,据我所知,现在你有了ensembl ID(ENSG00000061337),你距离获得基因名称只有一步之遥。如果你google&#34;如何将ensembl ID转换为基因名称&#34;你会发现很多方法。在这里,我列出了几个选项:

  1. 使用:https://david.ncifcrf.gov/conversion.jsp
  2. 在ensemble下使用biomart:http://www.ensembl.org/biomart/martview/1cb4c119ae91cb34b2cd5280be0a1aac
  3. 下载包含基因名称和ensembl ID的表格,并自定义您的查询。您可能希望从UCSC Genome Browser下载它,以下是一些说明:https://www.biostars.org/p/92939/
  4. 祝你好运