Answers.Body: <p><em>Answer from @terdon, @Ben_Ensembl, converted from <a href="https://bioinformatics.stackexchange.com/help/privileges/comment">comments</a>:</em></p>
  <p>Genes don't have exons, <em>transcripts</em> have exons. There are <a href="https://www.ensembl.org/Homo_sapiens/Transcript/Summary?db=core;g=ENSG00000034713;r=16:75566375-75577881;t=ENST00000565057" rel="nofollow noreferrer">five transcripts for ENSG00000034713</a>, one with one exon, two with three exons, and two with four exons. No transcripts with five exons though.</p>
  <p>The count you retrieved from the GTF will be the number of unique exons for all transcripts of each gene (some unique to a single transcript, some common between two or more transcripts).</p>
  <p><em>[please improve this answer if you can by editing it]</em></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-25T19:39:16.657Z
Answers.LastActivityDate: 2023-01-25T19:39:16.657Z
Answers.UserDisplayName: gringer
Body: <p>Based on the ENSEMBL <a href="https://ftp.ensembl.org/pub/release-108/gtf/homo_sapiens/Homo_sapiens.GRCh38.108.gtf.gz" rel="nofollow noreferrer">GTF</a> file, I counted the number of exons per gene as follows:</p>
  <pre><code>awk '$3 == &quot;exon&quot; {print}' Homo_sapiens.GRCh38.108.gtf | gffread -F --keep-exon-attrs --table &quot;gene_id&quot;,&quot;transcript_id&quot;,@numexons | sort -k1,1 | datamash -sg1 max 3 &gt; gene_lists/exons_per_gene.txt
  </code></pre>
  <p>An extract of the output is:</p>
  <pre><code>ENSG00000034677 11
  ENSG00000034693 12
  ENSG00000034713 4
  ENSG00000034971 4
  </code></pre>
  <p>However, when I check the ENSG00000034713 ENSEMBL <a href="https://www.ensembl.org/Homo_sapiens/Gene/Sequence?db=core;g=ENSG00000034713;r=16:75566375-75577881" rel="nofollow noreferrer">site</a>, I count 5 exons. Why is this different?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-01-25T09:26:12.357Z
Comments.Text: Thank you all for the clarification. I was looking at the gene sequence section (https://www.ensembl.org/Homo_sapiens/Gene/Sequence?db=core;g=ENSG00000034713;r=16:75566375-75577881) where exons are marked in red (there are 5 red regions for the example gene), but not all transcripts will use all exons as said above. Then the number I have makes sense. Thanks again.
Comments.UserDisplayName: justinian482
Tags: <ensembl><gtf>
Title: Exon number between GTF file and ENSEMBL site does not match
ThreadText: # Exon number between GTF file and ENSEMBL site does not match
  
  (Asked by: username_0 on 2023-01-24)
  
  Based on the ENSEMBL [GTF](https://ftp.ensembl.org/pub/release-108/gtf/homo_sapiens/Homo_sapiens.GRCh38.108.gtf.gz) file, I counted the number of exons per gene as follows:
  
  ```
  awk '$3 == "exon" {print}' Homo_sapiens.GRCh38.108.gtf | gffread -F --keep-exon-attrs --table "gene_id","transcript_id",@numexons | sort -k1,1 | datamash -sg1 max 3 > gene_lists/exons_per_gene.txt
  
  ```
  
  An extract of the output is:
  
  ```
  ENSG00000034677 11
  ENSG00000034693 12
  ENSG00000034713 4
  ENSG00000034971 4
  
  ```
  
  However, when I check the ENSG00000034713 ENSEMBL [site](https://www.ensembl.org/Homo_sapiens/Gene/Sequence?db=core;g=ENSG00000034713;r=16:75566375-75577881), I count 5 exons. Why is this different?
  
  **Tags:** ensembl, gtf
  
  > **Comments:**
  > **username_0**: Thank you all for the clarification. I was looking at the gene sequence section (https://www.ensembl.org/Homo_sapiens/Gene/Sequence?db=core;g=ENSG00000034713;r=16:75566375-75577881) where exons are marked in red (there are 5 red regions for the example gene), but not all transcripts will use all exons as said above. Then the number I have makes sense. Thanks again.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-01-25. Score: 2 | Accepted answer
  
  *Answer from @terdon, @Ben\_Ensembl, converted from [comments](https://bioinformatics.stackexchange.com/help/privileges/comment):*
  
  Genes don't have exons, *transcripts* have exons. There are [five transcripts for ENSG00000034713](https://www.ensembl.org/Homo_sapiens/Transcript/Summary?db=core;g=ENSG00000034713;r=16:75566375-75577881;t=ENST00000565057), one with one exon, two with three exons, and two with four exons. No transcripts with five exons though.
  
  The count you retrieved from the GTF will be the number of unique exons for all transcripts of each gene (some unique to a single transcript, some common between two or more transcripts).
  
  *[please improve this answer if you can by editing it]*
  
  
  ---
  
  