# Path: mitty/benchmarking/alignmentscore.py
# def is_simple_case(cigar1, cigar2):
# def find_first_common_reference_matching_base_positions(r1, r2):
# def score_alignment_error(r, ri, max_d=200, strict=False):
# def correct_tlen(ri1, ri2, r):
# def tag_alignment(r, ri, max_d=200, strict=False):


import tempfile
import logging
import cytoolz
import numpy as np
import pysam
import pandas as pd
import xarray as xr
from collections import OrderedDict, Counter
from mitty.benchmarking.alignmentscore import score_alignment_error, correct_tlen, load_qname_sidecar, parse_qname
"""
Supplies primitives for streaming (filter based) analysis of BAMs produced from simulated data.
"""




logger = logging.getLogger(__name__)


@cytoolz.curry
def parse_read_qnames(sidecar_fname, titer):
  """Mutates dictionary: adds 'read_info' field to it.

  :param titer:
  :return:
  """

# Path: mitty/benchmarking/alignmentscore.py
# def is_simple_case(cigar1, cigar2):
# def find_first_common_reference_matching_base_positions(r1, r2):
# def score_alignment_error(r, ri, max_d=200, strict=False):
# def correct_tlen(ri1, ri2, r):
# def tag_alignment(r, ri, max_d=200, strict=False):


# Path: mitty/analysis/bamfilters.py
import tempfile
import logging
import cytoolz
import numpy as np
import pysam
import pandas as pd
import xarray as xr
from collections import OrderedDict, Counter
from mitty.benchmarking.alignmentscore import score_alignment_error, correct_tlen, load_qname_sidecar, parse_qname

"""
Supplies primitives for streaming (filter based) analysis of BAMs produced from simulated data.
"""




logger = logging.getLogger(__name__)


@cytoolz.curry
def parse_read_qnames(sidecar_fname, titer):
  """Mutates dictionary: adds 'read_info' field to it.

  :param titer:
  :return:
  """

  long_qname_table = load_qname_sidecar(sidecar_fname) if sidecar_fname is not None else None