PYPPL报表生成系统
pyppl-report的Python项目详细描述
Pyppl_报告
用于PyPPL
的报表生成系统安装
需要pandoc 2.7+(创建pdf报告时需要wkhtmltopf0.12.4+)
pyppl_report
要求pandoc/wkhtmltopdf
安装在$PATH
pip install pyppl_report
用法
模板规格
pPyClone.report="""## {{title}}PyClone[1] is a tool using Probabilistic model for inferring clonal population structure from deep NGS sequencing.![Similarity matrix]({{path.join(job.o.outdir, "plots/loci/similarity_matrix.svg")}})```tablecaption: Clustersfile: "{{path.join(job.o.outdir, "tables/cluster.tsv")}}"rows: 10```[1]: Roth, Andrew, et al. "PyClone: statistical inference of clonal population structure in cancer." Nature methods 11.4 (2014): 396."""# or use a template filepPyClone.report="file:/path/to/template.md"
生成报告
PyPPL().start(pPyClone).run().report('/path/to/report',title='Clonality analysis using PyClone')
用于渲染的额外数据
您可以在<job.outdir>
下生成一个名为job.report.data.yaml
的YAML
文件,其中包含额外的数据来呈现报表模板。除此之外,还可以使用proc
属性和args
。
例如:
job.report.data.yaml
:
description:'Aawesomereportforjob1'
然后在您的模板中,您可以使用它:
## {{jobs[0].description}}
显示csv/tsv文件
的表格```table caption : An awesome table file : /path/to/csv/tsv/file header : true width : 1 # width of each column total_width: .8 # total width of the table align : default # alignment of each column rows : 10 # max rows to show cols : 0 # max cols to show, default: 0 (show all) csvargs : # csvargs for `csv.read` dialect: unix delimiter: "\t"
您还可以为单个列指定width
和align
:
width:-.1-.2-.1
参考文献
我们使用[1]
,[2]
…要链接到引用,必须有html链接(格式为[text](link)
,而不是[text][link-index]
)。来自不同流程的所有引用都将重新排序和组合。