Skip to content

Commit

Permalink
Output HTML for review pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
veghp committed Oct 16, 2024
1 parent b5f9faf commit da51f6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ediacara/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def end_pug_to_html(template, **context):
return pug_to_html(template, **context)


def write_assembly_analysis_report(target, assemblybatch):
def write_assembly_analysis_report(pdf_file, html_file, assemblybatch):
"""Write a sequencing run report with a PDF summary.
Expand All @@ -69,7 +69,9 @@ def write_assembly_analysis_report(target, assemblybatch):
html = end_pug_to_html(
ASSEMBLY_ANALYSIS_REPORT_TEMPLATE, assemblybatch=assemblybatch
)
write_report(html, target, extra_stylesheets=(STYLESHEET,))
with open(html_file, "w") as html_output:
html_output.write(html)
write_report(html, pdf_file, extra_stylesheets=(STYLESHEET,))


def write_sequencinggroup_report(pdf_file, html_file, sequencinggroup):
Expand Down
3 changes: 2 additions & 1 deletion tests/test_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def test_write_assembly_analysis_report(tmpdir):
assembly_plan_path = os.path.join(data_dir, "review", "assembly_plan.csv")
params_projectname = "Test review"
pdf_file = os.path.join(str(tmpdir), "review_report.pdf")
html_file = os.path.join(str(tmpdir), "review_report.html")

entries = pd.read_csv(samplesheet_csv, header=None)
entries.columns = [
Expand Down Expand Up @@ -120,4 +121,4 @@ def test_write_assembly_analysis_report(tmpdir):
)
assemblybatch.perform_all_interpretations_in_group()

edi.write_assembly_analysis_report(pdf_file, assemblybatch)
edi.write_assembly_analysis_report(pdf_file, html_file, assemblybatch)

0 comments on commit da51f6d

Please sign in to comment.