How to Create a VCF File From a Chain File

From GenPlay, Einstein Genome Analyzer

Revision as of 14:48, 10 August 2014 by Julien (talk | contribs)
Jump to: navigation, search

Goal: This tutorial illustrates how to generate a VCF file describing the differences between two reference genomes from a Chain file. In this tutorial we will create a hg19 to hg38 VCF file. This means that the reference genome of the VCF file is hg38.

The tutorial is divided in two steps. The first step consist in generating a VCF containing the insertions and the deletions from the Chain file using a program developed in Scala called ChainToVCF.

In the second step we will use GenPlay and a Perl script to add the SNPs to our VCF file.

Prerequisite: You will need to have a Linux or Mac computer.

Scala needs to be installed on you computer. Scala is available to download from

Perl also needs to be installed if it's not already available on your system. Perl can be download from

GenPlay needs to be installed on your computer. If you haven't installed GenPlay yet, please visit the Downloads page and follow the instructions to download and install GenPlay.

Getting started

First, let's download the files needed from the UCSC genome browser. All the file are available from the download page of the UCSC genome browser. We will need the following:

1. hg19 to hg38 chain file (this file can be found in the LiftOver section):

2. hg19 reference file in 2bit format (from the full dataset section):

3. h38 reference file in 2bit format:

Note that the chain file needs to be uncompressed.

Generate a VCF with the insertion and the deletion

We first need to generate a VCF file contain