Skip to content

Instantly share code, notes, and snippets.

@ryanlayer
Created May 13, 2015 13:49
Show Gist options
  • Select an option

  • Save ryanlayer/4a0a6f90bb04202dd592 to your computer and use it in GitHub Desktop.

Select an option

Save ryanlayer/4a0a6f90bb04202dd592 to your computer and use it in GitHub Desktop.
Genotype Query Tools Fst Statistic
wget --trust-server-names http://bit.ly/gqt_bcf
bcftools index chr11.11q14.3.bcf
gqt convert bcf -i chr11.11q14.3.bcf
wget --trust-server-names http://bit.ly/gqt_ped
head 1kg.phase3.ped
gqt convert ped -i chr11.11q14.3.bcf -p 1kg.phase3.ped
cat 1kg.phase3.ped | grep GBR | head
cat 1kg.phase3.ped | grep GBR | cut -f2 > GBR.txt
cat 1kg.phase3.ped | grep YRI | cut -f2 > YRI.txt
time vcftools \
--bcf chr11.11q14.3.bcf \
--weir-fst-pop GBR.txt \
--weir-fst-pop YRI.txt \
--out GBR_vs_YRI
time gqt fst \
-i chr11.11q14.3.bcf.gqt \
-d 1kg.phase3.ped.db \
-p "Population = 'GBR'" \
-p "Population = 'YRI'" \
> GBR_vs_YRI.gqt.vcf
head GBR_vs_YRI.weir.fst
bcftools annotate \
-x ^INFO/GQT_fst \
GBR_vs_YRI.gqt.vcf \
| grep -v "^##" \
| cut -f1,2,8 \
| sed -e "s/GQT_fst=//" \
> GBR_vs_YRI.gqt.txt
paste GBR_vs_YRI.weir.fst GBR_vs_YRI.gqt.txt | grep -v nan | head
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment