本文整理汇总了Python中dark.sam.PaddedSAM.referencesToStr方法的典型用法代码示例。如果您正苦于以下问题:Python PaddedSAM.referencesToStr方法的具体用法?Python PaddedSAM.referencesToStr怎么用?Python PaddedSAM.referencesToStr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dark.sam.PaddedSAM
的用法示例。
在下文中一共展示了PaddedSAM.referencesToStr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testReferencesToStr
# 需要导入模块: from dark.sam import PaddedSAM [as 别名]
# 或者: from dark.sam.PaddedSAM import referencesToStr [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: sorted
# 需要导入模块: from dark.sam import PaddedSAM [as 别名]
# 或者: from dark.sam.PaddedSAM import referencesToStr [as 别名]
"""
result = []
for offset in sorted(nucleotides):
result.append(
'%s%d: %s' % (prefix, offset,
baseCountsToStr(nucleotides[offset])))
return '\n'.join(result)
args = parser.parse_args()
paddedSAM = PaddedSAM(args.samFile)
try:
if args.listReferenceNames:
print(paddedSAM.referencesToStr(), file=sys.stdout)
else:
try:
for read in paddedSAM.queries(
referenceName=args.referenceName,
minLength=args.minLength,
rcSuffix=args.rcSuffix,
dropSecondary=args.dropSecondary,
dropSupplementary=args.dropSupplementary,
dropDuplicates=args.dropDuplicates,
allowDuplicateIds=args.allowDuplicateIds,
keepQCFailures=args.keepQCFailures,
rcNeeded=args.rcNeeded):
print(read.toString('fasta'), end='')
except UnequalReferenceLengthError as e:
raise ValueError(