Skip to content

Instantly share code, notes, and snippets.

@arq5x
Created April 13, 2012 18:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arq5x/2378903 to your computer and use it in GitHub Desktop.
Save arq5x/2378903 to your computer and use it in GitHub Desktop.
VCF->TPED-PLINK-BED
# Create SNPs-only subset of the 1000G callset VCF
$ curl -s http://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/working/20120316_phase1_integrated_release_version2/ALL.chr22.phase1_release_v2.20101123.snps_indels_svs.vcf.gz | \
zcat | \
awk '$0 ~ /^#/ || $0 ~ "VT=SNP"' | \
gzip > ALL.chr22.phase1_release_v2.20101123.snps_indels_svs.snpsonly.vcf.gz
# Use VCFTools to convert to TPED
$ vcftools
VCFtools (v0.1.8)
© Adam Auton 2009
Process Variant Call Format files
For a list of options, please go to:
http://vcftools.sourceforge.net/options.html
Questions, comments, and suggestions should be emailed to:
vcftools-help@lists.sourceforge.net
$ zcat ALL.chr22.phase1_release_v2.20101123.snps_indels_svs.snpsonly.vcf.gz | \
vcftools --vcf /dev/stdin --plink-tped --out 1kg.chr22.try2.snps.only
$ plink --tfile 1kg.chr22.try2.snps.only --make-bed --noweb --out vcftest.tped.plink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment