Data management of plink format

plink 1.9 manul

取出某一些位点

1
plink-1.9/plink --bfile input --extract postions.in --make-bed --out 03.array.v2.overlap;

合并两个文件

1
2
3
4
5
6
# 先转换成vcf格式
plink-1.9/plink --bfile 04.array --recode vcf --out 05.array
plink-1.9/plink --bfile 04.seq --recode vcf --out 05.seq
# 合并
samtools/bcftools/bcftools merge --merge all --no-version --threads 10 05.array.vcf.gz 05.seq.vcf.gz |bgzip -c > 06.merge.vcf.gz
tabix -p vcf 06.merge.vcf.gz

1234编码转换成ACGT编码

1
2
3
# allele1234 to alleleACGT
plink-1.9/plink --file data --recode --alleleACGT multichar --out data.plink
# 反过来用 --allele1234

设染色体

1
2
3
4
5
6
7
--chr-set 90
--cow
--dog
--horse
--mouse
--rice
--sheep

–cow = –chr-set 29 no-xy
–dog = –chr-set 38
–horse = –chr-set 31 no-xy no-mt
–mouse = –chr-set 19 no-xy no-mt
–rice5 = –chr-set -12
–sheep = –chr-set 26 no-xy no-mt
–autosome-num [value] = –chr-set [value] no-y no-xy no-mt