Skip to content

Instantly share code, notes, and snippets.

@ryanlayer
Created April 15, 2015 14:55
Show Gist options
  • Select an option

  • Save ryanlayer/47044e9d17ec5b32fe96 to your computer and use it in GitHub Desktop.

Select an option

Save ryanlayer/47044e9d17ec5b32fe96 to your computer and use it in GitHub Desktop.
GQT Install and Demo
git clone https://github.com/samtools/htslib.git
cd htslib
make
cd ..
wget http://www.sqlite.org/2014/sqlite-amalgamation-3080701.zip
unzip sqlite-amalgamation-3080701.zip
git clone https://github.com/ryanlayer/gqt.git
cd gqt
make
cd test/func
./functional_tests.sh
cd ../../../
wget --trust-server-names http://bit.ly/gqt_bcf
bcftools index chr11.11q14.3.bcf
gqt/bin/gqt convert bcf -i chr11.11q14.3.bcf
bcftools query -l chr11.11q14.3.bcf
gqt/bin/gqt convert ped -i chr11.11q14.3.bcf
gqt/bin/gqt query \
-i chr11.11q14.3.bcf.gqt \
-p "Sample_ID ='NA12878'" \
-g "count(HOM_ALT)==1" \
| less -S
gqt/bin/gqt query \
-i chr11.11q14.3.bcf.gqt \
-p "Sample_ID in ('NA21126','NA21127','NA21128')" \
-g "pct(HET)>0.5" \
-p "Sample_ID ='NA12878'" \
-g "count(HOM_ALT)==1" \
| less -S
gqt/bin/gqt query \
-i chr11.11q14.3.bcf.gqt \
-p "Sample_ID ='NA12878'" \
-g "count(HOM_ALT)==1" \
-c
wget --trust-server-names http://bit.ly/gqt_ped
less -S 1kg.phase3.ped
gqt/bin/gqt convert ped -i chr11.11q14.3.bcf -p 1kg.phase3.ped
gqt/bin/gqt query \
-i chr11.11q14.3.bcf.gqt \
-d 1kg.phase3.ped.db \
-p "Population ='GBR'" \
-g "maf()>0.1" \
-c
gqt/bin/gqt query \
-i chr11.11q14.3.bcf.gqt \
-d 1kg.phase3.ped.db \
-p "Population ='GBR'" \
-g "maf()>0.1" \
-p "Population in ('YRI','LWK','GWD','MSL','ESN','ASW','ACB')" \
-g "maf()<0.01" \
-c
gqt/bin/gqt query \
-i chr11.11q14.3.bcf.gqt \
-d 1kg.phase3.ped.db \
-p "Population ='GBR'" \
-g "maf()>0.1" \
-p "Population in ('YRI','LWK','GWD','MSL','ESN','ASW','ACB')" \
-g "maf()<0.01" \
| bcftools view -H - -i 'DP>20000' \
| wc -l
wget --trust-server-names http://bit.ly/gqt_genes
head genes.bed
gqt/bin/gqt query \
-i chr11.11q14.3.bcf.gqt \
-d 1kg.phase3.ped.db \
-p "Population ='GBR'" \
-g "maf()>0.1" \
-p "Population in ('YRI','LWK','GWD','MSL','ESN','ASW','ACB')" \
-g "maf()<0.01" \
| bcftools view - -i 'DP>20000' \
| bedtools intersect -a genes.bed -b stdin \
> GBR_not_AFR_genes.bed
head GBR_not_AFR_genes.bed
cat GBR_not_AFR_genes.bed | cut -f4 | sort | uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment