<p>Let me answer around your questions a bit freely:</p>
<p><strong>Gene Versions:</strong> I always gsub them away when using GENCODE since the actual version control happens by using a fixed and reproducible GENCODE release. The gene versions to me have no meaning. Not a good answer since I am not answering the &quot;what are they exactly&quot; but for almost a decade I am fine just removing them.</p>
<p><strong>Gene Biotype and Type:</strong> Yes, they're the same with different names.</p>
<p><strong>Gene IDs and Names:</strong> Without an example I am not sure what you mean. Generally, gene names (HUGO, MGI, depending on species) are a mess and not systematic. Some Ensembl IDs have the same symbol, others (depending on annotation) have none, and yet others have messy ones, for example there is iirc a gene named just &quot;a&quot;. My recommendation is to use for analysis geneID_geneName, for example <code>ENSG00000066336_SPI1</code>, and then for plots or interaction with people who do not want to (or do not know how to) use gene IDs, just gsub the ENSG... way. Note that gene names are not unique, as said, some genes have the same name, posing issues for uniqueness in your data.frames / rownames. The combination of ID and name makes sure that gene identifiers are always unique. I over time just wrote my functions in a way that for plots it automatically removes the gene ID part.</p>
<p><strong>GTFs:</strong> I recommend using the <code>Basic gene annotation</code> which contains the canonical transcripts on primary chromosomes, but not alternative loci or patches. It is what I use productively, and what iirc GENCODE recommends for most users.</p>

CC BY-SA 4.0
2024-06-04T08:34:45.910Z
Thank you very much for this answer. Lastly, is there any reason for using Gencode over Ensembl in your opinion? Is Gencode "more comprehensive"? Will it make much difference over (plain) ensemble?
Freek
CC BY-SA 4.0
2024-06-04T08:36:01.387Z
And, to be clear, what you call "Basic gene annottion" is  gencode.v46.annotation.gtf.gz right? Not gencode.v46.primary_assembly.annotation.gtf.gz ?
Freek
CC BY-SA 4.0
2024-05-31T07:16:40.087Z
2024-05-31T08:22:46.963Z
2024-05-31T08:22:46.963Z
ATpoint
<p>I recently switched from RSEM to Salmon for RNAseq data processing. I started in the Ensembl world and wrote a lot of code around their GTF file (for filtering biotypes/normalization lists etc, <a href="http://ftp.ensembl.org/pub/release-95/gtf/homo_sapiens/" rel="nofollow noreferrer">http://ftp.ensembl.org/pub/release-95/gtf/homo_sapiens/</a>, yeah it's old). Salmon recommends the Gencode reference genome and annotation files (<a href="http://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_46/" rel="nofollow noreferrer">http://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_46/</a> a chance for me to get something more recent).</p>
<p>Using my code on the new files makes me run into some issues and makes me wonder if it is worth it to switch to Gencode. I guess I just wonder &quot;what is better&quot; and perhaps some more words of wisdom. <a href="https://bioinformatics.stackexchange.com/questions/21/feature-annotation-refseq-vs-ensembl-vs-gencode-whats-the-difference">Here</a> someone says &quot;Gencode is an additive set of annotation (the manual one done by Havana and an automated one done by Ensembl)&quot;, but there are also some technical differences, some of the difference that I noticed:</p>
<ol>
<li>In the Ensembl GTF file the Ensembl IDs do not have &quot;versions&quot;, they do not end in <code>.1</code> or <code>.2</code> (i.e. <code>ENSG00000290825.1</code>), instead they have a <code>gene_version</code> attribute that seem to match the decimal in the Gencode GTF file. To use my old code I need to remove these version indicators, or, if they are not version indicators, please tell me what they are and what they are good for?</li>
<li>Ensembl uses the <code>gene_biotype</code> attribute, whereas gencode uses <code>gene_type</code>. I guess those attributes are the same (but why the difference)?</li>
<li>In my Ensembl GTF file, every <code>gene_id</code> has a unique <code>gene_name</code> attribute (a HUGO symbol). In the Gencode GTF there are plenty of <code>gene_id</code>s who have their Ensembl id as their <code>gene_name</code>. Is that expected? Why this difference? (The biologists I work with like HUGO symbols so I make dictionary based on the GTF file).</li>
<li>My last question is, for Gencode, there is a <code>gencode.v46.annotation.gtf.gz</code> and a <code>gencode.v46.primary_assembly.annotation.gtf.gz</code> at first glance they look the same but they do have a different number of lines (3467161 vs 3467739, not a big difference..)</li>
</ol>
<p>Maybe it all doesn't matter too much but I always prefer to make informed choices, and in this case switching from Ensembl to Gencode should be worth my extra effort, and perhaps it is not...</p>

CC BY-SA 4.0
2024-05-30T18:12:11.527Z
I can answer #4: `primary_assembly` is usually just the canonical chromosomes, so nothing on patches or other scaffolds.
Ram RS
CC BY-SA 4.0
2024-05-30T20:47:15.603Z
Thanx for your reply! So Why would I want one over the other?
Freek
CC BY-SA 4.0
2024-05-31T15:29:20.937Z
I'm not sure but the primary_assembly is what most people need and use. The other one is for more cutting edge research, I think.
Ram RS
<ensembl><gtf><gencode>
Differences between Gencode GTF and Ensembl GTF files
# Differences between Gencode GTF and Ensembl GTF files

(Asked by: username_0 on 2024-05-30)

I recently switched from RSEM to Salmon for RNAseq data processing. I started in the Ensembl world and wrote a lot of code around their GTF file (for filtering biotypes/normalization lists etc, <http://ftp.ensembl.org/pub/release-95/gtf/homo_sapiens/>, yeah it's old). Salmon recommends the Gencode reference genome and annotation files (<http://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_46/> a chance for me to get something more recent).

Using my code on the new files makes me run into some issues and makes me wonder if it is worth it to switch to Gencode. I guess I just wonder "what is better" and perhaps some more words of wisdom. [Here](https://bioinformatics.stackexchange.com/questions/21/feature-annotation-refseq-vs-ensembl-vs-gencode-whats-the-difference) someone says "Gencode is an additive set of annotation (the manual one done by Havana and an automated one done by Ensembl)", but there are also some technical differences, some of the difference that I noticed:

1. In the Ensembl GTF file the Ensembl IDs do not have "versions", they do not end in `.1` or `.2` (i.e. `ENSG00000290825.1`), instead they have a `gene_version` attribute that seem to match the decimal in the Gencode GTF file. To use my old code I need to remove these version indicators, or, if they are not version indicators, please tell me what they are and what they are good for?
2. Ensembl uses the `gene_biotype` attribute, whereas gencode uses `gene_type`. I guess those attributes are the same (but why the difference)?
3. In my Ensembl GTF file, every `gene_id` has a unique `gene_name` attribute (a HUGO symbol). In the Gencode GTF there are plenty of `gene_id`s who have their Ensembl id as their `gene_name`. Is that expected? Why this difference? (The biologists I work with like HUGO symbols so I make dictionary based on the GTF file).
4. My last question is, for Gencode, there is a `gencode.v46.annotation.gtf.gz` and a `gencode.v46.primary_assembly.annotation.gtf.gz` at first glance they look the same but they do have a different number of lines (3467161 vs 3467739, not a big difference..)

Maybe it all doesn't matter too much but I always prefer to make informed choices, and in this case switching from Ensembl to Gencode should be worth my extra effort, and perhaps it is not...

**Tags:** ensembl, gtf, gencode
> **Comments:**
> **username_1**: I can answer #4: `primary_assembly` is usually just the canonical chromosomes, so nothing on patches or other scaffolds.  
> **username_0**: Thanx for your reply! So Why would I want one over the other?  
> **username_1**: I'm not sure but the primary_assembly is what most people need and use. The other one is for more cutting edge research, I think.  

---

## 1 answers

### Answer by username_2 on 2024-05-31. Score: 3

Let me answer around your questions a bit freely:

**Gene Versions:** I always gsub them away when using GENCODE since the actual version control happens by using a fixed and reproducible GENCODE release. The gene versions to me have no meaning. Not a good answer since I am not answering the "what are they exactly" but for almost a decade I am fine just removing them.

**Gene Biotype and Type:** Yes, they're the same with different names.

**Gene IDs and Names:** Without an example I am not sure what you mean. Generally, gene names (HUGO, MGI, depending on species) are a mess and not systematic. Some Ensembl IDs have the same symbol, others (depending on annotation) have none, and yet others have messy ones, for example there is iirc a gene named just "a". My recommendation is to use for analysis geneID\_geneName, for example `ENSG00000066336_SPI1`, and then for plots or interaction with people who do not want to (or do not know how to) use gene IDs, just gsub the ENSG... way. Note that gene names are not unique, as said, some genes have the same name, posing issues for uniqueness in your data.frames / rownames. The combination of ID and name makes sure that gene identifiers are always unique. I over time just wrote my functions in a way that for plots it automatically removes the gene ID part.

**GTFs:** I recommend using the `Basic gene annotation` which contains the canonical transcripts on primary chromosomes, but not alternative loci or patches. It is what I use productively, and what iirc GENCODE recommends for most users.

> **Comments:**
> **username_0**: Thank you very much for this answer. Lastly, is there any reason for using Gencode over Ensembl in your opinion? Is Gencode "more comprehensive"? Will it make much difference over (plain) ensemble?  
> **username_0**: And, to be clear, what you call "Basic gene annottion" is  gencode.v46.annotation.gtf.gz right? Not gencode.v46.primary_assembly.annotation.gtf.gz ?  

---

