简体   繁体   English

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

[英]Get gene location from gene symbol and ID

I want to get gene location of human genome from gene symbol(example: TTN) and gene ID(example: ENSG00000155657). 我想从基因符号(例如:TTN)和基因ID(例如:ENSG00000155657)获得人类基因组的基因定位。 I want to do it using biomaRt package of R. How can I do that? 我想用R的biomaRt包来做它我怎么能这样做?

I'm not entirely sure what you mean by gene location, but I think the following should get you started: 我不完全确定你的基因位置是什么意思,但我认为以下内容应该让你开始:

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)

You can input more filters by adding additional vectors (of length two in this example) to the values list. 您可以通过向values列表添加其他向量(在此示例中为长度为2)来输入更多过滤器。

You can use the function listAttributes(ensembl) to get a data.frame containing all attributes that you can obtain from biomart. 您可以使用函数listAttributes(ensembl)来获取包含您可以从biomart获取的所有属性的data.frame。

As @neilfws has already stated, the biomaRt user guide is the right place to look for more information about biomaRt. 正如@neilfws已经说过的那样, biomaRt用户指南是寻找有关biomaRt的更多信息的正确位置。 I recommend that you ask further questions about Bioconductor R packages like biomaRt on the Bioconductor support forum . 我建议您在Bioconductor支持论坛上询问有关Bioconductor R包的更多问题,例如biomaRt。

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

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