# 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 time
import logging
import pysam
from mitty.benchmarking.alignmentscore import load_qname_sidecar
"""Given a FASTQ (or BAM) and a long-qnames file trancate the qnames to
whatever length we want and push the too-long qnames to the overflow
file. Also convert any old style qnames (not ending in a *) to new style
ones with a proper termination character"""



logger = logging.getLogger(__name__)



# 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/empirical/qnametruncate.py
import time
import logging
import pysam
from mitty.benchmarking.alignmentscore import load_qname_sidecar

"""Given a FASTQ (or BAM) and a long-qnames file trancate the qnames to
whatever length we want and push the too-long qnames to the overflow
file. Also convert any old style qnames (not ending in a *) to new style
ones with a proper termination character"""



logger = logging.getLogger(__name__)



def main(mainfile_in, sidecar_in, mainfile_out, sidecar_out, truncate_to=240, file_type=None):