test_simulator.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:clrsvsim 作者: color 项目源码 文件源码
def test_make_split_read_bam_file(self):
        sorted_bam = path.join(TEST_DATA_DIR, 'sorted.bam')
        with pysam.Samfile(sorted_bam, 'rb') as samfile:
            for read in samfile:
                if not read.cigarstring:
                    continue

                for breakpoint in (10, 50, 100):
                    if breakpoint >= read.rlen:
                        continue

                    for is_left_split in (True, False):
                        split_read = make_split_read(read, breakpoint, is_left_split)
                        cigar_items = list(Cigar(split_read.cigarstring).items())
                        clipped_item = cigar_items[0] if is_left_split else cigar_items[-1]
                        min_clip_len = breakpoint if is_left_split else read.rlen - breakpoint  # Can be longer if adjacent to another clip.
                        self.assertGreaterEqual(clipped_item[0], min_clip_len)
                        self.assertIn(clipped_item[1], ('S', 'H'))  # Will be soft-clipped unless already hard-clipped.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号