<p>Perhaps you could use this (assuming <code>hg38</code>) as a lookup table:</p>
<pre><code>$ wget -qO- https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_39/gencode.v39.annotation.gff3.gz \
    | gunzip -c \
    | grep -wF exon \
    | convert2bed --input=gff --attribute-key=&quot;gene_name&quot; - \
    &gt; gencode.v39.exons.bed
</code></pre>
<p>If you prefer to search for an Ensembl accession ID, you can remove the <code>--attribute-key=&quot;gene_name&quot;</code> option. Otherwise, this puts the HGNC symbol into the ID column.</p>
<p>The preceding step takes about 30 seconds. Once you have made this lookup file, you can search it for exons of any gene of interest. Using <code>MYC</code> as an example:</p>
<pre><code>$ awk -v FS=&quot;\t&quot; -v OFS=&quot;\t&quot; '($5==&quot;MYC&quot;)' gencode.v39.exons.bed &gt; answer.bed
</code></pre>
<p>You can then further filter that by transcript or other attributes, etc.</p>

CC BY-SA 4.0
2022-01-20T03:32:20.973Z
2022-02-22T16:08:55.963Z
2022-02-22T16:08:55.963Z
Alex Reynolds
<p>I'd use biomart on ensembl.org</p>

CC BY-SA 4.0
2022-01-20T20:07:36.180Z
2022-01-20T20:07:36.180Z
swbarnes2
<p>So I know Consensus CDS has the genomic locations of exons, however, only of the exons in the CDS. Everything before or after is not included.</p>
<p>NIH variation viewer has those (kinda-) radio buttons next to the gene name, and when you hover over them, you do get to see the genomic locations of the exons. But this method isn't very scalable.</p>
<p>Does anyone know an easy, scalable way of retrieving the genomic locations of exon for a certain gene?</p>

CC BY-SA 4.0
2022-01-18T09:20:31.497Z
Not all exons are necessarily included in the CDS. On top of that, the first exon often is not translated completely, and only a part of the exon is part of the CDS.
mrPuzzle
CC BY-SA 4.0
2022-01-18T10:18:28.537Z
Ah, sure, you are right. Somehow my brain sometimes switches the words around. Never mind me.
Kamil S Jaron
<genome><human-genome><sequence-annotation><exon>
Find the genomic locations of exons of certain human gene
# Find the genomic locations of exons of certain human gene

(Asked by: username_0 on 2022-01-17)

So I know Consensus CDS has the genomic locations of exons, however, only of the exons in the CDS. Everything before or after is not included.

NIH variation viewer has those (kinda-) radio buttons next to the gene name, and when you hover over them, you do get to see the genomic locations of the exons. But this method isn't very scalable.

Does anyone know an easy, scalable way of retrieving the genomic locations of exon for a certain gene?

**Tags:** genome, human-genome, sequence-annotation, exon
> **Comments:**
> **username_0**: Not all exons are necessarily included in the CDS. On top of that, the first exon often is not translated completely, and only a part of the exon is part of the CDS.  
> **username_1**: Ah, sure, you are right. Somehow my brain sometimes switches the words around. Never mind me.  

---

## 2 answers

### Answer by username_2 on 2022-01-20. Score: 2 | Accepted answer

Perhaps you could use this (assuming hg38) as a lookup table:
$ wget -qO- https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_39/gencode.v39.annotation.gff3.gz \
    | gunzip -c \
    | grep -wF exon \
    | convert2bed --input=gff --attribute-key="gene_name" - \
    > gencode.v39.exons.bed

If you prefer to search for an Ensembl accession ID, you can remove the --attribute-key="gene_name" option. Otherwise, this puts the HGNC symbol into the ID column.
The preceding step takes about 30 seconds. Once you have made this lookup file, you can search it for exons of any gene of interest. Using MYC as an example:
$ awk -v FS="\t" -v OFS="\t" '($5=="MYC")' gencode.v39.exons.bed > answer.bed

You can then further filter that by transcript or other attributes, etc.


---

### Answer by username_3 on 2022-01-20. Score: 1

I'd use biomart on ensembl.org


---

