# Path: mitty/lib/evcfparse.py
# def parse_line(v):
#   """Given a variant (line) from the VCF categorize it as a TP, FP, FN or GT
# 
#   :param v:
#   :return:   (category,
#               size)
#   """
#   t, q = v.samples['TRUTH'], v.samples['QUERY']
#   cat = cat_dict.get(t['BD'] + q['BD'], None)
#   if cat is not None and cat is not 'skip':
#     alt = alt_dict[cat](t, q)
#     sz = len(alt) - len(v.ref)
#   else:
#     alt, sz = None, None
# 
#   return cat, sz, alt


import time
import numpy as np
import pysam
import logging
from mitty.lib.evcfparse import parse_line
"""Takes the variants from two eVCF files and tracks the fate of each variant's category
between the two files."""



logger = logging.getLogger(__name__)


def gt_str(s):
  return '{}{}{}'.format(s['GT'][0], '|' if s.phased else '/', s['GT'][1])


def partition_list():
  return [
    'FN->TP',
    'FN->GT',
    'GT->TP',
    'FP->N',

# Path: mitty/lib/evcfparse.py
# def parse_line(v):
#   """Given a variant (line) from the VCF categorize it as a TP, FP, FN or GT
# 
#   :param v:
#   :return:   (category,
#               size)
#   """
#   t, q = v.samples['TRUTH'], v.samples['QUERY']
#   cat = cat_dict.get(t['BD'] + q['BD'], None)
#   if cat is not None and cat is not 'skip':
#     alt = alt_dict[cat](t, q)
#     sz = len(alt) - len(v.ref)
#   else:
#     alt, sz = None, None
# 
#   return cat, sz, alt


# Path: mitty/benchmarking/callfate.py
import time
import numpy as np
import pysam
import logging
from mitty.lib.evcfparse import parse_line

"""Takes the variants from two eVCF files and tracks the fate of each variant's category
between the two files."""



logger = logging.getLogger(__name__)


def gt_str(s):
  return '{}{}{}'.format(s['GT'][0], '|' if s.phased else '/', s['GT'][1])


def partition_list():
  return [
    'FN->TP',
    'FN->GT',
    'GT->TP',
    'FP->N',

    'TP->TP',