# 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 testOneOfTwo(self):
        """
        Test one tuple with one operation of length two.
        """
        self.assertEqual([CINS, CINS],
                         list(cigarTuplesToOperations([(CINS, 2)])))

    def testTwo(self):
        """
        Test two tuples.
        """
        self.assertEqual(
            [CINS, CINS, CMATCH, CMATCH, CMATCH],
            list(cigarTuplesToOperations([(CINS, 2), (CMATCH, 3)])))

    def testHardClippingIncluded(self):
        """
        Hard clipping operations should be included.
        """
        self.assertEqual(
            [CHARD_CLIP, CHARD_CLIP, CINS, CINS, CMATCH, CMATCH, CMATCH],
            list(cigarTuplesToOperations(
                [(CHARD_CLIP, 2), (CINS, 2), (CMATCH, 3)])))

    def testSkipHardClipping(self):
        """
        It must be possible to have hard clipping operations skipped.
        """
        self.assertEqual(
            [CINS, CINS, CMATCH, CMATCH, CMATCH],

# 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 testOneOfTwo(self):
        """
        Test one tuple with one operation of length two.
        """
        self.assertEqual([CINS, CINS],
                         list(cigarTuplesToOperations([(CINS, 2)])))

    def testTwo(self):
        """
        Test two tuples.
        """
        self.assertEqual(
            [CINS, CINS, CMATCH, CMATCH, CMATCH],
            list(cigarTuplesToOperations([(CINS, 2), (CMATCH, 3)])))

    def testHardClippingIncluded(self):
        """
        Hard clipping operations should be included.
        """
        self.assertEqual(
            [CHARD_CLIP, CHARD_CLIP, CINS, CINS, CMATCH, CMATCH, CMATCH],
            list(cigarTuplesToOperations(
                [(CHARD_CLIP, 2), (CINS, 2), (CMATCH, 3)])))

    def testSkipHardClipping(self):
        """
        It must be possible to have hard clipping operations skipped.
        """
        self.assertEqual(
            [CINS, CINS, CMATCH, CMATCH, CMATCH],

            list(cigarTuplesToOperations(