报错详情
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Sample 12 has an inconsistent number of alleles. The first genotype is diploid, but the genotype at position 1:8271179 is haploid
报错查询
根据报错提示定位样本12的1:8271179 SNP
grep "8271179" microbiome.1150.snp_dp3_indv30_maf5.jianhua.rechr.resions27.vcf |cut -f 433
解决方案
替换该位点“.”为“./.”,同时注意到第三列SNPID也是单独的“.”,为此仅替换从SNP列(第十列)之后的单独“.”。转换之后SNP之间大概率会以空格分割,应转为Tab分割,命令行如下:
awk '{for(i = 1; i <= NF; i++) if(i >= 10 && i <= 1160 && $i == ".") {$i = "./."} {print $0}}' test.vcf | tr -s ' ' '\t' > test.useimputation.vcf
运行Beagle填充
java -Xmx102400m -jar beagle.22Jul22.46e.jar gt=test.useimputation.vcf out=test.Imputation