我在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应该与基因名称"LZTS1“相匹配。上面的代码我主要是从互联网上得到的。我的问题是,我从哪里提取这个基因名称?我知道listAttributes(snp_mart)给出了所有可能输出的列表,但我没有看到任何输出给我上面的“基因名称”。我在哪里从生物艺术中提取这个基因名称(并给出rs编号)?提前谢谢你。
PS:我需要这样做,大约500个条目(而不仅仅是1个)。因此我创建了一个像上面这样的简单函数来提取基因名称。
发布于 2017-08-01 05:34:08
首先,我认为你的问题会在https://www.biostars.org/上引起更多专业人士的关注
也就是说,据我所知,现在你有了集合ID (ENSG00000061337),离获得基因名称只有一步之遥了。如果你用谷歌搜索"how to convert ensembl ID to gene name“,你会发现很多方法。这里我列出了一些选项:
在下使用:https://david.ncifcrf.gov/conversion.jsp
祝好运
https://stackoverflow.com/questions/45425408
复制相似问题