From d7a35439ac04e414cb5aaabce6d9bdf09d20b38e Mon Sep 17 00:00:00 2001 From: Ali Khan Date: Sun, 8 Sep 2024 01:40:58 -0400 Subject: [PATCH] WIP: fixing qc so flatfieldqc isn't enabled with prestitched - while I am at it, will change jinja rules to maybe use snakemake built-in jinja --- resources/qc/subject_html_temp.html | 9 ++++----- workflow/scripts/generate_subject_qc.py | 14 +++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/resources/qc/subject_html_temp.html b/resources/qc/subject_html_temp.html index 76c9894..842facb 100644 --- a/resources/qc/subject_html_temp.html +++ b/resources/qc/subject_html_temp.html @@ -4,10 +4,9 @@ {{ subject }} - {{ sample }} - {{ acq }} + {% for link_path, link_description in zip(link_paths, link_descriptions) %} + {{ link_description }}
+ {% endfor %} Back
- Flatfield Correction QC
- Whole Slice QC -
- Volume Rendered Image - \ No newline at end of file + diff --git a/workflow/scripts/generate_subject_qc.py b/workflow/scripts/generate_subject_qc.py index 6c75542..343c6ce 100644 --- a/workflow/scripts/generate_subject_qc.py +++ b/workflow/scripts/generate_subject_qc.py @@ -8,9 +8,10 @@ template = env.get_template(snakemake.input.subject_html) # input html files -ws_html = snakemake.input.ws_html -ff_html = snakemake.input.ff_html -vol_html = snakemake.input.vol_html +in_htmls = snakemake.input.in_htmls +#ws_html = snakemake.input.ws_html +#ff_html = snakemake.input.ff_html +#vol_html = snakemake.input.vol_html # output html files sub_html = snakemake.output.sub_html @@ -22,13 +23,12 @@ # Get relative path to the subjects QC htmls -ws_rel_path = Path(ws_html).relative_to(Path(sub_html).parent) -ff_rel_path = Path(ff_html).relative_to(Path(sub_html).parent) -vol_rel_path = Path(vol_html).relative_to(Path(sub_html).parent) +link_rel_paths = [ Path(link_path).relative_to(Path(sub_html).parent) for link_path in snakemake.input.link_paths] +link_descriptions = snakemake.params.link_descriptions # Fill in jinja template for subject html and write it out output = template.render(back_link="../qc_report.html",subject=subject,sample=sample,acq=acq, - ffhtml=ff_rel_path,wshtml=ws_rel_path, volhtml=vol_rel_path) + link_rel_paths, link_descriptions) with open(sub_html, 'w') as f: f.write(output)