本文整理汇总了Python中pbcommand.models.report.Report.to_json方法的典型用法代码示例。如果您正苦于以下问题:Python Report.to_json方法的具体用法?Python Report.to_json怎么用?Python Report.to_json使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pbcommand.models.report.Report
的用法示例。
在下文中一共展示了Report.to_json方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: produce_report
# 需要导入模块: from pbcommand.models.report import Report [as 别名]
# 或者: from pbcommand.models.report.Report import to_json [as 别名]
def produce_report(
genome_length,
raw_reads,
raw_mean,
raw_n50,
raw_p95,
raw_bases,
raw_coverage,
length_cutoff,
seed_reads,
seed_bases,
seed_mean,
seed_n50,
seed_p95,
seed_coverage,
preassembled_reads,
preassembled_mean,
preassembled_n50,
preassembled_p95,
preassembled_bases,
preassembled_coverage,
preassembled_yield,
preassembled_seed_fragmentation,
preassembled_seed_truncation,
**ignored
):
"""Return a preassembly report as JSON string.
Parameters are as defined in the spec-file.
Extra parameters are ignored, so that the caller may be
augmented in a separate commit prior to updates here.
(That facilitates cross-team collaboration.)
"""
log.info("Starting {f!r}".format(
f=os.path.basename(__file__)))
# Report Attributes
attrs = []
attrs.append(Attribute('genome_length', genome_length))
attrs.append(Attribute('raw_reads', raw_reads))
attrs.append(Attribute('raw_mean', int(round(raw_mean))))
attrs.append(Attribute('raw_n50', raw_n50))
attrs.append(Attribute('raw_p95', raw_p95))
attrs.append(Attribute('raw_bases', raw_bases))
attrs.append(Attribute('raw_coverage', raw_coverage))
attrs.append(Attribute('length_cutoff', length_cutoff))
attrs.append(Attribute('seed_reads', seed_reads))
attrs.append(Attribute('seed_mean', int(round(seed_mean))))
attrs.append(Attribute('seed_n50', seed_n50))
attrs.append(Attribute('seed_p95', seed_p95))
attrs.append(Attribute('seed_bases', seed_bases))
attrs.append(Attribute('seed_coverage', seed_coverage))
attrs.append(Attribute('preassembled_reads', preassembled_reads))
attrs.append(Attribute('preassembled_mean', int(round(preassembled_mean))))
attrs.append(Attribute('preassembled_n50', preassembled_n50))
attrs.append(Attribute('preassembled_p95', preassembled_p95))
attrs.append(Attribute('preassembled_bases', preassembled_bases))
attrs.append(Attribute('preassembled_coverage', int(round(preassembled_coverage))))
attrs.append(Attribute('preassembled_yield', preassembled_yield))
attrs.append(Attribute('preassembled_seed_fragmentation', preassembled_seed_fragmentation))
attrs.append(Attribute('preassembled_seed_truncation', preassembled_seed_truncation))
report = Report(Constants.R_ID, title='Preassembly', attributes=attrs)
from pbreports.io.specs import load_spec
spec = load_spec(Constants.R_ID)
report = spec.apply_view(report)
return report.to_json()
示例2: produce_report
# 需要导入模块: from pbcommand.models.report import Report [as 别名]
# 或者: from pbcommand.models.report.Report import to_json [as 别名]
def produce_report(
genome_length,
raw_reads,
raw_mean,
raw_n50,
raw_p95,
raw_bases,
raw_coverage,
length_cutoff,
seed_reads,
seed_bases,
seed_mean,
seed_n50,
seed_p95,
seed_coverage,
preassembled_reads,
preassembled_mean,
preassembled_n50,
preassembled_p95,
preassembled_bases,
preassembled_coverage,
preassembled_yield,
preassembled_seed_fragmentation,
preassembled_seed_truncation,
**ignored
):
"""Return a preassembly report as JSON string.
Parameters are as defined in the spec-file.
Extra parameters are ignored, so that the caller may be
augmented in a separate commit prior to updates here.
(That facilitates cross-team collaboration.)
"""
log.info("Starting {f!r}".format(
f=os.path.basename(__file__)))
# Report Attributes
attrs = []
attrs.append(Attribute('genome_length', genome_length,
name="Genome Length (user input)"))
attrs.append(Attribute('raw_reads', raw_reads, name="Number of Raw Reads"))
attrs.append(Attribute('raw_mean', int(
round(raw_mean)), name="Raw Read Length Mean"))
attrs.append(Attribute('raw_n50', raw_n50, name="Raw Read Length (N50)"))
attrs.append(Attribute('raw_p95', raw_p95, name="Raw Read Length 95%"))
attrs.append(Attribute('raw_bases', raw_bases,
name="Number of Raw Bases (total)"))
attrs.append(Attribute('raw_coverage', raw_coverage,
name="Raw Coverage (bases/genome_size)"))
attrs.append(Attribute('length_cutoff', length_cutoff,
name="Length Cutoff (user input or auto-calc)"))
attrs.append(Attribute('seed_reads', seed_reads,
name="Number of Seed Reads"))
attrs.append(Attribute('seed_mean', int(
round(seed_mean)), name="Seed Read Length Mean"))
attrs.append(Attribute('seed_n50', seed_n50,
name="Seed Read Length (N50)"))
attrs.append(Attribute('seed_p95', seed_p95, name="Seed Read Length 95%"))
attrs.append(Attribute('seed_bases', seed_bases,
name="Number of Seed Bases (total)"))
attrs.append(Attribute('seed_coverage', seed_coverage,
name="Seed Coverage (bases/genome_size)"))
attrs.append(Attribute('preassembled_reads', preassembled_reads,
name="Number of Pre-Assembled Reads"))
attrs.append(Attribute('preassembled_mean', int(
round(preassembled_mean)), name="Pre-Assembled Read Length Mean"))
attrs.append(Attribute('preassembled_n50', preassembled_n50,
name="Pre-Assembled Read Length (N50)"))
attrs.append(Attribute('preassembled_p95', preassembled_p95,
name="Pre-Assembled Read Length 95%"))
attrs.append(Attribute('preassembled_bases', preassembled_bases,
name="Number of Pre-Assembled Bases (total)"))
attrs.append(Attribute('preassembled_coverage', int(round(
preassembled_coverage)), name="Pre-Assembled Coverage (bases/genome_size)"))
attrs.append(Attribute('preassembled_yield', preassembled_yield,
name="Pre-Assembled Yield (bases/seed_bases)"))
attrs.append(Attribute('preassembled_seed_fragmentation', preassembled_seed_fragmentation,
name="Avg number of reads that each seed is broken into."))
attrs.append(Attribute('preassembled_seed_truncation',
preassembled_seed_truncation, name="Avg number of bases lost from each seed."))
report = Report(Constants.R_ID, title='Preassembly', attributes=attrs)
from pbreports.io.specs import load_spec
spec = load_spec(Constants.R_ID)
report = spec.apply_view(report)
return report.to_json()