原文日期: 2017-06-28
来源: https://github.com/wlz0726/wlz0726.github.io
PLINK 数据管理
参考文档
PLINK 1.9 manual: https://www.cog-genomics.org/plink/1.9/
提取特定位点
1 2 3 4
| plink --bfile input \ --extract positions.in \ --make-bed \ --out output
|
合并文件
方法 1: 转 VCF 合并
1 2 3 4 5 6 7 8 9
| plink --bfile file1 --recode vcf --out file1 plink --bfile file2 --recode vcf --out file2
bcftools merge file1.vcf file2.vcf -o merged.vcf
plink --vcf merged.vcf --make-bed --out merged
|
方法 2: PLINK 直接合并
1 2 3 4 5 6
| echo "file1.bed file1.bim file1.fam" > merge.txt echo "file2.bed file2.bim file2.fam" >> merge.txt
plink --bfile file1 --merge-list merge.txt --make-bed --out merged
|
格式转换
1 2 3 4 5 6 7 8
| plink --bfile input --recode vcf --out output
plink --vcf input.vcf --make-bed --out output
plink --bfile input --recode eigenstrat --out output
|
质量控制
1 2 3 4 5 6 7 8
| plink --bfile input --maf 0.05 --make-bed --out output
plink --bfile input --geno 0.1 --make-bed --out output
plink --bfile input --hwe 1e-6 --make-bed --out output
|
此文档为 GitHub 博客自动归档