Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-03T08:45:15.253Z
Answers.LastActivityDate: 2021-09-03T08:45:15.253Z
Answers.UserDisplayName: user324810
Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-02T23:51:18.683Z
Answers.LastActivityDate: 2021-09-03T03:24:09.560Z
Answers.LastEditDate: 2021-09-03T03:24:09.560Z
Answers.UserDisplayName: Alex Reynolds
Body: <p>Is there a way to generate a BED file of a list of gene symbols for a given genome?</p>
  
Tags: <fasta><genome><bed>
Title: Create BED file from list with gene symbols
ThreadText: # 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)
  
  
  ---
  
  