Biotechnology · Introductory

Genome Browsers

Written by SignalsLab

Early edition: these lessons are being reviewed.

Content

Summary

Genomic data relies on specific coordinate systems and file formats, primarily distinguished by whether they use 0-based or 1-based indexing. Key formats include BED for genomic locations, GFF/GTF for gene annotations, and SAM/BAM for sequence alignments, each with distinct structural requirements and coordinate conventions.

Intuition

Understanding genomic data requires navigating two main challenges: coordinate indexing and file structure. Biologists typically count from 1, while computer scientists often count from 0, leading to 'off-by-one' errors if formats are mixed. For instance, BED files use 0-based starts and 1-based exclusive ends, whereas GFF and SAM use 1-based inclusive coordinates. Additionally, data is stored in various formats depending on the need: BED for simple regions, GFF/GTF for detailed gene annotations, and SAM/BAM for aligning sequencing reads, with BAM offering binary compression and indexing for efficiency.

Derivation

  1. Genomic coordinates are defined by chromosome, start, stop, and strand.
  2. Indexing systems differ: 1-based (biological, start=1) vs. 0-based (CS, start=0).
  3. BED format uses 0-based start and 1-based exclusive end.
  4. GFF/GTF formats use 1-based inclusive start and end.
  5. SAM format uses 1-based POS for alignment positions.
  6. BAM is the binary, indexed version of SAM for efficient access.

Worked example

Problem

A researcher has a feature in a BED file at chromStart=100, chromEnd=200. What is the 1-based inclusive start position if this feature were converted to GFF format?

  1. Identify the BED start position: 100 (0-based).
  2. Convert 0-based start to 1-based by adding 1: 100 + 1 = 101.
  3. The GFF start position is 1-based and inclusive.
  4. Therefore, the corresponding 1-based start position is 101.

Answer 101

Common mistakes

  • Confusing 0-based and 1-based indexing systems, leading to off-by-one errors.
  • Assuming BED end positions are inclusive; they are exclusive.
  • Using SAM text files for large datasets without realizing BAM is more efficient due to indexing.
  • Ignoring strand information (+/-) which is critical for orientation.

Animation

Animation coming soon

The animated version of this lesson is being prepared for the web. In the Signals AI app, lessons are drawn step by step.

Code

This is a text lesson: it has no animation code yet.

ccBYNC© 2026 SignalsLab. Lesson text shared as is under CC BY-NC 4.0.