Before you start
- You understand how positions are counted from Genomic coordinates.
- Any term new? The Glossary has it.
Learning objectives
By the end of this lesson you will be able to: explain what a genome build is, name the common human builds (GRCh37/hg19, GRCh38/hg38, T2T-CHM13), understand why a coordinate is meaningless without its build, convert coordinates between builds with liftOver or CrossMap, and spot the chr-prefix naming mismatch.
A reference genome has versions
A reference genome is one agreed-upon sequence that everyone aligns their reads against, so results are comparable. But the reference is improved over time as sequencing gets better and gaps are filled. Each released version is a build (also called an assembly). For human, the two you will meet constantly are GRCh37 (UCSC calls it hg19) and the newer GRCh38 (hg38). The very newest, gapless build is T2T-CHM13 (telomere-to-telomere).
The crucial consequence: when the assembly changes, sequence is added, removed, and shifted, so the same base of DNA gets a different coordinate in each build. A position like chr7:55,249,071 means one thing in hg19 and a different thing in hg38.
1The same gene, different numbers
Consider the gene EGFR. It is the same gene in every build, but its coordinates differ because the surrounding assembly shifted. This is exactly why you must always record which build your coordinates use.
| Build | UCSC name | EGFR start (chr7, approx.) |
|---|---|---|
| GRCh37 | hg19 | chr7:55,086,725 |
| GRCh38 | hg38 | chr7:55,019,017 |
| T2T-CHM13 | chm13v2.0 | different again (newest, gapless) |
2Converting between builds: liftOver and CrossMap
You cannot just subtract a fixed number to go from hg19 to hg38; the offset varies along the genome. Instead you use a chain file, which records how each region maps from one build to the other, together with a tool that applies it. The two common tools are UCSC liftOver and CrossMap.
# UCSC liftOver: input.bed -> hg38, plus an unmapped file for regions that don't lift liftOver input.bed hg19ToHg38.over.chain.gz output.bed unmapped.bed # CrossMap does the same job and also handles BAM, VCF, GFF CrossMap bed hg19ToHg38.over.chain.gz input.bed output.bed
Why some regions do not lift
If a stretch of DNA was rearranged or is missing in the target build, it has no clean mapping, so liftOver drops it into the unmapped file instead of guessing. Always check that file; silently losing features is a common mistake.
3The chr-prefix naming trap
Builds also differ in how chromosomes are named. UCSC writes chr1, chrX; Ensembl writes 1, X with no "chr". The underlying sequence can be identical, but a tool comparing chr1 to 1 finds zero matches because the strings differ. If your overlaps mysteriously come back empty, check the chromosome names first.
# strip the chr prefix to match Ensembl-style names sed 's/^chr//' ucsc_style.bed > ensembl_style.bed # or add it to go the other way sed 's/^/chr/' ensembl_style.bed > ucsc_style.bed
