text: user10386: Based on the ENSEMBL GTF 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, I count 5 exons. Why is this different?
  
  user73: Answer from @terdon, @Ben_Ensembl, converted from comments:
  Genes don't have exons, transcripts have exons. There are five transcripts for ENSG00000034713, 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]
  
original_text: 10386: <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>
   73: <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>
  