本文整理汇总了Python中dark.titles.TitlesAlignments.tabSeparatedSummary方法的典型用法代码示例。如果您正苦于以下问题:Python TitlesAlignments.tabSeparatedSummary方法的具体用法?Python TitlesAlignments.tabSeparatedSummary怎么用?Python TitlesAlignments.tabSeparatedSummary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dark.titles.TitlesAlignments
的用法示例。
在下文中一共展示了TitlesAlignments.tabSeparatedSummary方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testTabSeparatedSummary
# 需要导入模块: from dark.titles import TitlesAlignments [as 别名]
# 或者: from dark.titles.TitlesAlignments import tabSeparatedSummary [as 别名]
def testTabSeparatedSummary(self):
"""
The summary function must return the correct result.
"""
mockOpener = mockOpen(read_data=(
dumps(PARAMS) + '\n' + dumps(RECORD0) + '\n'))
with patch.object(builtins, 'open', mockOpener):
reads = Reads()
reads.add(Read('id0', 'A' * 70))
readsAlignments = DiamondReadsAlignments(reads, 'f.json', 'db')
titlesAlignments = TitlesAlignments(readsAlignments)
summary = titlesAlignments.tabSeparatedSummary(sortOn='title')
expected = (
'0.000297\t'
'20.000000\t'
'20.000000\t'
'1\t'
'1\t'
'37000\t'
'gi|887699|gb|DQ37780 Squirrelpox virus 1296/99'
'\n'
'0.000289\t'
'25.000000\t'
'25.000000\t'
'1\t'
'1\t'
'38000\t'
'gi|887699|gb|DQ37780 Squirrelpox virus 55')
self.assertEqual(expected, summary)
示例2: TitlesAlignments
# 需要导入模块: from dark.titles import TitlesAlignments [as 别名]
# 或者: from dark.titles.TitlesAlignments import tabSeparatedSummary [as 别名]
titleRegex=args.titleRegex, negativeTitleRegex=args.negativeTitleRegex,
truncateTitlesAfter=args.truncateTitlesAfter, taxonomy=args.taxonomy)
titlesAlignments = TitlesAlignments(readsAlignments).filter(
minMatchingReads=args.minMatchingReads,
minMedianScore=args.minMedianScore,
withScoreBetterThan=args.withScoreBetterThan,
minNewReads=args.minNewReads, maxTitles=args.maxTitles,
sortOn=args.sortOn, minCoverage=args.minCoverage)
nTitles = len(titlesAlignments)
print('Found %d interesting title%s.' %
(nTitles, '' if nTitles == 1 else 's'), file=sys.stderr)
if nTitles:
print(titlesAlignments.tabSeparatedSummary(sortOn=args.sortOn))
if args.earlyExit:
sys.exit(0)
if nTitles == 0:
print('No alignment panel generated due to no matching titles.',
file=sys.stderr)
sys.exit(0)
idList = parseColors(args.color, args) if args.color else None
alignmentPanel(titlesAlignments, sortOn=args.sortOn, interactive=False,
outputDir=args.outputDir, idList=idList,
equalizeXAxes=args.equalizeXAxes, xRange=args.xRange,
logLinearXAxis=args.logLinearXAxis, logBase=args.logBase,