Sequence and alignment files tell you what the genome looks like and where reads land. Annotation files tell you what the sequence means: where genes, transcripts, exons and coding regions are. The two formats most widely used for this are GFF3 (General Feature Format version 3) and GTF (Gene Transfer Format). They look similar at first glance, and many tools accept both, but they differ in ways that matter when you convert between them or feed them into a pipeline.
The shared nine-column layout
Both GFF3 and GTF are tab-delimited text files with one feature per line and nine columns:
- seqid: the chromosome or scaffold name.
- source: the program or database that produced the feature.
- type: the feature type, such as gene, mRNA, exon or CDS.
- start: start position, 1-based.
- end: end position, 1-based and inclusive.
- score: a numeric score, or a dot if none.
- strand: plus, minus, or a dot for unstranded features.
- phase: for CDS features, the number of bases (0, 1 or 2) to skip to reach the first complete codon.
- attributes: additional information about the feature.
Because the coordinates are 1-based and closed, converting annotation features to BED requires subtracting one from the start. Lines beginning with a hash symbol are comments or directives.
How GFF3 represents structure
In GFF3, attributes are written as tag=value pairs separated by semicolons. Certain tags have reserved meanings. The most important are ID, which uniquely identifies a feature, and Parent, which links a feature to the feature that contains it. An exon lists its transcript as its parent, and a transcript lists its gene. This creates an explicit hierarchy that can describe genes with many transcripts, as well as other feature types.
GFF3 also defines directives such as a version line and sequence-region lines, and it allows a FASTA section at the end of the file. Feature types are expected to come from the Sequence Ontology, a controlled vocabulary that gives consistent names to biological features.
How GTF represents structure
GTF is closely related to an earlier version of GFF and is focused on gene and transcript models. Its attributes use tag "value"; pairs, with values in quotes and each pair ending in a semicolon. Two attributes are mandatory: gene_id and transcript_id. Instead of explicit parent links, GTF groups features implicitly: all features sharing a transcript_id belong to the same transcript, and all transcripts sharing a gene_id belong to the same gene.
Many GTF files also include attributes such as gene names and biotypes, but these vary by source. GTF is especially common as input for RNA-seq quantification tools, which use transcript and exon definitions to assign reads to genes.
Key differences at a glance
- Attribute syntax: GFF3 uses tag=value; GTF uses tag "value";.
- Hierarchy: GFF3 uses explicit ID and Parent; GTF relies on shared gene_id and transcript_id values.
- Scope: GFF3 can describe many kinds of features; GTF centers on genes and transcripts.
- Ontology: GFF3 expects Sequence Ontology terms; GTF uses a smaller set of conventional feature types.
Converting between the formats
Converting from GFF3 to GTF means translating Parent relationships into repeated gene_id and transcript_id values on every exon and CDS line. Converting from GTF to GFF3 means creating gene and transcript lines with IDs if the GTF lacks them, then linking children with Parent attributes.
Conversion can lose information. Features that do not fit a gene-transcript model, multi-parent relationships, or custom attributes may be dropped or rewritten. After conversion, compare gene and transcript counts with the original and inspect a few complex loci. Our formats overview places these files alongside FASTA, BAM and VCF.
Common pitfalls
- Mismatched sequence names: annotation seqids must match the reference FASTA, including naming style.
- Different builds: an annotation must correspond to the same genome assembly as the alignments.
- Phase errors: incorrect phase values lead to wrong protein translations.
- Duplicate IDs: GFF3 IDs must be unique within a file, except for features split across multiple lines.
- Unescaped characters: reserved characters in GFF3 attribute values must be URL-escaped.
Validators and parsing libraries can catch many of these problems before they cause confusing downstream results.
Key takeaways
- GFF3 and GTF share a nine-column, 1-based layout.
- GFF3 builds hierarchies with ID and Parent; GTF groups by gene_id and transcript_id.
- Conversion is routine but can lose information, so verify the result.
- Annotation, reference and alignments must all use the same build and naming.
Educational and research information only, not medical advice. Genetic results used for health decisions should be interpreted by a qualified healthcare professional; in an emergency call your local emergency number.