text: user12044: Suppose I have a list of genes and I want to find their genomic coordinates. To be specific and to keep things consistent with the rest of my project, I'm using hg38 on the website genome.ucsc.edu. So far, I've been typing one gene symbol at a time into the gene browser and clicking the correct match. This sends me to the gene's page, which shows me the start and end genome coordinates for the gene's transcript and coding region. That's what I'm looking for.
  This is a tedious process when I have hundreds of genes to go through, so I was wondering if I can input a list and get out a list instead. I know about the page https://genome.ucsc.edu/cgi-bin/hgTables. As an example, suppose I click "paste list" and just type the following two lines:
  CASZ1
  MTHFR
  
  Here's a screenshot of the output (click to see full sized image):
  
  I think this page is generally intended to go the opposite direction (genomic coordinates -> genes)?
  Edit: Ok, here's an example of what I want. I'd like to just enter the gene symbols and get the transcript and coding regions shown.
  CASZ1, Transcript chr1:10,636,604-10,796,646, Coding Region chr1:10,638,942-10,693,889
  MTHFR, Transcript chr1:11,785,723-11,805,964, Coding Region chr1:11,790,680-11,803,116
  ST7L, Transcript chr1:112,525,883-112,618,928, Coding Region chr1:112,526,013-112,598,043
  
  I obtained these by searching through genome.ucsc.edu one by one manually.
  
  user776: The current release of Gencode for hg38 is v38. This is one way you could get a list of Gencode gene annotations:
  $ wget -qO- ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_38/gencode.v38.annotation.gff3.gz \
      | gunzip --stdout - \
      | awk '$3 == "gene"' - \
      | convert2bed -i gff - \
      > genes.bed
  
  To get convert2bed, you could install a toolkit called BEDOPS, which is available via Github or package managers. Refer to the installation instructions for more detail.
  Once you have genes.bed, you don't need to make it again, unless Gencode publishes a new set of annotations.
  You could create a text file called genes_of_interest.txt that contains your HGNC names of interest, e.g.:
  $ cat > genes_of_interest.txt
  CASZ1
  MTHFR
  ST7L
  
  Press Ctrl + D at the end to close the file.
  To search genes.bed for entries where there are matches to your genes of interest, you can use grep:
  $ grep -Fwf genes_of_interest.txt genes.bed
  chr1    10636603    10796650    ENSG00000130940.14  .   -   HAVANA  gene    .   ID=ENSG00000130940.14;gene_id=ENSG00000130940.14;gene_type=protein_coding;gene_name=CASZ1;level=1;havana_gene=OTTHUMG00000002035.5
  chr1    11785722    11806920    ENSG00000177000.11  .   -   HAVANA  gene    .   ID=ENSG00000177000.11;gene_id=ENSG00000177000.11;gene_type=protein_coding;gene_name=MTHFR;level=2;havana_gene=OTTHUMG00000002277.5
  chr1    112523517   112620825   ENSG00000007341.18  .   -   HAVANA  gene    .   ID=ENSG00000007341.18;gene_id=ENSG00000007341.18;gene_type=protein_coding;gene_name=ST7L;level=2;havana_gene=OTTHUMG00000011753.7
  
  The above is just sample output. Your result may differ.
  
original_text: 12044: <p>Suppose I have a list of genes and I want to find their genomic coordinates. To be specific and to keep things consistent with the rest of my project, I'm using hg38 on the website genome.ucsc.edu. So far, I've been typing one gene symbol at a time into the gene browser and clicking the correct match. This sends me to the gene's page, which shows me the start and end genome coordinates for the gene's transcript and coding region. That's what I'm looking for.</p>
  <p>This is a tedious process when I have hundreds of genes to go through, so I was wondering if I can input a list and get out a list instead. I know about the page <a href="https://genome.ucsc.edu/cgi-bin/hgTables" rel="nofollow noreferrer">https://genome.ucsc.edu/cgi-bin/hgTables</a>. As an example, suppose I click &quot;paste list&quot; and just type the following two lines:</p>
  <pre><code>CASZ1
  MTHFR
  </code></pre>
  <p>Here's a screenshot of the output (click to see full sized image):</p>
  <p><a href="https://ibb.co/MZthX6N" rel="nofollow noreferrer"><img src="https://i.ibb.co/4KXfQdN/temp.jpg" alt="" /></a></p>
  <p>I think this page is generally intended to go the opposite direction (genomic coordinates -&gt; genes)?</p>
  <p>Edit: Ok, here's an example of what I want. I'd like to just enter the gene symbols and get the transcript and coding regions shown.</p>
  <pre><code>CASZ1, Transcript chr1:10,636,604-10,796,646, Coding Region chr1:10,638,942-10,693,889
  MTHFR, Transcript chr1:11,785,723-11,805,964, Coding Region chr1:11,790,680-11,803,116
  ST7L, Transcript chr1:112,525,883-112,618,928, Coding Region chr1:112,526,013-112,598,043
  </code></pre>
  <p>I obtained these by searching through genome.ucsc.edu one by one manually.</p>
   776: <p>The <a href="https://www.gencodegenes.org/human/" rel="nofollow noreferrer">current release</a> of Gencode for <code>hg38</code> is v38. This is one way you could get a list of Gencode gene annotations:</p>
  <pre><code>$ wget -qO- ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_38/gencode.v38.annotation.gff3.gz \
      | gunzip --stdout - \
      | awk '$3 == &quot;gene&quot;' - \
      | convert2bed -i gff - \
      &gt; genes.bed
  </code></pre>
  <p>To get <code>convert2bed</code>, you could install a toolkit called BEDOPS, which is available via <a href="https://github.com/bedops/bedops" rel="nofollow noreferrer">Github</a> or package managers. Refer to the <a href="https://bedops.readthedocs.io/en/latest/content/installation.html" rel="nofollow noreferrer">installation instructions</a> for more detail.</p>
  <p>Once you have <code>genes.bed</code>, you don't need to make it again, unless Gencode publishes a new set of annotations.</p>
  <p>You could create a text file called <code>genes_of_interest.txt</code> that contains your HGNC names of interest, e.g.:</p>
  <pre><code>$ cat &gt; genes_of_interest.txt
  CASZ1
  MTHFR
  ST7L
  </code></pre>
  <p>Press <kbd>Ctrl</kbd> + <kbd>D</kbd> at the end to close the file.</p>
  <p>To search <code>genes.bed</code> for entries where there are matches to your genes of interest, you can use <code>grep</code>:</p>
  <pre><code>$ grep -Fwf genes_of_interest.txt genes.bed
  chr1    10636603    10796650    ENSG00000130940.14  .   -   HAVANA  gene    .   ID=ENSG00000130940.14;gene_id=ENSG00000130940.14;gene_type=protein_coding;gene_name=CASZ1;level=1;havana_gene=OTTHUMG00000002035.5
  chr1    11785722    11806920    ENSG00000177000.11  .   -   HAVANA  gene    .   ID=ENSG00000177000.11;gene_id=ENSG00000177000.11;gene_type=protein_coding;gene_name=MTHFR;level=2;havana_gene=OTTHUMG00000002277.5
  chr1    112523517   112620825   ENSG00000007341.18  .   -   HAVANA  gene    .   ID=ENSG00000007341.18;gene_id=ENSG00000007341.18;gene_type=protein_coding;gene_name=ST7L;level=2;havana_gene=OTTHUMG00000011753.7
  </code></pre>
  <p>The above is just sample output. Your result may differ.</p>
  