當前位置: 首頁>>代碼示例>>Python>>正文


Python PaddedSAM.close方法代碼示例

本文整理匯總了Python中dark.sam.PaddedSAM.close方法的典型用法代碼示例。如果您正苦於以下問題:Python PaddedSAM.close方法的具體用法?Python PaddedSAM.close怎麽用?Python PaddedSAM.close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在dark.sam.PaddedSAM的用法示例。


在下文中一共展示了PaddedSAM.close方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testReferencesToStr

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testReferencesToStr(self):
        """
        The referencesToStr method must return the expected string.
        """
        data = '\n'.join([
            '@SQ SN:id1 LN:90',
            '@SQ SN:id2 LN:91',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            self.assertEqual('id1 (length 90)\nid2 (length 91)',
                             ps.referencesToStr())
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:16,代碼來源:test_sam.py

示例2: testAllMMatch

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testAllMMatch(self):
        """
        A simple all-'M' match must result in the expected padded sequence.
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            'query1 0 ref1 2 60 6M * 0 0 TCTAGG ZZZZZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            (read,) = list(ps.queries())
            self.assertEqual(Read('query1', '-TCTAGG---'), read)
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:16,代碼來源:test_sam.py

示例3: testQuerySoftClipReachesRightEdge

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testQuerySoftClipReachesRightEdge(self):
        """
        A match with a soft-clipped region that reaches to the right edge of
        the reference must result in the expected padded sequence.
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            'query1 0 ref1 5 60 2M4S * 0 0 TCTAGG ZZZZZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            (read,) = list(ps.queries())
            self.assertEqual(Read('query1', '----TCTAGG'), read)
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:17,代碼來源:test_sam.py

示例4: testQuerySoftClipLeft

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testQuerySoftClipLeft(self):
        """
        A match with a soft-clipped region that does not extend to the left of
        the reference must result in the expected padded sequence.
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            'query1 0 ref1 4 60 2S4M * 0 0 TCTAGG ZZZZZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            (read,) = list(ps.queries())
            self.assertEqual(Read('query1', '-TCTAGG---'), read)
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:17,代碼來源:test_sam.py

示例5: testRcSuffix

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testRcSuffix(self):
        """
        A reverse-complimented sequence should have the rcSuffix string added
        to its id when an rcSuffix value is passed.
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            'query1 16 ref1 2 60 6M * 0 0 TCTAGG ZZZZZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            (read,) = list(ps.queries(rcSuffix='-rc'))
            self.assertEqual(Read('query1-rc', '-TCTAGG---'), read)
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:17,代碼來源:test_sam.py

示例6: testRcNeeded

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testRcNeeded(self):
        """
        A reverse-complimented match (flag = 16) when rcNeeded=True is passed
        must result in the expected (reverse complimented) padded sequence.
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            'query1 16 ref1 2 60 6M * 0 0 TCTAGG ZZZZZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            (read,) = list(ps.queries(rcNeeded=True))
            self.assertEqual(Read('query1', '-CCTAGA---'), read)
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:17,代碼來源:test_sam.py

示例7: testQuerySoftClipProtrudesBothSides

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testQuerySoftClipProtrudesBothSides(self):
        """
        A match with a soft-clipped region that extends to both the left and
        right of the reference must result in the expected padded sequence.
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            'query1 0 ref1 4 60 5S5M5S * 0 0 TCTAGGCTGACTAAG ZZZZZZZZZZZZZZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            (read,) = list(ps.queries())
            self.assertEqual(Read('query1', 'TAGGCTGACT'), read)
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:17,代碼來源:test_sam.py

示例8: testReferenceSkipAlternateChar

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testReferenceSkipAlternateChar(self):
        """
        An skip of reference bases must result in the expected padded
        sequence (with gaps) when a queryInsertionChar is passed.
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            'query1 0 ref1 2 60 2M2N4M * 0 0 TCTAGG ZZZZZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            (read,) = list(ps.queries(queryInsertionChar='X'))
            self.assertEqual(Read('query1', '-TCXXTAGG-'), read)
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:17,代碼來源:test_sam.py

示例9: testDropSecondary

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testDropSecondary(self):
        """
        Dropping matches flagged as secondary must give the expected result.
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            'query1 0 ref1 2 60 2=2X2M * 0 0 TCTAGG ZZZZZZ',
            'query2 256 ref1 2 60 2= * 0 0 TC ZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            (read,) = list(ps.queries(dropSecondary=True))
            self.assertEqual(Read('query1', '-TCTAGG---'), read)
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:17,代碼來源:test_sam.py

示例10: testMixedMatchSpecificReferenceButNoMatches

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testMixedMatchSpecificReferenceButNoMatches(self):
        """
        A request for reads aligned against a reference that exists but that
        has no matches must result in an empty list.
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            '@SQ SN:ref2 LN:15',
            'query1 0 ref1 2 60 2=2X2M * 0 0 TCTAGG ZZZZZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            self.assertEqual([], list(ps.queries(referenceName='ref2')))
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:17,代碼來源:test_sam.py

示例11: testMixedMatch

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testMixedMatch(self):
        """
        A match that is a mix of M, =, and X must result in the expected
        padded sequence.
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            'query1 0 ref1 2 60 2=2X2M * 0 0 TCTAGG ZZZZZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            (read,) = list(ps.queries())
            self.assertEqual(Read('query1', '-TCTAGG---'), read)
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:17,代碼來源:test_sam.py

示例12: testReferenceDeletion

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testReferenceDeletion(self):
        """
        An deletion of reference bases must result in the expected padded
        sequence (with gaps).
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            'query1 0 ref1 2 60 2M2D4M * 0 0 TCTAGG ZZZZZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            (read,) = list(ps.queries())
            self.assertEqual(Read('query1', '-TCNNTAGG-'), read)
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:17,代碼來源:test_sam.py

示例13: testMinLengthWithReferenceDeletion

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testMinLengthWithReferenceDeletion(self):
        """
        The minLength specification must be applied after deletion of
        reference bases (which results in the query being lengthened to
        continue the match).
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            'query1 0 ref1 2 60 2M2D4M * 0 0 TCTAGG ZZZZZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            (read,) = list(ps.queries(minLength=7))
            self.assertEqual(Read('query1', '-TCNNTAGG-'), read)
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:18,代碼來源:test_sam.py

示例14: testMinLength

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testMinLength(self):
        """
        A request for reads longer than a certain value should result
        in the expected result.
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            'query1 0 ref1 2 60 2=2X2M * 0 0 TCTAGG ZZZZZZ',
            'query2 0 ref1 2 60 2= * 0 0 TC ZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            (read,) = list(ps.queries(minLength=6))
            self.assertEqual(Read('query1', '-TCTAGG---'), read)
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:18,代碼來源:test_sam.py

示例15: testKeepQualityControlFailures

# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import close [as 別名]
    def testKeepQualityControlFailures(self):
        """
        Keeping matches flagged as quality control failures must give the
        expected result.
        """
        data = '\n'.join([
            '@SQ SN:ref1 LN:10',
            'query1 0 ref1 2 60 2=2X2M * 0 0 TCTAGG ZZZZZZ',
            'query2 512 ref1 4 60 2= * 0 0 TC ZZ',
        ]).replace(' ', '\t')

        with dataFile(data) as filename:
            ps = PaddedSAM(filename)
            (read1, read2) = list(ps.queries(keepQCFailures=True))
            self.assertEqual(Read('query1', '-TCTAGG---'), read1)
            self.assertEqual(Read('query2', '---TC-----'), read2)
            ps.close()
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:19,代碼來源:test_sam.py


注:本文中的dark.sam.PaddedSAM.close方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。