def testConvertRegionOverlap(self):
        ngsutils.bam.convertregion.bam_convertregion(infname, outfname, chromsizes, enforce_overlap=True, quiet=True)
        foundA = False
        foundB = False
        foundC = False
        foundZ = False

        bam = ngsutils.bam.bam_open(outfname)
        for read in ngsutils.bam.bam_iter(bam):
            if read.qname == 'A':
                foundA = True
            elif read.qname == 'B':
                self.assertEqual(bam.getrname(read.tid), 'chr1')
                self.assertEqual(read.pos, 174)
                self.assertEqual(read.cigar, ngsutils.bam.cigar_fromstr('26M100N24M'))
                foundB = True
            elif read.qname == 'C':
                foundC = True
            elif read.qname == 'Z':
                foundZ = True

        self.assertFalse(foundA)
        self.assertTrue(foundB)
        self.assertFalse(foundC)
        self.assertFalse(foundZ)
Convert region/junction coordinates, require overlap with junction
dataset/ETHPy150Open ngsutils/ngsutils/ngsutils/bam/t/test_convertregion.py/ConvertRegionTest.testConvertRegionOverlap