# Path: dark/utils.py
# def countPrint(mesg, count, len1, len2=None):
#     """
#     Format a message followed by an integer count and a percentage (or
#     two, if the sequence lengths are unequal).
# 
#     @param mesg: a C{str} message.
#     @param count: a numeric value.
#     @param len1: the C{int} length of sequence 1.
#     @param len2: the C{int} length of sequence 2. If C{None}, will
#         default to C{len1}.
#     @return: A C{str} for printing.
#     """
#     def percentage(a, b):
#         """
#         What percent of a is b?
# 
#         @param a: a numeric value.
#         @param b: a numeric value.
#         @return: the C{float} percentage.
#         """
#         return 100.0 * a / b if b else 0.0
# 
#     if count == 0:
#         return '%s: %d' % (mesg, count)
#     else:
#         len2 = len2 or len1
#         if len1 == len2:
#             return '%s: %d/%d (%.2f%%)' % (
#                 mesg, count, len1, percentage(count, len1))
#         else:
#             return ('%s: %d/%d (%.2f%%) of sequence 1, '
#                     '%d/%d (%.2f%%) of sequence 2' % (
#                         mesg,
#                         count, len1, percentage(count, len1),
#                         count, len2, percentage(count, len2)))


from collections import defaultdict
from operator import itemgetter
from dark.utils import countPrint
    from itertools import zip_longest
    from itertools import izip_longest as zip_longest
    from dark.reads import DNAKozakRead
    # to get it via from six.moves import zip_longest according to
    # https://pythonhosted.org/six/index.html?highlight=zip_longest but
    # that doesn't work for me.

# A list of the ambiguous values is given at
# https://en.wikipedia.org/wiki/Nucleic_acid_notation
AMBIGUOUS = {
    'A': {'A'},
    'C': {'C'},
    'G': {'G'},
    'T': {'T'},
    'M': {'A', 'C'},
    'R': {'A', 'G'},
    'W': {'A', 'T'},
    'S': {'G', 'C'},
    'K': {'G', 'T'},
    'Y': {'C', 'T'},
    'V': {'A', 'C', 'G'},
    'H': {'A', 'C', 'T'},
    'D': {'A', 'G', 'T'},
    'B': {'C', 'G', 'T'},
    'N': {'A', 'C', 'G', 'T'},
}

# Make a reverse version of AMBIGUOUS.
BASES_TO_AMBIGUOUS = dict(
    (''.join(sorted(bases)), symbol) for symbol, bases in AMBIGUOUS.items())


def matchToString(dnaMatch, read1, read2, matchAmbiguous=True, indent='',

# Path: dark/utils.py
# def countPrint(mesg, count, len1, len2=None):
#     """
#     Format a message followed by an integer count and a percentage (or
#     two, if the sequence lengths are unequal).
# 
#     @param mesg: a C{str} message.
#     @param count: a numeric value.
#     @param len1: the C{int} length of sequence 1.
#     @param len2: the C{int} length of sequence 2. If C{None}, will
#         default to C{len1}.
#     @return: A C{str} for printing.
#     """
#     def percentage(a, b):
#         """
#         What percent of a is b?
# 
#         @param a: a numeric value.
#         @param b: a numeric value.
#         @return: the C{float} percentage.
#         """
#         return 100.0 * a / b if b else 0.0
# 
#     if count == 0:
#         return '%s: %d' % (mesg, count)
#     else:
#         len2 = len2 or len1
#         if len1 == len2:
#             return '%s: %d/%d (%.2f%%)' % (
#                 mesg, count, len1, percentage(count, len1))
#         else:
#             return ('%s: %d/%d (%.2f%%) of sequence 1, '
#                     '%d/%d (%.2f%%) of sequence 2' % (
#                         mesg,
#                         count, len1, percentage(count, len1),
#                         count, len2, percentage(count, len2)))


# Path: dark/dna.py
from collections import defaultdict
from operator import itemgetter
from dark.utils import countPrint
    from itertools import zip_longest
    from itertools import izip_longest as zip_longest
    from dark.reads import DNAKozakRead

    # to get it via from six.moves import zip_longest according to
    # https://pythonhosted.org/six/index.html?highlight=zip_longest but
    # that doesn't work for me.

# A list of the ambiguous values is given at
# https://en.wikipedia.org/wiki/Nucleic_acid_notation
AMBIGUOUS = {
    'A': {'A'},
    'C': {'C'},
    'G': {'G'},
    'T': {'T'},
    'M': {'A', 'C'},
    'R': {'A', 'G'},
    'W': {'A', 'T'},
    'S': {'G', 'C'},
    'K': {'G', 'T'},
    'Y': {'C', 'T'},
    'V': {'A', 'C', 'G'},
    'H': {'A', 'C', 'T'},
    'D': {'A', 'G', 'T'},
    'B': {'C', 'G', 'T'},
    'N': {'A', 'C', 'G', 'T'},
}

# Make a reverse version of AMBIGUOUS.
BASES_TO_AMBIGUOUS = dict(
    (''.join(sorted(bases)), symbol) for symbol, bases in AMBIGUOUS.items())


def matchToString(dnaMatch, read1, read2, matchAmbiguous=True, indent='',

                  offsets=None, includeGapLocations=True):