# Path: dark/cigar.py
# (CINS_STR, CDEL_STR, CMATCH_STR, CEQUAL_STR, CDIFF_STR,
#  CHARD_CLIP_STR) = 'IDM=XH'
# def dna2cigar(s1, s2, concise=False):
# def makeCigar(reference, query, noEdgeInsertions=True):
# def cigarTuplesToOperations(tuples, includeHardClip=True):
# def softClippedOffset(offset, pairs, cigarOperations):
# def insertionOffset(offset, pairs, cigarOperations):


from unittest import TestCase
from pysam import CSOFT_CLIP, CHARD_CLIP, CMATCH, CINS
from dark.cigar import (
    CINS_STR, CDEL_STR, CMATCH_STR, CEQUAL_STR, CDIFF_STR,
    dna2cigar, makeCigar, cigarTuplesToOperations, softClippedOffset,
    insertionOffset)

    def testMatchOneAfter(self):
        """
        Test that a soft-clipped base one site after a non-soft-clipped site
        returns the correct offset.
        """
        self.assertEqual(
            11,
            softClippedOffset(1,
                              ((0, 10), (1, None)),
                              (CMATCH, CSOFT_CLIP)))

    def testMatchTwoAfter(self):
        """
        Test that a soft-clipped base two sites after a non-soft-clipped site
        returns the correct offset.
        """
        self.assertEqual(
            12,
            softClippedOffset(2,
                              ((0, 10), (1, None), (2, None)),
                              (CMATCH, CSOFT_CLIP, CSOFT_CLIP)))

    def testMatchTwoAfterThenHardClips(self):
        """
        Test that a soft-clipped base two sites after a non-soft-clipped site
        returns the correct offset, including when there are also hard clips.
        """
        self.assertEqual(
            12,

# Path: dark/cigar.py
# (CINS_STR, CDEL_STR, CMATCH_STR, CEQUAL_STR, CDIFF_STR,
#  CHARD_CLIP_STR) = 'IDM=XH'
# def dna2cigar(s1, s2, concise=False):
# def makeCigar(reference, query, noEdgeInsertions=True):
# def cigarTuplesToOperations(tuples, includeHardClip=True):
# def softClippedOffset(offset, pairs, cigarOperations):
# def insertionOffset(offset, pairs, cigarOperations):


# Path: test/test_cigar.py
from unittest import TestCase
from pysam import CSOFT_CLIP, CHARD_CLIP, CMATCH, CINS
from dark.cigar import (
    CINS_STR, CDEL_STR, CMATCH_STR, CEQUAL_STR, CDIFF_STR,
    dna2cigar, makeCigar, cigarTuplesToOperations, softClippedOffset,
    insertionOffset)


    def testMatchOneAfter(self):
        """
        Test that a soft-clipped base one site after a non-soft-clipped site
        returns the correct offset.
        """
        self.assertEqual(
            11,
            softClippedOffset(1,
                              ((0, 10), (1, None)),
                              (CMATCH, CSOFT_CLIP)))

    def testMatchTwoAfter(self):
        """
        Test that a soft-clipped base two sites after a non-soft-clipped site
        returns the correct offset.
        """
        self.assertEqual(
            12,
            softClippedOffset(2,
                              ((0, 10), (1, None), (2, None)),
                              (CMATCH, CSOFT_CLIP, CSOFT_CLIP)))

    def testMatchTwoAfterThenHardClips(self):
        """
        Test that a soft-clipped base two sites after a non-soft-clipped site
        returns the correct offset, including when there are also hard clips.
        """
        self.assertEqual(
            12,

            softClippedOffset(