Return coordinates for a given gene or a set of genes.

gene_to_region(
  gene_symbol,
  ensembl_id,
  genome_build = "grch37",
  return_as = "region"
)

Arguments

gene_symbol

A vector of one or more gene symbols.

ensembl_id

A vector of one or more Ensembl IDs.

genome_build

Reference genome build, default is grch37.

return_as

Specify the type of return. Default is region (chr:start-end), other acceptable arguments are "bed" and "df".

Value

A data frame, or a string with region(s) for the provided gene(s).

Details

This function takes one or multiple gene names, either as hugo symbols or Ensembl IDs and returns the coordinates for the selected genes in multiple formats (return_as). The possible return formats are; bed, data frame and in "region" format (chr:start-end). For returning genes residing in specific regions, see region_to_gene.

Examples

bcl2_region = gene_to_region(gene_symbol = "BCL2",
                             genome_build = "grch37")
#> 1 region(s) returned for 1 gene(s)

bcl2_region = gene_to_region(ensembl_id = "ENSG00000171791",
                             genome_build = "grch37")
#> 1 region(s) returned for 1 gene(s)