Answers.Body: <blockquote>
  <p>In my .gff3 there is the additional information of the locus of the mRNA, so I checked for each locus how many unique values there were for the Start values and subtracted one;</p>
  </blockquote>
  <p>Different isoforms of mRNA can share the same start coordinate. For example, they could share the same start coordinate but one skips an exon. MSpaint illustration below to help. Generally for GFF3 I would simply count e.g. how many mRNA have Parent=GENE0001234 to get the number of mRNA for GENE0001234, and you can expand that for all instances of GENENNNNNNNN</p>
  <p><a href="https://i.sstatic.net/RluRS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/RluRS.png" alt="enter image description here" /></a></p>
  <p>See also for example Wikipedia for Alternative splicing <a href="https://en.wikipedia.org/wiki/Alternative_splicing" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Alternative_splicing</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-25T01:30:55.353Z
Answers.LastActivityDate: 2021-08-25T01:30:55.353Z
Answers.UserDisplayName: Colin D
Answers.Body: <p>Gene isoforms are transcripts derived from the same gene that vary in their exons (blocks of the gene that make up the final transcript). This can alter the start position, end position, and/or internal sequence of the transcript. GTF/GFF files account for this by having multiple transcripts per gene (if applicable) that capture the various isoforms of the gene.</p>
  <p>Here's a little example in R to count the number of transcripts for a few human genes found in an ENSEMBL reference GFF3 file.</p>
  <pre><code>library(&quot;GenomicFeatures&quot;)
  
  gff3 &lt;- makeTxDbFromGFF(&quot;http://ftp.ensembl.org/pub/release-104/gff3/homo_sapiens/Homo_sapiens.GRCh38.104.chr.gff3.gz&quot;)
  
  &gt; stack(vapply(transcriptsBy(gff3, &quot;gene&quot;)[1:10], length, 1L))
     values             ind
  1       5 ENSG00000000003
  2       2 ENSG00000000005
  3      16 ENSG00000000419
  4       5 ENSG00000000457
  5       9 ENSG00000000460
  6       7 ENSG00000000938
  7       6 ENSG00000000971
  8       3 ENSG00000001036
  9      14 ENSG00000001084
  10      2 ENSG00000001167
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-25T01:49:06.273Z
Answers.LastActivityDate: 2021-08-25T01:49:06.273Z
Answers.UserDisplayName: rpolicastro
Body: <p>Recently I've been tasked to count the numbers of gene isoforms for each locus in a <code>.gff3</code> file. I'm still doing my first steps in biology and bioinformatics, so I still struggle with some concepts and methodologies.</p>
  <p>According to my understanding a gene isoform is a mRNA located in the same locus but with different start positions, so I did the following procedures:</p>
  <ol>
  <li>Selected the entries in the <code>.gff3</code> that are classified as mRNA.</li>
  <li>In my <code>.gff3</code> there is the additional information of the locus of the mRNA, so I checked for each locus how many unique values there were for the Start values and subtracted one.</li>
  <li>Assigned each value from step 2. to their respective locus, resulting in the desired number of isoforms for each locus.</li>
  </ol>
  <p>My question is <em>is this method correct</em>?</p>
  <p>Why do I believe it could be wrong or inaccurate:
  I don't have a complete solid understanding of a gene isoform, and researching some more I've seen that not only the start point of the mRNA is relevant but other things such as the protein coding DNA sequence (which I believe could be identified in the file under the CDS tag) and untranslated regions (which I don't know if I can identify in my file), and in the method I described above I've only taken in consideration the Start position, what appears to be incomplete.</p>
  <p>Additionally if the method is incorrect how can I take in consideration the additional circumstances, and if it's correct why  didn't those circumstances influence the count so much?</p>
  
Tags: <rna-seq><genomics><gff3>
Title: Counting the number of gene isoforms in a GFF3, is this method correct?
ThreadText: # Counting the number of gene isoforms in a GFF3, is this method correct?
  
  (Asked by: username_0 on 2021-08-25)
  
  Recently I've been tasked to count the numbers of gene isoforms for each locus in a `.gff3` file. I'm still doing my first steps in biology and bioinformatics, so I still struggle with some concepts and methodologies.
  
  According to my understanding a gene isoform is a mRNA located in the same locus but with different start positions, so I did the following procedures:
  
  1. Selected the entries in the `.gff3` that are classified as mRNA.
  2. In my `.gff3` there is the additional information of the locus of the mRNA, so I checked for each locus how many unique values there were for the Start values and subtracted one.
  3. Assigned each value from step 2. to their respective locus, resulting in the desired number of isoforms for each locus.
  
  My question is *is this method correct*?
  
  Why do I believe it could be wrong or inaccurate:
  I don't have a complete solid understanding of a gene isoform, and researching some more I've seen that not only the start point of the mRNA is relevant but other things such as the protein coding DNA sequence (which I believe could be identified in the file under the CDS tag) and untranslated regions (which I don't know if I can identify in my file), and in the method I described above I've only taken in consideration the Start position, what appears to be incomplete.
  
  Additionally if the method is incorrect how can I take in consideration the additional circumstances, and if it's correct why didn't those circumstances influence the count so much?
  
  **Tags:** rna-seq, genomics, gff3
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2021-08-25. Score: 0 | Accepted answer
  
  > In my .gff3 there is the additional information of the locus of the mRNA, so I checked for each locus how many unique values there were for the Start values and subtracted one;
  
  Different isoforms of mRNA can share the same start coordinate. For example, they could share the same start coordinate but one skips an exon. MSpaint illustration below to help. Generally for GFF3 I would simply count e.g. how many mRNA have Parent=GENE0001234 to get the number of mRNA for GENE0001234, and you can expand that for all instances of GENENNNNNNNN
  
  [![enter image description here](https://i.sstatic.net/RluRS.png)](https://i.sstatic.net/RluRS.png)
  
  See also for example Wikipedia for Alternative splicing <https://en.wikipedia.org/wiki/Alternative_splicing>
  
  
  ---
  
  ### Answer by username_2 on 2021-08-25. Score: 0
  
  Gene isoforms are transcripts derived from the same gene that vary in their exons (blocks of the gene that make up the final transcript). This can alter the start position, end position, and/or internal sequence of the transcript. GTF/GFF files account for this by having multiple transcripts per gene (if applicable) that capture the various isoforms of the gene.
  
  Here's a little example in R to count the number of transcripts for a few human genes found in an ENSEMBL reference GFF3 file.
  
  ```
  library("GenomicFeatures")
  
  gff3 <- makeTxDbFromGFF("http://ftp.ensembl.org/pub/release-104/gff3/homo_sapiens/Homo_sapiens.GRCh38.104.chr.gff3.gz")
  
  > stack(vapply(transcriptsBy(gff3, "gene")[1:10], length, 1L))
     values             ind
  1       5 ENSG00000000003
  2       2 ENSG00000000005
  3      16 ENSG00000000419
  4       5 ENSG00000000457
  5       9 ENSG00000000460
  6       7 ENSG00000000938
  7       6 ENSG00000000971
  8       3 ENSG00000001036
  9      14 ENSG00000001084
  10      2 ENSG00000001167
  
  ```
  
  
  ---
  
  