def genotype_pl_index(gt=None):
    """
        In presence of the GT field the same
        ploidy is expected and the canonical order is used; without GT field, diploidy is assumed.  If A is the allele in
        REF and B,C,...  are the alleles as ordered in ALT, the ordering of genotypes for the likelihoods is given by:
        
        F(j/k) = (k*(k+1)/2)+j 
    """
    _a = gt.replace('|', '/').split('/')
    if len(_a) == 2:
        a1, a2 = int(_a[0]), int(_a[1])
        t = a1
        if a2 < a1:
            a1, a2 = a2, t
        return int(a2 * (a2 + 1) / 2.0 + a1)
    else:
        return -1
