Skip to content
/file-formats/gtf-gff

GTF/GFF

Tab-delimited, nine-column text formats that map named features (genes, transcripts, exons, CDS) onto coordinates in a reference genome.

GTF and GFF are plain-text, tab-separated annotation formats: nine columns per line, one line per genomic feature, describing what sits where on a reference genome. A FASTA file gives you the letters. A GTF or GFF3 file tells you which stretches of those letters are called ENSG00000141510, where its exons start and stop, and which strand it reads on.

How it works

The nine columns are fixed: seqname, source, feature, start, end, score, strand, frame, attribute. Coordinates are 1-based and inclusive on both ends, which differs from BED (0-based, half-open). Off-by-one errors between the two are the single most common annotation bug.

The formats diverge in column 9. GFF3 uses key=value;key=value with reserved keys ID and Parent, and builds hierarchy through explicit parent-child links: a gene has an ID, an mRNA names that gene as Parent, and each exon names the mRNA. GTF (GFF version 2.2, sometimes called GTF2.2) uses key "value"; with a space separator and encodes hierarchy implicitly through the required gene_id and transcript_id attributes. GTF also constrains the feature vocabulary: CDS, start_codon, stop_codon, exon, 5UTR, 3UTR, gene, transcript.

Practical consequence: GFF3 can represent arbitrary nesting (operons, polycistronic transcripts, splice-variant graphs), and GTF cannot. GTF is easier for tools to parse because you can group by transcript_id in one pass without resolving a parent graph. Most RNA-seq quantifiers want GTF. Most genome-annotation pipelines and downstream feature-extraction tools emit GFF3 1.

In your own data

If you have whole-genome and RNA sequencing, you almost certainly have a GTF sitting in a reference bundle: gencode.v44.annotation.gtf.gz or Homo_sapiens.GRCh38.110.gtf.gz. Open it the same way you’d open any large text file.

zcat gencode.v44.annotation.gtf.gz | head -20
zcat gencode.v44.annotation.gtf.gz | awk '$3=="gene"' | wc -l

Do not load it into Excel. It is ~1.5 GB uncompressed with roughly 3 million lines, and Excel will convert gene symbols like SEPT7 and MARCH1 into dates.

Four things to check before you trust any count matrix built against it:

Chromosome naming. GENCODE and UCSC use chr1. Ensembl uses 1. If your BAM header says chr1 and your GTF says 1, featureCounts returns zero for every gene and exits successfully. Compare directly:

samtools view -H sample.bam | grep '^@SQ' | cut -f2 | head -3
zcat annotation.gtf.gz | grep -v '^#' | cut -f1 | uniq | head -3

Assembly version. GRCh37 and GRCh38 coordinates differ by megabases in places. An annotation built on one and a BAM aligned to the other produces plausible-looking garbage.

Sorting and indexing. For interval queries, sort by coordinate, then compress with bgzip and index with tabix:

(zcat in.gtf.gz | grep '^#'; zcat in.gtf.gz | grep -v '^#' | sort -k1,1 -k4,4n) \
  | bgzip > sorted.gtf.gz
tabix -p gff sorted.gtf.gz
tabix sorted.gtf.gz chr17:7668000-7688000

gzip alone will not work with tabix. It needs the block-compressed bgzip variant.

Feature choice. featureCounts -t exon -g gene_id counts reads overlapping exons and groups by gene. Switch -g to transcript_id and you get transcript-level counts that overlapping isoforms will make meaningless without an EM-based quantifier like salmon or rsem. For a GTF-to-transcriptome FASTA, use gffread -w transcripts.fa -g genome.fa annotation.gtf, which is also the fastest way to convert GFF3 to GTF (gffread in.gff3 -T -o out.gtf).

For non-human work, the same tooling applies. Published genome projects distribute their annotation as GFF3 alongside the assembly FASTA and repeat masks 2, and packages exist specifically to pull feature sequences out of a GFF plus genome pair 3.

Limitations

An annotation file is a hypothesis about a genome, not a measurement of it. Versions disagree: GENCODE v19 and v44 differ in gene count, in transcript boundaries, and in which genes are called protein-coding. A differential-expression result computed on one and re-run on the other can shift. Record the exact annotation version in your analysis metadata and never mix versions across samples in one comparison.

Neither format carries sequence. It is coordinates plus labels, useless without the matching FASTA.

GFF3’s flexibility is also its weakness. Attribute keys beyond the reserved set are unconstrained, so Note, product, gene_name, and Name all appear across sources with different meanings, and downstream extraction tools have to guess 1. Annotations for non-model organisms are usually automated predictions rather than curated calls, and studies that mine them for gene families work from those predictions 4. Treat gene-family counts derived from a fresh annotation as provisional.

Finally: a gene model tells you nothing about whether a variant inside it matters. Interpretation of any specific variant in your genome belongs with a clinical geneticist.

Woolf Software builds longitudinal molecular profiles of individuals: whole-genome sequencing, RNA sequencing, proteomics, blood biomarkers, and continuous glucose data, integrated into one model of you. Build your profile.

Computational Angle

Every RNA-seq count, every variant consequence call, and every 'this SNP is in gene X' statement in your own data traces back to one specific annotation file and one specific version of it.

Related Terms

References

  1. Achal Rastogi, Dinesh Gupta. GFF-Ex: a genome feature extraction package . BMC Research Notes, 2014. DOI
  2. Alba Marino, Eliette L. Reboud, Emmanuelle Chevalier, et al.. Supporting files generated during the genome project of Baronia brevicornis from "The genome of the short-horned baronia (Baronia brevicornis), an endangered relict and key lineage in swallowtail butterfly evolution" . Figshare, 2023. DOI
  3. Salvatore Camiolo, Andrea Porceddu. gff2sequence, a new user friendly tool for the generation of genomic sequences . BioData Mining, 2013. DOI
  4. Li Xiaojing, Yan Zhen, Yang Ling. Genome-wide identification and expression analysis of apple PME family during the course of fruit development . DOAJ (DOAJ: Directory of Open Access Journals), 2026. DOI