plink 做PCA
conda install plink
plink --vcf F_M_trans.recode.vcf.gz --recode --out testacc --const-fid --allow-extra-chr
--vcf vcf 或者vcf.gz
--recode 输出格式
--out 输入前缀
--const-fid 添加群体信息
--allow-extra-chr 允许非标准染色体编号
plink --allow-extra-chr --file testacc --noweb --make-bed --out testacc
--file .ped + .map 文件前缀
--make-bed 建立一个新的二进制文件
plink --chr-set 29 --threads 2 -bfile 72LD --pca 5 --out 72LD
--threads 线程数
--pca 主成分
data =read.csv("pca-snp.csv", sep=",", header=T, row.names=1)
data
ggplot(data,aes(x=PC1,y=PC2,color=cluster,shape=group))+
geom_point(size=3)+ theme_bw()
library(ggplot2)
ggplot(data,aes(x=PCA1,y=PCA2,color=cluster,shape=group))+
geom_point(size=3)+ theme_bw()