当前位置: 首页>>代码示例>>Python>>正文


Python TitleAlignments.coverageInfo方法代码示例

本文整理汇总了Python中dark.titles.TitleAlignments.coverageInfo方法的典型用法代码示例。如果您正苦于以下问题:Python TitleAlignments.coverageInfo方法的具体用法?Python TitleAlignments.coverageInfo怎么用?Python TitleAlignments.coverageInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dark.titles.TitleAlignments的用法示例。


在下文中一共展示了TitleAlignments.coverageInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testCoverageInfoNoReads

# 需要导入模块: from dark.titles import TitleAlignments [as 别名]
# 或者: from dark.titles.TitleAlignments import coverageInfo [as 别名]
 def testCoverageInfoNoReads(self):
     """
     When a title has no reads aligned to it, the coverageInfo method
     must return an empty result.
     """
     titleAlignments = TitleAlignments('subject title', 55)
     coverage = titleAlignments.coverageInfo()
     self.assertEqual({}, coverage)
开发者ID:acorg,项目名称:dark-matter,代码行数:10,代码来源:test_titles.py

示例2: testCoverageInfoOneReadWithOneHSP

# 需要导入模块: from dark.titles import TitleAlignments [as 别名]
# 或者: from dark.titles.TitleAlignments import coverageInfo [as 别名]
 def testCoverageInfoOneReadWithOneHSP(self):
     """
     When a title has one read with one HSP aligned to it, the coverageInfo
     method must return just the indices and bases from that read.
     """
     titleAlignments = TitleAlignments('subject title', 55)
     hsp = HSP(15, subjectStart=3, subjectEnd=6, readMatchedSequence='CGT')
     read = Read('id1', 'AAACGT')
     titleAlignment = TitleAlignment(read, [hsp])
     titleAlignments.addAlignment(titleAlignment)
     coverage = titleAlignments.coverageInfo()
     self.assertEqual(
         {
             3: [(15, 'C')],
             4: [(15, 'G')],
             5: [(15, 'T')],
         },
         coverage)
开发者ID:acorg,项目名称:dark-matter,代码行数:20,代码来源:test_titles.py

示例3: testCoverageInfoOneReadWithTwoHSPs

# 需要导入模块: from dark.titles import TitleAlignments [as 别名]
# 或者: from dark.titles.TitleAlignments import coverageInfo [as 别名]
 def testCoverageInfoOneReadWithTwoHSPs(self):
     """
     When a title has one read with two HSPs aligned to it, the coverageInfo
     method must return the correct indices and bases from that read.
     """
     titleAlignments = TitleAlignments('subject title', 55)
     hsp1 = HSP(15, subjectStart=1, subjectEnd=4, readMatchedSequence='A-A')
     hsp2 = HSP(10, subjectStart=3, subjectEnd=6, readMatchedSequence='CGT')
     read = Read('id1', 'AAACGT')
     titleAlignment = TitleAlignment(read, [hsp1, hsp2])
     titleAlignments.addAlignment(titleAlignment)
     coverage = titleAlignments.coverageInfo()
     self.assertEqual(
         {
             1: [(15, 'A')],
             2: [(15, '-')],
             3: [(15, 'A'), (10, 'C')],
             4: [(10, 'G')],
             5: [(10, 'T')],
         },
         coverage)
开发者ID:acorg,项目名称:dark-matter,代码行数:23,代码来源:test_titles.py

示例4: testCoverageInfoTwoReadsWithThreeHSPs

# 需要导入模块: from dark.titles import TitleAlignments [as 别名]
# 或者: from dark.titles.TitleAlignments import coverageInfo [as 别名]
    def testCoverageInfoTwoReadsWithThreeHSPs(self):
        """
        When a title has two reads (one with two HSPs, one with one) aligned
        to it, the coverageInfo method must return the correct indices and
        bases from the read.
        """
        titleAlignments = TitleAlignments('subject title', 55)

        # First read.
        hsp1 = HSP(15, subjectStart=1, subjectEnd=4, readMatchedSequence='A-A')
        hsp2 = HSP(10, subjectStart=3, subjectEnd=6, readMatchedSequence='CGT')
        read = Read('id1', 'AAACGT')
        titleAlignment = TitleAlignment(read, [hsp1, hsp2])
        titleAlignments.addAlignment(titleAlignment)

        # Second read.
        hsp1 = HSP(20, subjectStart=5, subjectEnd=10,
                   readMatchedSequence='CGGTA')
        read = Read('id2', 'AAACGTCGGTAAAA')
        titleAlignment = TitleAlignment(read, [hsp1])
        titleAlignments.addAlignment(titleAlignment)

        coverage = titleAlignments.coverageInfo()
        self.assertEqual(
            {
                1: [(15, 'A')],
                2: [(15, '-')],
                3: [(15, 'A'), (10, 'C')],
                4: [(10, 'G')],
                5: [(10, 'T'), (20, 'C')],
                6: [(20, 'G')],
                7: [(20, 'G')],
                8: [(20, 'T')],
                9: [(20, 'A')],
            },
            coverage)
开发者ID:acorg,项目名称:dark-matter,代码行数:38,代码来源:test_titles.py


注:本文中的dark.titles.TitleAlignments.coverageInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。