text: user351: I have a gff file like this (I edited the name):
  scaffold_x  source  exon    2987526 2987805 .   -   .   name "foobar";transcriptId 68892
  scaffold_x  source  CDS     2987526 2987805 .   -   1   name "foobar";proteinId 68892;exonNumber 5
  scaffold_x  source  exon    2988610 2988745 .   -   .   name "foobar";transcriptId 68892
  scaffold_x  source  CDS     2988610 2988745 .   -   2   name "foobar";proteinId 68892;exonNumber 4
  scaffold_x  source  exon    2989157 2989645 .   -   .   name "foobar";transcriptId 68892
  scaffold_x  source  CDS     2989157 2989645 .   -   2   name "foobar";proteinId 68892;exonNumber 3
  scaffold_x  source  exon    2990903 2991541 .   -   .   name "foobar";transcriptId 68892
  scaffold_x  source  CDS     2990903 2991541 .   -   2   name "foobar";proteinId 68892;exonNumber 2
  scaffold_x  source  stop_codon  2990903 2990905 .   -   0   name "foobar"
  scaffold_x  source  exon    2991587 2992430 .   -   .   name "foobar";transcriptId 68892
  scaffold_x  source  CDS     2991587 2992430 .   -   0   name "foobar";proteinId 68892;exonNumber 1
  scaffold_x  source  start_codon 2992428 2992430 .   -   0   name "foobar"
  
  So the start_codon is 2992428    2992430 and the stop_codon is 2990903   2990905; I would therefore expect all the exons within this range, however, e.g. exon 5 is found in 2987526   2987805 which is clearly outside this range.
  Is there something wrong with the gff file itself or is there a plausible explanation for that?
  EDIT:
  In the corresponding protein fasta I do find an amino acid sequence associated with this prtein ID and name:
  >68892|foobar
  MHTGD...
  
  
  user196: Although the explanation that UTR (untranscribed) regions can consist of multiple exons covers most situations, I think it is good to mention stop codon readthrough.
  This would result in a CDS (coding sequence) part of your mRNA (messenger RNA) after a stop codon.
  However, following the gff3 format specification, this should probably be encoded differently, using SO (sequence ontology) terms like SO:0000697 (gene with stop codon read through) and  SO:0000883 (stop codon readthrough).
  
  user1332: Those are the untranslated regions (UTRs). All mRNAs have a 5' UTR and a 3' UTR. These give the ribosome something to grab onto and often contain important regulatory sites such as miRNA target sites.
  
  user298: Yes, of course. Exons are not limited to the protein coding regions. Many UTRs are in exons. In fact, you even have various cases of UTRs being multiple exons, and being spliced. 
  What is strange in your file is not so much that you have exons beyond the stop codon, but that you also have them marked as CDS (coding sequence). That isn't possible, no. While there can indeed be exons in the UTRs, those are not coding and shouldn't be called CDS. That's probably just a minor nomenclature issue though and what you are looking at is a spliced UTR. 
  So, the exons (or the parts of the exons) that fall between the start and stop codons will be translated, while those that fall outside that regions will not be (UTRs). 
  For example, this is the exonic structure shown for ENST00000617185, one of the transcripts of the human P53 gene:
  
  The boxes are exons and the lines are introns. The colored boxes are protein coding exons, while the empty ones are UTR exons. Note how they are also spliced and that this particular transcript has 3 non-coding exons on the 5' end and one on the 3' end. 
  
original_text: 351: <p>I have a gff file like this (I edited the name):</p>
  
  <pre><code>scaffold_x  source  exon    2987526 2987805 .   -   .   name "foobar";transcriptId 68892
  scaffold_x  source  CDS     2987526 2987805 .   -   1   name "foobar";proteinId 68892;exonNumber 5
  scaffold_x  source  exon    2988610 2988745 .   -   .   name "foobar";transcriptId 68892
  scaffold_x  source  CDS     2988610 2988745 .   -   2   name "foobar";proteinId 68892;exonNumber 4
  scaffold_x  source  exon    2989157 2989645 .   -   .   name "foobar";transcriptId 68892
  scaffold_x  source  CDS     2989157 2989645 .   -   2   name "foobar";proteinId 68892;exonNumber 3
  scaffold_x  source  exon    2990903 2991541 .   -   .   name "foobar";transcriptId 68892
  scaffold_x  source  CDS     2990903 2991541 .   -   2   name "foobar";proteinId 68892;exonNumber 2
  scaffold_x  source  stop_codon  2990903 2990905 .   -   0   name "foobar"
  scaffold_x  source  exon    2991587 2992430 .   -   .   name "foobar";transcriptId 68892
  scaffold_x  source  CDS     2991587 2992430 .   -   0   name "foobar";proteinId 68892;exonNumber 1
  scaffold_x  source  start_codon 2992428 2992430 .   -   0   name "foobar"
  </code></pre>
  
  <p>So the <code>start_codon</code> is <code>2992428    2992430</code> and the <code>stop_codon</code> is <code>2990903   2990905</code>; I would therefore expect all the exons within this range, however, e.g. exon 5 is found in <code>2987526   2987805</code> which is clearly outside this range.</p>
  
  <p>Is there something wrong with the gff file itself or is there a plausible explanation for that?</p>
  
  <p>EDIT:</p>
  
  <p>In the corresponding protein fasta I do find an amino acid sequence associated with this prtein ID and name:</p>
  
  <pre><code>&gt;68892|foobar
  MHTGD...
  </code></pre>
   196: <p>Although the explanation that UTR (untranscribed) regions can consist of multiple exons covers most situations, I think it is good to mention <a href="https://en.wikipedia.org/wiki/Stop_codon#Translational_readthrough" rel="nofollow noreferrer">stop codon readthrough</a>.</p>
  
  <p>This would result in a CDS (coding sequence) part of your mRNA (messenger RNA) <em>after</em> a stop codon.</p>
  
  <p>However, following the <a href="https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md" rel="nofollow noreferrer">gff3 format specification</a>, this should probably be encoded differently, using SO (<a href="https://github.com/The-Sequence-Ontology/SO-Ontologies/blob/master/so-simple.obo" rel="nofollow noreferrer">sequence ontology</a>) terms like SO:0000697 (gene with stop codon read through) and  SO:0000883 (stop codon readthrough).</p>
   1332: <p>Those are the untranslated regions (UTRs). All mRNAs have a 5' UTR and a 3' UTR. These give the ribosome something to grab onto and often contain important regulatory sites such as miRNA target sites.</p>
   298: <p>Yes, of course. Exons are not limited to the protein coding regions. Many UTRs are in exons. In fact, you even have various cases of UTRs being multiple exons, and being spliced. </p>
  
  <p>What is strange in your file is not so much that you have exons beyond the stop codon, but that you also have them marked as CDS (coding sequence). That isn't possible, no. While there can indeed be exons in the UTRs, those are not coding and shouldn't be called CDS. That's probably just a minor nomenclature issue though and what you are looking at is a spliced UTR. </p>
  
  <p>So, the exons (or the parts of the exons) that fall between the start and stop codons will be translated, while those that fall outside that regions will not be (UTRs). </p>
  
  <p>For example, this is the exonic structure shown for <a href="http://www.ensembl.org/Homo_sapiens/Transcript/Summary?db=core;g=ENSG00000141510;r=17:7661779-7687550;t=ENST00000617185" rel="nofollow noreferrer">ENST00000617185</a>, one of the transcripts of the human P53 gene:</p>
  
  <p><a href="https://i.stack.imgur.com/43fYt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/43fYt.png" alt="TP53 exonic structure"></a></p>
  
  <p>The boxes are exons and the lines are introns. The colored boxes are protein coding exons, while the empty ones are UTR exons. Note how they are also spliced and that this particular transcript has 3 non-coding exons on the 5' end and one on the 3' end. </p>
  