Last active
February 6, 2016 21:52
-
-
Save arq5x/1607dce6fd48aa54ff38 to your computer and use it in GitHub Desktop.
Make a BED file of HumVar variants with rsIds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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