Skip to content

Instantly share code, notes, and snippets.

@brentp
Created September 21, 2011 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brentp/1232981 to your computer and use it in GitHub Desktop.
Save brentp/1232981 to your computer and use it in GitHub Desktop.
Display a VCF in UCSC

##VCF in UCSC

Note, documentation is now available here: http://genome.ucsc.edu/goldenPath/help/vcf.html

It's possible to display a vcf in the UCSC genome browser

First grab tabix from sourceforge:

svn co https://samtools.svn.sourceforge.net/svnroot/samtools/trunk/tabix
cd tabix && make

Then add that directory to your PATH.

bgzip the vcf and index with tabix

bgzip t.vcf
tabix -p vcf t.vcf.gz

Put t.vcf.gz and t.vcf.gz.tbi in a web directory. Along with a bed file, t.bed with contents:

track type=vcfTabix name="$NAME" visibility=full bigDataUrl="http://example.com/path.to/t.vcf.gz"

Adjusting the paths to match your server.

Note the type is vcfTabix

Finally, point your web-browser to: http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=chr11:1240203-1247497&hgt.customText=http://example.com/path.to/t.bed

and the variant track will be visible.

@AngieHinrichs
Copy link

karmel, I would like to debug the error -- can you post (or email to angie at soe . ucsc . edu) a sample VCF that gets that error? Also, what tool created those VCF files? Thanks!

@karmel
Copy link

karmel commented Nov 18, 2011

Of course as soon as I seek help, I figure out the issue. The gtHapIx error was caused by incorrect AC,AN values in the INFO column; I suspected that was the case early on, and I fixed the file with the vcf-tools fix-ac-an function. However, upon reloading the files, the error persisted. It looks like, though, this was a caching issue, not a processing issue-- after I deleted the track and reloaded from scratch, the issue was fixed. My error. If we want to take something away here, though, perhaps you could add to the error message a helpful, "Make sure your VCF key=value pairs like AC and AN are correct." :) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment