def compare_phase(slivar_comphet, calls, lookup):
    """Return whether slivar_compet and this variant are on same phase.

    Given current slivar_comphet record and variant calls for current record
    return cis if variants are on same haplotype, trans if on opposite
    haplotypes, and unknown otherwise."""
    sample, gene, chid, chrom, pos, ref, alt = slivar_comphet.split('/')
    ch_PS, ch_GT = lookup[(chrom, pos, ref, alt)][sample]
    # look up the phase set and genotype of this variant
    if not calls[sample].is_phased:
        return 'unknown'
    this_GT = calls[sample].data['GT']
    this_PS = str(calls[sample].data['PS'])
    if ch_PS == this_PS:
        if ch_GT == this_GT:
            return 'cis'
        elif ch_GT != this_GT:
            return 'trans'
    else:
        return 'unknown'