从基因符号和 ID 获取基因位置

Get gene location from gene symbol and ID

我想从基因符号(例如:TTN)和基因ID(例如:ENSG00000155657)中获取人类基因组的基因位置。我想使用 R 的 biomaRt 包来完成它。我该怎么做?

我不完全确定你所说的基因位置是什么意思,但我认为以下内容应该可以帮助你入门:

ensembl <- useMart("ensembl")
ensembl <- useDataset("hsapiens_gene_ensembl",mart=ensembl)
getBM(attributes=c('chromosome_name', 'start_position', 'end_position', 'strand'),
      filters=c('hgnc_symbol', 'ensembl_gene_id'),
      values=list('TTN', 'ENSG00000155657'),
      mart=ensembl)

您可以通过向 values 列表添加额外的向量(在本例中长度为 2)来输入更多过滤器。

您可以使用函数 listAttributes(ensembl) 得到一个 data.frame 包含您可以从 biomart 获得的所有属性。

正如@neilfws 已经指出的那样,biomaRt user guide is the right place to look for more information about biomaRt. I recommend that you ask further questions about Bioconductor R packages like biomaRt on the Bioconductor support forum.