本文整理汇总了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()
示例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()
示例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()
示例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()
示例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()
示例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()
示例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()
示例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()
示例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()
示例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()
示例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()
示例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()
示例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()
示例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()
示例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()