This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to convert chromosome locations to gene symbols?

Hi.

I wonder how to convert chromosome locations to gene symbols.

An example of chromosome locations name is 'chr1: 44959708-45072070'. There are many chromosome locations.

I want the chromosome location names to gene symbols.

Should I use 'biomaRt' package? If I need to use the 'biomaRt' package, how can I change the example chromosome location name to a gene symbol?

Please help me.

symbol location chromosome gene

possibly bedtools intersect with a gff file

2 answers

Here's an R solution using biomaRt To Get All Genes Within A Genomic Region

A solution:

wget -q -O - "https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_43/gencode.v43.annotation.gtf.gz" |\
gunzip -c |\
awk -F '\t' '($3=="gene" && $1=="chr1" && !(int($4)>45072070 || int($5)<44959708))' | cut -f 9 |\
tr ";" "\n" | grep -Fw gene_name | cut -d '"' -f 2 | sort | uniq
EIF2B3
HECTD3
MRPS17P1
OSTCP5
PPIAP35
UROD
ZSWIM5

Oh, I'm sorry. I am analyzing in R. Do you know how to convert chromosome location to gene symbol in R?

Log in to answer this question.