LiftOver

From Genome Analysis Wiki
Revision as of 11:49, 9 August 2011 by Zhanxw (talk | contribs)
Jump to navigationJump to search

LiftOver is a necesary step to bring all genetical analysis to the same reference build. Particularly, our current data are mainly in either NCBI build 36 (UCSC hg 18) or NCBI build 37 (UCSC hg19). Although lift over can be from higher build to lower build, we always recommend lift lower build to higher/current build.

LiftOver is not hard. The easier way is to use UCSC liftOver tool to lift BED format file to BED format file. With additional steps, we can also lift Merlin and PLINK data files.

Besides introducing lift over genomic positions, lifting SNPs is also introduced.

Lift over using BED files

Binary liftOver tool

Download the liftOver binary from UCSC and hg18 to hg 19 chain file

Provide BED format file (input.bed)

NOTE: Use the 'chr' before each chromosome name

chr1    743267  743268  rs3115860
chr1    766408  766409  rs12124819
chr1    773885  773886  rs17160939

Run liftOver:

   liftOver input.bed hg18ToHg19.over.chain.gz output.bed unlifted.bed

unlifted file will contain all genomic positions that cannot be lifted. The reason for that varies. See Various reasons that lift over could fail

Web interface

Alternatively, you can lift over BED file in web interface at: Link Web interface can tell you why some genomic position cannot be lifted if you click "Explain failure messages"

Lift Merlin format

PLINK format and Merlin format are nearly identical. The difference is that Merlin .map file have 4 columns. We will show the lift over procedure for PLINK format, then you can use:

 awk '{print $1,$2,"\t",$3;}' PLINK.map > Merlin.map

to obtain Merlin .map file.

Lift PLINK format

PLINK format usually referrs to .ped and .map files.

We recommend split the jobs in several steps: (1) convert .map to .bed file By rearrange columns of .map file, we obtain a standard BED format file.

(2) liftOver .bed file Use method mentioned above to convert .bed file from one build to another.

(3) convert lifted .bed file back to .map file Rearrange column of .map file to obtain .bed file in the new build.

(4) modify .ped file .ped file have many column files. By convention, the first six columns are family_id, person_id, father_id, mother_id, sex, and phenotype. From the 7th column, there are two letters/digits representing a genotype at the certain marker. In step (2), as some genomic positions cannot be lifted to the new version, we need to drop their corresponding columns from .ped file to keep consistency. You can use PLINK --exclude those snps, see Remove a subset of SNPs.

(5) (optionally) change the rs number in the .map file Similar to the human reference build, dbSNP also have different versions. You may consider change rs number from the old dbSNP version to new dbSNP version depending on your needs Such steps are described in [#Lift dbSNP rs numbers | Lift dbSNP rs numbers].

(6) (optionally) additional method to lift dbSNP postion NCBI dbSNP team has provided a provisional map for converting the genomic position of a larget set dbSNP from NCBI build 36 to NCBI build 37. In the second step, we have obtained unlifted genomic positions, so we can try to use the table to convert those unlfted dbSNPs. After this step, there are still some SNPs that cannot be lifted, and they are mostly located on non-reference chromosome.

Lift dbSNP rs numbers

rs number is release by dbSNP. UCSC also make their own copy from each dbSNP version. Be aware that the same version of dbSNP from these two centers are not the same. When we convert rs number from lower version to higher version, there are practically two ways.

Use RsMergeArch and SNPHistory

In short,

  1. when different rs number are found to refer to the same SNP, then higher rs number will be merged to lower rs number, and the merging will be recorded in RsMergedArch.bcp.gz.
  2. when rs number have to be retracted, rs number will be recorded in SNPHistory.bcp.gz

So we need to combine these two tables to obtain the relationship between older rs number and new rs number. Luckily, we have a script for internal use. See liftRsNumber.py

Various reasons that lift over could fail

Genomic position cannot be lifted

When a SNP resides in a contig that only exists in older reference build, liftOver cannot give it new genomic.

You can try the following SNP (in BED format) in UCSC online liftOver site:

20 56737667 56737668 rs1073519

The error message will be: "Sequence intersects no chains"

SNP in higher build are located in non-referernce assembly

Some SNP are not in autosomes or sex chromosomes in NCBI build 37. dbSNP does not include them. You cannot use dbSNP database to lookup its genomic position by rs number.

Take rs1006094 as an example: In NCBI dbSNP webpage, this SNP is reported as "Mapped unambiguously on non-reference assembly only" Thus it is probably not very useful to lift this SNP.

Cannot find rs number in newer dbSNP build

It is possible that new dbSNP build does not have certain rs numbers. When dbSNp release new build, higher rs number may be merged to lower rs number because of those rs numbers are actually the same SNP. This merge process can be complicate. For short description, see [#Use RsMergeArch and SNPHistory | Use RsMergeArch and SNPHistory]. For detail, see:

Finding Specific Data in dbSNP’s FTP Files

Merging RefSNP Numbers and RefSNP Clusters

For example:

rs3001 has merged to rs2032.

Different dbSNP build

NCBI released dbSNP132 (VCF format), and UCSC also have their version of dbSNP132 (plain txt). The two database files differ not only in file format, but in content.

For NCBI release, its release will not contain:

  • SNPs listed as microsatellites or named variations
  • SNPs with multibyte alleles and unknown (N) adjacent base pairs
  • SNPs that are not mapped on the reference genome (GRCh37)

For UCSC release, see [#Resources | UCSC dbSNP track note]

Use rs1054140 as an example:

NCBI dbSNP website gives 1 location: Link

NCBI dbSNP VCF file has NO record.

UCSC genome browser website gives 2 locations: Link

UCSC dbSNP file give 2 locations:

721     chr10   17842693        17842694        rs1054140       0       +       T       T       A/T     genomic single  by-cluster,by-submitter ...
723     chr10   18089681        18089682        rs1054140       0       +       T       T       A/T     genomic single  by-cluster,by-submitter ...

Resouces

Acknowledge

  • Hyun: provides sample liftOver tool: [/net/wonderland/home/hmkang/prj/Sardinia/MetaboChip/scripts/j01-liftover-metabochip-positions.pl]
  • Alex: careful examines of 0-based index in UCSC data file
  • Adrian: explaination of SNPs omitted in NCBI dbSNP file
  • Goncalo: all other supports

Questions and Comments

Please contact Xiaowei Zhan.