-
Notifications
You must be signed in to change notification settings - Fork 0
/
plink
22 lines (21 loc) · 1.49 KB
/
plink
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Plink常用的文件格式有两套:map/ped 和 bim/fam/bed。两组文件均没有列名,且每一列表示的意思是一定的。几种格式之间可以相互转换。推荐使用BED/BIM/FAM这种格式,读取速度快。
#vcf to map/ped
~/software/plink --vcf all.vcf.gz --recode --out testacc_qc --maf 0.01 --geno 0.05 --indep-pairwise 1000 50 0.1 --const-fid --allow-extra-chr --threads 20
#vcf to bim/fam/bed
~/software/plink --allow-extra-chr --file testacc_qc --noweb --make-bed --out testacc_qc --threads 20
#pca
plink --allow-extra-chr --threads 20 -bfile testacc_qc --pca 2 --out testacc_qc
Rscrept pca.R
#ibd
/plink --vcf all.vcf.gz --const-fid --allow-extra-chr --genome --maf 0.01 --geno 0.05 --indep-pairwise 1000 50 0.1 --out IBD_result
Rscrept ibd.R
#tree
plink --file testacc_qc --distance-matrix --recode --out Distance.out --allow-extra-chr
awk '{print $2" "}' 58inds_maf005_geno01_phased.mdist.id | cut -c1-10 > 58inds_maf005_geno01_phased_phylip.id
###合并数据矩阵并添加表头(即物种个数58)
paste -d '' 58inds_maf005_geno01_phased_phylip.id 58inds_maf005_geno01_phased.mdist | sed '1i 58' > 58inds_maf005_geno01_phased_phylip.mdist
neighbor
#tree2
#tree#https://github.com/hewm2008/VCF2Dis/tree/main
/public/home/baoqi/SVanalysis/analysis/VCF2Dis-1.50/bin/VCF2Dis -InPut pop_final.vcf -OutPut pca_dis_all.mat
~/software/PHYLIPNEW-3.69.650/bin/fneighbor -datafile pca_dis_all.mat -outfile tree.out1.txt -matrixtype s -treetype n -outtreefile tree.out2.tre