plink 软件中 --reference-allele 参数 用于设定参考等位基因
001、
root@DESKTOP-1N42TVH:/home/test4# ls ## 测试数据 outcome.map outcome.ped root@DESKTOP-1N42TVH:/home/test4# cat outcome.map 1 SNP1 0 55910 1 SNP2 0 85204 1 SNP3 0 122948 1 SNP4 0 203750 1 SNP5 0 312707 1 SNP6 0 356863 1 SNP7 0 400518 1 SNP8 0 487423 root@DESKTOP-1N42TVH:/home/test4# cat outcome.ped DOR 1 0 0 0 -9 C G C C T T G G A G A A G G G C DOR 2 0 0 0 -9 C C G C G G G G G G A A A G C C DOR 3 0 0 0 -9 G G C C G G G G A A A A A G G C DOR 4 0 0 0 -9 G G C C T G T G G G A A G G G G DOR 5 0 0 0 -9 G G C C G G T G G G A A A G G C DOR 6 0 0 0 -9 G G C C G G G G G G A A A A C C root@DESKTOP-1N42TVH:/home/test4# plink --file outcome --make-bed --out test &> /dev/null ## 转二进制 root@DESKTOP-1N42TVH:/home/test4# ls outcome.map outcome.ped test.bed test.bim test.fam test.log test.nosex root@DESKTOP-1N42TVH:/home/test4# cat test.bim 1 SNP1 0 55910 C G 1 SNP2 0 85204 G C 1 SNP3 0 122948 T G 1 SNP4 0 203750 T G 1 SNP5 0 312707 A G 1 SNP6 0 356863 0 A 1 SNP7 0 400518 A G 1 SNP8 0 487423 G C root@DESKTOP-1N42TVH:/home/test4# awk '{OFS = "\t"; print $2, $5}' test.bim | sed -e '1 s/.$/G/' -e '2 s/.$/C/' > a.txt root@DESKTOP-1N42TVH:/home/test4# cat a.txt ## 生成--reference-allele 参数需要文件,修改了前两个SNP的reference alleles SNP1 G SNP2 C SNP3 T SNP4 T SNP5 A SNP6 0 SNP7 A SNP8 G
002、测试命令
root@DESKTOP-1N42TVH:/home/test4# ls a.txt outcome.map outcome.ped test.bed test.bim test.fam test.log test.nosex root@DESKTOP-1N42TVH:/home/test4# plink --bfile test --reference-allele a.txt --make-bed --recode tab --out result &> /dev/null root@DESKTOP-1N42TVH:/home/test4# ls a.txt outcome.ped result.bim result.log result.nosex test.bed test.fam test.nosex outcome.map result.bed result.fam result.map result.ped test.bim test.log root@DESKTOP-1N42TVH:/home/test4# cat test.bim ## 原始reference allele 1 SNP1 0 55910 C G 1 SNP2 0 85204 G C 1 SNP3 0 122948 T G 1 SNP4 0 203750 T G 1 SNP5 0 312707 A G 1 SNP6 0 356863 0 A 1 SNP7 0 400518 A G 1 SNP8 0 487423 G C root@DESKTOP-1N42TVH:/home/test4# cat a.txt ## 计划改变为的reference allele,改变SNP1、SNP2 SNP1 G SNP2 C SNP3 T SNP4 T SNP5 A SNP6 0 SNP7 A SNP8 G root@DESKTOP-1N42TVH:/home/test4# cat result.bim ## 修改结果 1 SNP1 0 55910 G C 1 SNP2 0 85204 C G 1 SNP3 0 122948 T G 1 SNP4 0 203750 T G 1 SNP5 0 312707 A G 1 SNP6 0 356863 0 A 1 SNP7 0 400518 A G 1 SNP8 0 487423 G C root@DESKTOP-1N42TVH:/home/test4# cat outcome.ped ## 对比命令前后ped文件 DOR 1 0 0 0 -9 C G C C T T G G A G A A G G G C DOR 2 0 0 0 -9 C C G C G G G G G G A A A G C C DOR 3 0 0 0 -9 G G C C G G G G A A A A A G G C DOR 4 0 0 0 -9 G G C C T G T G G G A A G G G G DOR 5 0 0 0 -9 G G C C G G T G G G A A A G G C DOR 6 0 0 0 -9 G G C C G G G G G G A A A A C C root@DESKTOP-1N42TVH:/home/test4# cat result.ped DOR 1 0 0 0 -9 G C C C T T G G A G A A G G G C DOR 2 0 0 0 -9 C C C G G G G G G G A A A G C C DOR 3 0 0 0 -9 G G C C G G G G A A A A A G G C DOR 4 0 0 0 -9 G G C C T G T G G G A A G G G G DOR 5 0 0 0 -9 G G C C G G T G G G A A A G G C DOR 6 0 0 0 -9 G G C C G G G G G G A A A A C C