Every genomic data file describes positions on a reference sequence, but not every file counts those positions the same way. Some formats start counting at zero, others at one. Some treat intervals as including both endpoints, others exclude the end. On top of that, positions only make sense relative to a specific reference genome build. Mixing these conventions is one of the most common sources of subtle, hard-to-spot errors in bioinformatics.

Two ways to count

A 1-based, fully closed system numbers the first base of a sequence as 1, and an interval includes both its start and end. The interval 1 to 3 covers the first three bases. This matches how biologists usually describe positions in text.

A 0-based, half-open system numbers the first base as 0, and an interval includes its start but not its end. The interval 0 to 3 covers the same first three bases. This convention is common in programming because the length of an interval is simply end minus start, and adjacent intervals share a boundary without overlapping.

A helpful way to picture the 0-based half-open system is to number the gaps between bases rather than the bases themselves. Position 0 is the boundary before the first base, and position 3 is the boundary after the third.

Which formats use which

  • BED: 0-based start, half-open interval.
  • VCF: 1-based positions.
  • GFF3 and GTF: 1-based, closed intervals.
  • SAM: 1-based POS field (BAM stores it internally as 0-based, but tools present it as 1-based).
  • Wiggle and bedGraph: bedGraph uses 0-based coordinates like BED; Wiggle uses 1-based.

Programming libraries and genome browsers can add another layer: a browser may display 1-based coordinates while its underlying files or APIs use 0-based ones. When in doubt, check the documentation for the specific tool.

Converting between systems

For an interval, converting from 1-based closed to 0-based half-open means subtracting one from the start and leaving the end unchanged. Converting back means adding one to the start. A single base at 1-based position 100 becomes the BED interval 99 to 100.

Insertions and deletions need extra care. VCF represents an indel using an anchor base, so the reported position refers to the base before the event. Converting such records to intervals requires deciding whether the interval should cover the anchor base or only the affected bases. Our introduction to format conversion covers the broader workflow.

Reference genome builds

Coordinates are meaningful only relative to a particular assembly of a genome. Reference assemblies are periodically updated to fill gaps, correct errors and add alternative sequences. When this happens, the same gene or variant can end up at a different numeric position. For the human genome, the two builds most often encountered are GRCh37 (also called hg19) and GRCh38 (hg38), and newer complete assemblies are increasingly used as well.

Comparing positions from files aligned to different builds produces nonsense: variants appear in the wrong genes, and intervals fail to overlap when they should. Always record which build a dataset uses, and check that all inputs to an analysis share it.

Chromosome naming conventions

Even within one build, files can name sequences differently. One source may call a chromosome "chr1" while another uses "1"; the mitochondrial genome may appear as "chrM" or "MT". Tools often silently skip records whose sequence names do not match the reference, which can lead to missing data rather than an obvious error. Harmonizing names before combining files is a simple safeguard.

Moving data between builds

Converting coordinates from one build to another is called liftover. It relies on a mapping file that describes how regions of one assembly correspond to the other. Liftover works well for most of the genome, but some regions cannot be mapped cleanly because they were rearranged, duplicated, or added in the newer build. Those records may fail to convert or map to an unexpected location, so check the unmapped output. For variant data, the reference allele may also differ between builds and needs to be verified after conversion.

A checklist for avoiding coordinate errors

  • Confirm the coordinate convention of every input format.
  • Record and verify the reference build for every file.
  • Harmonize chromosome names before merging datasets.
  • Spot-check a few known positions in a genome browser after any conversion.
  • Review records that fail liftover rather than discarding them silently.

Key takeaways

BED counts from zero with half-open intervals, while VCF, GFF and SAM count from one. Coordinates belong to a specific reference build, and mixing builds or naming schemes causes silent errors. A little care at the start of an analysis prevents off-by-one mistakes from propagating through every downstream result. Definitions of related terms are available in the glossary.

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.

About Geneconvert

Independent educational articles on genomic file formats, bioinformatics and gene conversion. Learn more.

Newsletter