image.png

    1. # for SNP
    2. START = END = POS
    3. REF = REF
    4. ALT = ALT
    5. # for INS
    6. START = END = POS
    7. REF = '-'
    8. ALT = ALT[1:]
    9. # for DEL
    10. START = POS + 1
    11. END = POS + len(REF) - 1
    12. REF = REF[1:]
    13. ALT = '-'

    PS:多个样本的VCF转换时需要添加参数 --allsample --withfreq 频率会根据GT重新计算 AF = AC / AN AC: 突变的Allele数,0/1记为1, 1/1记为2 AN:发生突变的Allele数,./.记为0,0/0,0/1,1/1均记为2(即除了./.的样本数的2倍)