Skip to content

Instantly share code, notes, and snippets.

@arq5x
Last active February 6, 2016 21:52
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 arq5x/1607dce6fd48aa54ff38 to your computer and use it in GitHub Desktop.
Save arq5x/1607dce6fd48aa54ff38 to your computer and use it in GitHub Desktop.
Make a BED file of HumVar variants with rsIds
# get HumVar
wget ftp://genetics.bwh.harvard.edu/pph2/training/humvar-2011_12.predictions.tar.gz
tar -zxvf humvar-2011_12.predictions.tar.gz
# get db snp
wget http://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/snp138.txt.gz
gunzip snp138.txt.gz
# get the deleterious SNPs
grep snp138.txt -wFf <(grep rs humvar-2011_12.deleterious.pph.output | cut -f 5) \
| cut -f 2-5 \
| awk '{print $0"\tdeleterious"}' > humvar.deleterious.bed
# get the neutral SNPs
grep snp138.txt -wFf <(grep rs humvar-2011_12.neutral.pph.output | cut -f 5) \
| cut -f 2-5 \
| awk '{print $0"\tneutral"}' > humvar.neutral.bed
# combine the two
(echo -e "chr\tstart\tend\trsid\tclass"; sort -k1,1 -k2,2n humvar.neutral.bed humvar.deleterious.bed) > humvar.both.bed
head humvar.both.bed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment