######1 unzip#######

gunzip KPGP10_G_110915_HiSeq_Caucasian_USA_F.vcf.SNV.gz
gunzip KPGP117_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP11_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf.SNV.gz
gunzip KPGP120_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP121_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP122_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP124_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP125_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP127_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP128_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP129_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP12_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf.SNV.gz
gunzip KPGP131_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP132_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP134_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP136_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP137_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP138_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP139_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP141_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP142_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP144_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP145_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP1_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP2_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP32_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP33_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP3_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP4_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP5_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP6_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP7_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP88_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP89_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV.gz
gunzip KPGP8_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP90_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP91_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP97_G_HiSeq_EastAsian_Kor_M.vcf.SNV.gz
gunzip KPGP9_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV.gz

######2 to vcf#######

mv KPGP10_G_110915_HiSeq_Caucasian_USA_F.vcf.SNV KPGP10_G_110915_HiSeq_Caucasian_USA_F.vcf
mv KPGP117_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP117_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP11_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf.SNV KPGP11_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf
mv KPGP120_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP120_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP121_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP121_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP122_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP122_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP124_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP124_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP125_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP125_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP127_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP127_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP128_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP128_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP129_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP129_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP12_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf.SNV KPGP12_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf
mv KPGP131_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP131_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP132_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP132_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP134_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP134_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP136_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP136_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP137_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP137_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP138_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP138_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP139_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP139_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP141_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP141_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP142_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP142_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP144_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP144_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP145_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP145_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP1_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP1_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP2_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP2_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP32_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP32_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP33_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP33_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP3_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP3_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP4_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP4_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP5_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP5_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP6_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP6_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP7_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP7_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP88_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP88_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP89_G_110915_HiSeq_EastAsian_Kor_F.vcf.SNV KPGP89_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP8_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP8_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP90_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP90_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP91_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP91_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP97_G_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP97_G_HiSeq_EastAsian_Kor_M.vcf
mv KPGP9_G_110915_HiSeq_EastAsian_Kor_M.vcf.SNV KPGP9_G_110915_HiSeq_EastAsian_Kor_M.vcf


######3 uniq #######

uniq KPGP10_G_110915_HiSeq_Caucasian_USA_F.vcf KPGP10_G_110915_HiSeq_Caucasian_USA_F_U.vcf
uniq KPGP117_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP117_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP11_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf KPGP11_G_110915_HiSeq_EastAsian-Caucasian_Kor_M_U.vcf
uniq KPGP120_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP120_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP121_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP121_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP122_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP122_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP124_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP124_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP125_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP125_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP127_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP127_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP128_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP128_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP129_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP129_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP12_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf KPGP12_G_110915_HiSeq_EastAsian-Caucasian_Kor_M_U.vcf
uniq KPGP131_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP131_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP132_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP132_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP134_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP134_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP136_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP136_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP137_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP137_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP138_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP138_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP139_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP139_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP141_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP141_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP142_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP142_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP144_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP144_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP145_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP145_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP1_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP1_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP2_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP2_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP32_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP32_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP33_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP33_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP3_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP3_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP4_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP4_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP5_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP5_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP6_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP6_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP7_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP7_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP88_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP88_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP89_G_110915_HiSeq_EastAsian_Kor_F.vcf KPGP89_G_110915_HiSeq_EastAsian_Kor_F_U.vcf
uniq KPGP8_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP8_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP90_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP90_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP91_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP91_G_110915_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP97_G_HiSeq_EastAsian_Kor_M.vcf KPGP97_G_HiSeq_EastAsian_Kor_M_U.vcf
uniq KPGP9_G_110915_HiSeq_EastAsian_Kor_M.vcf KPGP9_G_110915_HiSeq_EastAsian_Kor_M_U.vcf

######4 mv back #######

mv KPGP10_G_110915_HiSeq_Caucasian_USA_F_U.vcf KPGP10_G_110915_HiSeq_Caucasian_USA_F.vcf
mv KPGP117_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP117_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP11_G_110915_HiSeq_EastAsian-Caucasian_Kor_M_U.vcf KPGP11_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf
mv KPGP120_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP120_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP121_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP121_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP122_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP122_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP124_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP124_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP125_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP125_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP127_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP127_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP128_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP128_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP129_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP129_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP12_G_110915_HiSeq_EastAsian-Caucasian_Kor_M_U.vcf KPGP12_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf
mv KPGP131_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP131_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP132_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP132_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP134_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP134_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP136_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP136_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP137_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP137_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP138_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP138_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP139_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP139_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP141_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP141_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP142_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP142_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP144_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP144_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP145_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP145_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP1_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP1_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP2_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP2_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP32_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP32_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP33_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP33_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP3_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP3_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP4_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP4_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP5_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP5_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP6_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP6_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP7_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP7_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP88_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP88_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP89_G_110915_HiSeq_EastAsian_Kor_F_U.vcf KPGP89_G_110915_HiSeq_EastAsian_Kor_F.vcf
mv KPGP8_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP8_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP90_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP90_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP91_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP91_G_110915_HiSeq_EastAsian_Kor_M.vcf
mv KPGP97_G_HiSeq_EastAsian_Kor_M_U.vcf KPGP97_G_HiSeq_EastAsian_Kor_M.vcf
mv KPGP9_G_110915_HiSeq_EastAsian_Kor_M_U.vcf KPGP9_G_110915_HiSeq_EastAsian_Kor_M.vcf

######5 zip and tabix #######


bgzip KPGP10_G_110915_HiSeq_Caucasian_USA_F.vcf
bgzip KPGP117_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP11_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf
bgzip KPGP120_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP121_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP122_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP124_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP125_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP127_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP128_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP129_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP12_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf
bgzip KPGP131_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP132_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP134_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP136_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP137_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP138_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP139_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP141_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP142_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP144_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP145_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP1_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP2_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP32_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP33_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP3_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP4_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP5_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP6_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP7_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP88_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP89_G_110915_HiSeq_EastAsian_Kor_F.vcf
bgzip KPGP8_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP90_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP91_G_110915_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP97_G_HiSeq_EastAsian_Kor_M.vcf
bgzip KPGP9_G_110915_HiSeq_EastAsian_Kor_M.vcf

tabix -p vcf KPGP10_G_110915_HiSeq_Caucasian_USA_F.vcf.gz
tabix -p vcf KPGP117_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP11_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf.gz
tabix -p vcf KPGP120_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP121_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP122_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP124_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP125_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP127_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP128_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP129_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP12_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf.gz
tabix -p vcf KPGP131_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP132_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP134_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP136_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP137_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP138_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP139_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP141_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP142_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP144_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP145_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP1_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP2_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP32_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP33_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP3_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP4_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP5_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP6_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP7_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP88_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP89_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz
tabix -p vcf KPGP8_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP90_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP91_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP97_G_HiSeq_EastAsian_Kor_M.vcf.gz
tabix -p vcf KPGP9_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz

######6 merge it (vcf-merge rewritten: ID: "." -> "-" and FILTER: "." -> "NN")#######


~/bin/vcf-merge KPGP10_G_110915_HiSeq_Caucasian_USA_F.vcf.gz KPGP117_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP11_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf.gz KPGP120_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP121_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP122_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP124_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP125_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP127_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP128_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP129_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP12_G_110915_HiSeq_EastAsian-Caucasian_Kor_M.vcf.gz KPGP131_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP132_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP134_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP136_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP137_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP138_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP139_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP141_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP142_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP144_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP145_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP1_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP2_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP32_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP33_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP3_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP4_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP5_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP6_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP7_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP88_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP89_G_110915_HiSeq_EastAsian_Kor_F.vcf.gz KPGP8_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP90_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP91_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz KPGP97_G_HiSeq_EastAsian_Kor_M.vcf.gz KPGP9_G_110915_HiSeq_EastAsian_Kor_M.vcf.gz > ../kpgp.vcf

######7 convert it to 1000Genomes type (| instead of / -> but not phased) (GT:GQ:PL replaced by GT:DS:GL but not true)#######

sed -e 's/chr//g' kpgp.vcf > kpgpA1.vcf
sed -e 's/\//|/g' kpgpA1.vcf > kpgpA2.vcf
sed -e 's/GT:GQ:PL/GT:DS:GL/g' kpgpA2.vcf > kpgpA3.vcf
sed -e 's/2|/1|/g' kpgpA3.vcf > kpgpA4.vcf
sed -e 's/|2/|1/g' kpgpA4.vcf > kpgpA5.vcf
sed -e 's/3|/1|/g' kpgpA5.vcf > kpgpA6.vcf
sed -e 's/|3/|1/g' kpgpA6.vcf > kpgpA7.vcf
sed -e 's/\t\./\t0|0:0:0,0,0/g' kpgpA7.vcf > kpgpB.vcf

######8 separate chromosomes#######

head -26l kpgpB.vcf > header
grep -P "^1\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr1.vcf
grep -P "^2\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr2.vcf
grep -P "^3\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr3.vcf
grep -P "^4\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr4.vcf
grep -P "^5\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr5.vcf
grep -P "^6\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr6.vcf
grep -P "^7\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr7.vcf
grep -P "^8\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr8.vcf
grep -P "^9\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr9.vcf
grep -P "^10\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr10.vcf
grep -P "^11\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr11.vcf
grep -P "^12\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr12.vcf
grep -P "^13\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr13.vcf
grep -P "^14\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr14.vcf
grep -P "^15\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr15.vcf
grep -P "^16\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr16.vcf
grep -P "^17\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr17.vcf
grep -P "^18\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr18.vcf
grep -P "^19\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr19.vcf
grep -P "^20\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr20.vcf
grep -P "^21\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr21.vcf
grep -P "^22\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chr22.vcf
grep -P "^X\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chrX.vcf
grep -P "^Y\t" kpgpB.vcf > tmp
cat header tmp > kpgpB_chrY.vcf

######9 zip and tabix it#######

bgzip kpgpB_chr1.vcf
bgzip kpgpB_chr2.vcf
bgzip kpgpB_chr3.vcf
bgzip kpgpB_chr4.vcf
bgzip kpgpB_chr5.vcf
bgzip kpgpB_chr6.vcf
bgzip kpgpB_chr7.vcf
bgzip kpgpB_chr8.vcf
bgzip kpgpB_chr9.vcf
bgzip kpgpB_chr10.vcf
bgzip kpgpB_chr11.vcf
bgzip kpgpB_chr12.vcf
bgzip kpgpB_chr13.vcf
bgzip kpgpB_chr14.vcf
bgzip kpgpB_chr15.vcf
bgzip kpgpB_chr16.vcf
bgzip kpgpB_chr17.vcf
bgzip kpgpB_chr18.vcf
bgzip kpgpB_chr19.vcf
bgzip kpgpB_chr20.vcf
bgzip kpgpB_chr21.vcf
bgzip kpgpB_chr22.vcf
bgzip kpgpB_chrX.vcf
bgzip kpgpB_chrY.vcf


tabix -p vcf kpgpB_chr1.vcf.gz
tabix -p vcf kpgpB_chr2.vcf.gz
tabix -p vcf kpgpB_chr3.vcf.gz
tabix -p vcf kpgpB_chr4.vcf.gz
tabix -p vcf kpgpB_chr5.vcf.gz
tabix -p vcf kpgpB_chr6.vcf.gz
tabix -p vcf kpgpB_chr7.vcf.gz
tabix -p vcf kpgpB_chr8.vcf.gz
tabix -p vcf kpgpB_chr9.vcf.gz
tabix -p vcf kpgpB_chr10.vcf.gz
tabix -p vcf kpgpB_chr11.vcf.gz
tabix -p vcf kpgpB_chr12.vcf.gz
tabix -p vcf kpgpB_chr13.vcf.gz
tabix -p vcf kpgpB_chr14.vcf.gz
tabix -p vcf kpgpB_chr15.vcf.gz
tabix -p vcf kpgpB_chr16.vcf.gz
tabix -p vcf kpgpB_chr17.vcf.gz
tabix -p vcf kpgpB_chr18.vcf.gz
tabix -p vcf kpgpB_chr19.vcf.gz
tabix -p vcf kpgpB_chr20.vcf.gz
tabix -p vcf kpgpB_chr21.vcf.gz
tabix -p vcf kpgpB_chr22.vcf.gz
tabix -p vcf kpgpB_chrX.vcf.gz
tabix -p vcf kpgpB_chrY.vcf.gz


######10 merge with 1000Genomes#######

~/bin/vcf-merge kpgpB_chr1.vcf.gz ALL.chr1.phase1_release_v3.20101123.snps_indels_svs.genotypes.vcf.gz | bgzip -c > kpgp1000_chr1.vcf.gz

######11 unzip and replace "."#######


gunzip kpgp1000_chr1.vcf.gz

sed -e 's/\t\./\t0|0:0:0,0,0/g' kpgp1000_chr1.vcf > KPGP1000_chr1.vcf