对 SNP 进行 LD 过滤
vcf=all.vcfplink \--vcf ${vcf} \--geno 0.1 \--maf 0.01 \--biallelic-only strict \--out all.missing_maf \--recode vcf-iid \--allow-extra-chr \--set-missing-var-ids @:# \--keep-allele-ordervcftools \--vcf ${vcf} \--maf 0.01 \--max-missing 0.9 \--min-alleles 2 \--max-alleles 2 \--recode \--recode-INFO-all \--out all.missing_mafplink \--vcf all.missing_maf.vcf \--extract tmp.ld.prune.in \--out all.LDfilter \--recode vcf-iid \--keep-allele-order \--allow-extra-chr \--set-missing-var-ids @:#
进化树构建
将过滤后的vcf文件,转换为 phylip 文件,再用多种软件进行建树。
fasttreeiqtreeraxml
NJ 法构树
fasttree
iqtree
raxml-ng
PCA 分析
plink
对过滤后的vcf文件进行分析。
gcta
eigensoft
structure 分析
admixture
structure
CJchen | 群体结构分析 | Pophelper 的“平替版”
plink \--vcf all.LDfilter.vcf \--make-bed \--out all \--allow-extra-chr \--keep-allele-order \--set-missing-var-ids @:#for i in `seq 2 4`doadmixture \--cv \-j2 \all.bed \$i \1> admix.$i.log 2>&1done# seq 2 4 \# | awk '{print "admixture --cv -j2 all.bed "$1" 1>admix."$1".log 2>&1"}' \# > admixture.sh
LDdecay 分析
PopLDdecay \-InVCF ${vcf} \-SubPop pop.SC.table \-MaxDist 500 \-OutStat pop.SC.statPopLDdecay \-InVCF ${vcf} \-SubPop pop.YZR.table \-MaxDist 500 \-OutStat pop.YZR.stat
LDblock 分析
# 提取需要展示区域的 vcf 文件awk '$1~/ˆ#/ || ($1=="1" && $2 > 300000 && $2 < 500000)' all.missing_maf.vcf > chr1_300K-500K.vcf# 使用 plink 计算两两 SNP R^2 值plink \--vcf chr1_300K-500K.vcf \--r2 square \--out chr1_300K-500K.square \--allow-extra-chr# 生成 SNP 坐标表格# 绘制 LD 热图LDBlockShow \
