<p>You could also get your genes from <a href="https://genome-euro.ucsc.edu/cgi-bin/hgTables" rel="nofollow noreferrer">UCSC</a>. Here's how:</p>
<p><a href="https://i.sstatic.net/hxe6O.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hxe6O.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2021-09-03T08:45:15.253Z
2021-09-03T08:45:15.253Z
user324810
<p>Via Gencode and BEDOPS <code>convert2bed</code>:</p>
<pre><code><span class="math-container">$ wget -qO- ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_28/gencode.v28.annotation.gff3.gz \
    | gunzip --stdout - \
    | awk '$</span>3 == &quot;gene&quot;' - \
    | convert2bed -i gff - \
    &gt; genes.bed
</code></pre>
<p>Replace the FTP path with that needed for your genome of interest. Feel free to edit your question if you need help with that, by specifying your given genome.</p>
<p>You can modify the <code>awk</code> statement to get exons, by replacing <code>gene</code> with <code>exon</code>.</p>
<p>BEDOPS: <a href="https://github.com/bedops/bedops" rel="nofollow noreferrer">https://github.com/bedops/bedops</a></p>
<p>Once you have the genes in BED format, you can <code>grep</code> the file for them, using a text file of matches:</p>
<pre><code>$ grep -Fwf genes_of_interest.txt genes.bed &gt; genes_of_interest.bed
</code></pre>

CC BY-SA 4.0
2021-09-02T23:51:18.683Z
2021-09-03T03:24:09.560Z
2021-09-03T03:24:09.560Z
Alex Reynolds
<p>Is there a way to generate a BED file of a list of gene symbols for a given genome?</p>

<fasta><genome><bed>
Create BED file from list with gene symbols
# Create BED file from list with gene symbols

(Asked by: username_0 on 2021-09-02)

Is there a way to generate a BED file of a list of gene symbols for a given genome?

**Tags:** fasta, genome, bed

---

## 2 answers

### Answer by username_2 on 2021-09-02. Score: 4 | Accepted answer

Via Gencode and BEDOPS convert2bed:
$ wget -qO- ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_28/gencode.v28.annotation.gff3.gz \
    | gunzip --stdout - \
    | awk '$3 == "gene"' - \
    | convert2bed -i gff - \
    > genes.bed

Replace the FTP path with that needed for your genome of interest. Feel free to edit your question if you need help with that, by specifying your given genome.
You can modify the awk statement to get exons, by replacing gene with exon.
BEDOPS: https://github.com/bedops/bedops
Once you have the genes in BED format, you can grep the file for them, using a text file of matches:
$ grep -Fwf genes_of_interest.txt genes.bed > genes_of_interest.bed


---

### Answer by username_1 on 2021-09-03. Score: 3

You could also get your genes from [UCSC](https://genome-euro.ucsc.edu/cgi-bin/hgTables). Here's how:

[![enter image description here](https://i.sstatic.net/hxe6O.png)](https://i.sstatic.net/hxe6O.png)


---

