BED, GFF and GTF all describe intervals on a genome, but they use different coordinate conventions and different column meanings. The most common bug in genome analysis is an off-by-one error caused by mixing them.
BED coordinates
BED is a tab-separated format. The first three columns are required:
chrom: chromosome name.start: zero-based start, inclusive.end: zero-based end, exclusive.
A BED interval chr1 100 200 covers bases 101 to 200 in one-based terms. The length is end - start, which is 100. BED can have additional columns for name, score, strand and other features, but tools differ in how many they accept.
BED is common for genome browsers, coverage tracks and interval arithmetic. It is compact and easy to generate. It is also the format most likely to be off by one when converted from a one-based format.
GFF and GTF
GFF3 and GTF are one-based, inclusive formats. They describe features with nine columns:
seqid: chromosome or contig.source: the program or database that made the feature.type: gene, transcript, exon and so on.start: one-based start.end: one-based end, inclusive.score: often..strand:+,-or..phase: for coding features.attributes: key-value pairs.
GTF and GFF3 look similar but differ in their attribute syntax and in some conventions. GTF uses key "value"; pairs. GFF3 uses key=value pairs separated by semicolons. A parser built for one may silently misread the other.
The off-by-one trap
A feature that starts at one-based position 101 and ends at 200 becomes start=100, end=200 in BED. If you write start=101, the interval is shifted by one base. If you write end=201, it is one base too long.
The error is easy to miss because a single base is small compared with a gene. It becomes serious at exon boundaries, splice sites, primer positions and variant annotations. A one-base shift can change a codon, a splice acceptor or a restriction site.
Strand and phase
Strand is not decoration. A gene on the minus strand is read in the reverse direction, and a variant consequence depends on the transcript orientation. Phase in GFF3 and frame in GTF describe where the next codon starts. A wrong phase shifts the translation.
If you convert between formats, preserve strand and phase. If a tool does not use them, say so in the methods. A feature table that loses strand is not equivalent to the original annotation.
Interval arithmetic
Operations such as intersect, subtract, merge and complement depend on the coordinate convention. Mixing a BED file with a GFF file without conversion produces plausible but wrong results.
Convert explicitly and check a few known features. For example, take a gene with a known start and end, convert it, and compare the output with the browser. A five-minute check catches most convention errors.
Names and contigs
Chromosome naming must match. 1 and chr1 are different strings to an interval tool. So are MT and chrM. Check the naming style of the reference, the annotation and the track before combining them.
Contig order also matters for some tools. A BED file sorted by chromosome name may not be sorted by the reference order. Most interval tools do not care, but some viewers and index builders do.
A conversion checklist
Before converting, write down the source convention and the target convention. Then convert one chromosome and check five features: a gene start, a gene end, an exon start, an exon end and a minus-strand feature. Compare each with the browser or the original annotation.
If the converted file is used for counting, run a small counting test with known reads. If it is used for variant annotation, check a variant with a known consequence. A conversion that passes these checks is much less likely to hide an off-by-one error.
Choosing a format
Use BED for interval arithmetic, coverage tracks and browser display. Use GFF3 or GTF for gene models with hierarchy, strand and phase. Use the format that the downstream tool expects, and convert with a tested tool rather than by hand.
Keep the original annotation and the converted file. Record the conversion command and the source release. If a feature looks wrong later, the original is the reference.
Common conversions
A GTF to BED conversion must subtract one from the start and keep the end. A BED to GTF conversion must add one to the start. A GFF3 to GTF conversion must translate the attribute syntax, not only the coordinates. GFF3 also allows a feature to be a parent of others through ID and Parent attributes; a naive conversion can lose that hierarchy.
After conversion, check the feature counts by type. If the number of exons changes, the parser probably misread a line or dropped a feature. A conversion that changes the count is a warning, not a rounding error. Also check the total span of a few genes: a one-base shift can survive a count check but change an exon boundary.
Key points
- BED is zero-based, half-open.
- GFF and GTF are one-based, inclusive.
- Convert explicitly and check known features.
- Preserve strand and phase.
- Match chromosome names across all files.
Common mistakes
- Writing a one-based start into a BED file.
- Treating GTF and GFF3 attributes as interchangeable.
- Dropping strand during conversion.
- Mixing
chr1and1in one analysis. - Assuming a BED file has only three columns when a tool expects more.
When to ask for help
If a feature appears shifted, if a variant falls outside an exon it should overlap, or if a conversion produces unexpected lengths, ask before continuing. You can order an analysis or read the reference genome guide. The Genome Analysis studio works with BED, GFF and GTF tracks, and the variant annotation guide explains why coordinates matter.
Sources and further reading
Written by the Solagene team for research and education. Found an error? Tell us and we will correct it.