Skip to content

GTF: Gene Annotation Files

After aligning short sequences, or reads, from RNA-seq to a genome, you need a table of gene locations to count which gene each read belongs to. That table is usually a GTF (Gene Transfer Format) file. GTF is a tab-delimited annotation format based on the GFF version 2 family with conventions added for gene and transcript information.

In one line:

GTF = an annotation file marking the locations of genes, transcripts, and exons on genome coordinates

GTF is not read data. It is a reference annotation. A typical analysis pipeline uses it like this:

FASTQ → alignment (STAR/HISAT2) → BAM
GTF annotation
read count / TPM by gene

Common uses:

StageRole of GTF
Building a genome indexLets an aligner such as STAR know splice-junction information in advance
Counting readsLets featureCounts and HTSeq-count assign reads to genes or exons
Quantifying transcriptsLets RSEM, StringTie, and similar tools interpret transcript structure
Interpreting resultsLinks gene IDs, gene names, and transcript IDs to coordinates

GTF is a tab-delimited text file. Each line represents one feature and always contains nine columns.

chr1 HAVANA exon 11869 12227 . + . gene_id "ENSG00000223972"; transcript_id "ENST00000456328"; gene_name "DDX11L1";
ColumnNameMeaning
1seqnameChromosome or contig name, such as chr1, 1, or GL000...
2sourceAnnotation source, such as HAVANA or ENSEMBL
3featureFeature type, such as gene, transcript, exon, CDS, or UTR
4startStart coordinate
5endEnd coordinate
6scoreScore, or . if absent
7strandStrand: +, -, or .
8frame / phaseCDS frame, or phase. Usually . outside protein-coding regions
9attributesAdditional information separated by semicolons

GTF coordinates are 1-based inclusive.

start = 11869
end = 12227

This means the region includes both endpoints, from base 11869 through base 12227.

Take care with these differences:

FormatCoordinate rule
GTF / GFF / VCF1-based
BED0-based, half-open

Mixing BED and GTF files commonly produces one-base coordinate errors.

attributes: the most important ninth column

Section titled “attributes: the most important ninth column”

The ninth column is the part of GTF that analysis tools read most often.

gene_id "ENSG00000141510";
transcript_id "ENST00000269305";
gene_name "TP53";
gene_biotype "protein_coding";

Key attributes:

AttributeMeaning
gene_idUnique gene ID, usually the most stable analytical unit
transcript_idTranscript isoform ID. Often absent from gene lines and present on transcript, exon, and CDS lines
gene_nameHuman-readable gene symbol, such as TP53 or MDM2
gene_biotype / gene_typeGene type such as protein_coding, lncRNA, or pseudogene. Ensembl mainly uses gene_biotype; GENCODE mainly uses gene_type
exon_numberOrder of the exon within the transcript

Where possible, storing data by gene_id rather than gene_name is safer. Gene symbols can change or be duplicated, while identifiers such as Ensembl gene IDs are more stable.

Common features include:

featureMeaning
geneEntire gene region
transcriptOne transcript isoform
exonAn exon forming part of a transcript
CDSCoding sequence translated into protein
UTRUntranslated 5’ or 3’ region
start_codon, stop_codonStart and stop codons

RNA-seq read counting usually aggregates exon features at the gene level. That is why featureCounts is often used with -t exon -g gene_id.

Terminal window
featureCounts \
-a annotation.gtf \
-t exon \
-g gene_id \
-o counts.txt \
aligned.bam

Meaning:

OptionMeaning
-a annotation.gtfGTF annotation to use
-t exonCount only exon lines
-g gene_idGroup exons with the same gene_id to produce counts by gene

GTF and GFF3 are both gene-annotation formats. They look similar, but the syntax of the ninth column differs.

FieldGTFGFF3
Ninth columngene_id "X"; transcript_id "Y";ID=exon1;Parent=transcript1
Representing hierarchyLinked through gene_id and transcript_id attributesExplicit parent-child relationships through ID and Parent

GFF3 uses reserved attributes such as ID and Parent to represent the gene → transcript → exon hierarchy more explicitly. GTF usually groups features belonging to the same gene or transcript through repeated gene_id and transcript_id values on each line.

Tools expect different formats. Even tools such as featureCounts that support multiple annotation formats need explicit instructions for which feature to count (-t) and which attribute to group by (-g).

Human-genome analyses mainly use these annotations.

SourceCharacteristics
GENCODEHigh-quality annotation used very widely for human and mouse RNA-seq
EnsemblSupports many species and matches Ensembl gene and transcript IDs well
RefSeqNCBI-based annotation, common in clinical and legacy pipelines

The important requirement is that the FASTA genome and GTF annotation use the same build.

Good: GRCh38 genome FASTA + GRCh38 GTF
Dangerous: GRCh37 genome FASTA + GRCh38 GTF

If the genome FASTA uses chr1 but the GTF uses 1, a tool may not recognize them as the same chromosome.

FASTA: >chr1
GTF: 1 HAVANA exon ...

This can produce nearly zero counts or warnings while building an index. Always check whether the chr prefix is present.

Even within GRCh38, gene models can differ among annotation versions such as GENCODE v39, v44, and v46. Record the version with the results for reproducibility.

genome: GRCh38
annotation: GENCODE v46

GENCODE and Ensembl continue to update, so saying only “we used GRCh38” is insufficient. Where possible, record genome build, annotation source, and release number together in papers, notebooks, and result tables.

Ensembl IDs can include a version.

ENSG00000141510.18

Other databases often store the same ID without the suffix, as ENSG00000141510. When joining external data, decide whether to retain or remove version suffixes such as .18.

gene_name is easy for people to read but weak as an analytical key.

  • Historical names can change
  • The same symbol can appear at multiple locations
  • Duplicates become more likely when pseudogenes and lncRNAs are included

A safer pattern is to key internal analysis tables by gene_id and attach gene_name only at the final interpretation stage.

This example shows one gene with one transcript and two exons.

chr1 source gene 1000 5000 . + . gene_id "GENE1"; gene_name "ABC1";
chr1 source transcript 1000 5000 . + . gene_id "GENE1"; transcript_id "TX1";
chr1 source exon 1000 1200 . + . gene_id "GENE1"; transcript_id "TX1"; exon_number "1";
chr1 source exon 3000 5000 . + . gene_id "GENE1"; transcript_id "TX1"; exon_number "2";

When counting against this GTF, reads that overlap exon 1 or exon 2 are added to the count for GENE1.

GTF is a "gene map on a genome."
RNA-seq uses it to assign BAM reads to genes and exons.
Coordinates are 1-based inclusive; key attributes are gene_id and transcript_id.
The genome FASTA and GTF must use the same build and chromosome names.

See the Data Formats Reference and Turning Raw Counts into Comparable Values for related material.