# How can I convert codon coordinates to genomic position?

I am looking for a given mutation in IGV, which accepts coordinates in the form of

chr<X>:<Y>


Where X is the chromosome number and Y is the base location in that chromosome.

Eg. chr6:26091179 which has the following attributes:

Gene: HFE|LOC108783645
Marker: rs1799945
Position: chr6:26091179


Additionally, an interval can be written like

chr<X>:<Y>-<Z>


So basically from base located at Y to Z.

My questions are:

1) How do I convert HFE|LOC108783645 to chr6:26091179 (and vice-versa)?

2) How do I convert rs1799945 to chr6:26091179 (and vice-versa)?

3) On a different example, how do I convert something like codon 109 of exon 3 of beta globin gene (GTG->TTG) to chr<X>:<Y> (or chr<X>:<Y>-<Z>)?

Why are there so many ways to specify positions in genes? For me the most clear way is chr<X>:<Y>, all the others leave me guessing...

• You should look at HGVS conventions used to refer to positions with respect to reference sequences. Remember, not even chr:pos notations are independent of reference sequence versions. chr6:26091179 in GRCh38 is not the same in GRCh37. May 18 '20 at 23:53

1. HFE|LOC108783645 is https://www.ncbi.nlm.nih.gov/gene/108783645. You can use biomaRt to go from the LOCxxxx ID to location. Searching by HFE will give you a different location though, so you might have to account for such eventualities. It is a long and often manually intensive process.
3. Unless there's some sort of natural language processing API, codon 109 of exon 3 of beta globin gene cannot be parsed by existing APIs (Unless it's always codon X of exon Y of Z, in which case you could use grep too get the components. Even so, going from exon + codon + codon base change to exact base location will require a lot of wrangling.