对 SNP 进行 LD 过滤

  1. vcf=all.vcf
  2. plink \
  3. --vcf ${vcf} \
  4. --geno 0.1 \
  5. --maf 0.01 \
  6. --biallelic-only strict \
  7. --out all.missing_maf \
  8. --recode vcf-iid \
  9. --allow-extra-chr \
  10. --set-missing-var-ids @:# \
  11. --keep-allele-order
  12. vcftools \
  13. --vcf ${vcf} \
  14. --maf 0.01 \
  15. --max-missing 0.9 \
  16. --min-alleles 2 \
  17. --max-alleles 2 \
  18. --recode \
  19. --recode-INFO-all \
  20. --out all.missing_maf
  21. plink \
  22. --vcf all.missing_maf.vcf \
  23. --extract tmp.ld.prune.in \
  24. --out all.LDfilter \
  25. --recode vcf-iid \
  26. --keep-allele-order \
  27. --allow-extra-chr \
  28. --set-missing-var-ids @:#

进化树构建

将过滤后的vcf文件,转换为 phylip 文件,再用多种软件进行建树。

  1. fasttree
  2. iqtree
  3. raxml

NJ 法构树

fasttree

iqtree

raxml-ng

PCA 分析

plink

对过滤后的vcf文件进行分析。

gcta

eigensoft

structure 分析

admixture
structure

CJchen | 群体结构分析 | Pophelper 的“平替版”

  1. plink \
  2. --vcf all.LDfilter.vcf \
  3. --make-bed \
  4. --out all \
  5. --allow-extra-chr \
  6. --keep-allele-order \
  7. --set-missing-var-ids @:#
  8. for i in `seq 2 4`
  9. do
  10. admixture \
  11. --cv \
  12. -j2 \
  13. all.bed \
  14. $i \
  15. 1> admix.$i.log 2>&1
  16. done
  17. # seq 2 4 \
  18. # | awk '{print "admixture --cv -j2 all.bed "$1" 1>admix."$1".log 2>&1"}' \
  19. # > admixture.sh

LDdecay 分析

  1. PopLDdecay \
  2. -InVCF ${vcf} \
  3. -SubPop pop.SC.table \
  4. -MaxDist 500 \
  5. -OutStat pop.SC.stat
  6. PopLDdecay \
  7. -InVCF ${vcf} \
  8. -SubPop pop.YZR.table \
  9. -MaxDist 500 \
  10. -OutStat pop.YZR.stat

LDblock 分析

  1. # 提取需要展示区域的 vcf 文件
  2. awk '$1~/ˆ#/ || ($1=="1" && $2 > 300000 && $2 < 500000)' all.missing_maf.vcf > chr1_300K-500K.vcf
  3. # 使用 plink 计算两两 SNP R^2 值
  4. plink \
  5. --vcf chr1_300K-500K.vcf \
  6. --r2 square \
  7. --out chr1_300K-500K.square \
  8. --allow-extra-chr
  9. # 生成 SNP 坐标表格
  10. # 绘制 LD 热图
  11. LDBlockShow \

参考