diff --git a/assets/master_template.html b/assets/master_template.html index 2ce5a05..5adfb04 100644 --- a/assets/master_template.html +++ b/assets/master_template.html @@ -53,9 +53,9 @@

Sample Report

Weighted Histogram Weighted Log-transformed Histogram Yield by Length - Execution Report - Execution Timeline - Pipeline DAG + Execution Report + Execution Timeline + Pipeline DAG {% endfor %} diff --git a/bin/generate_master_html.py b/bin/generate_master_html.py index 346be3f..7714864 100755 --- a/bin/generate_master_html.py +++ b/bin/generate_master_html.py @@ -69,20 +69,6 @@ args = parser.parse_args() -def get_date_id(samplesheet_csv_fpath): - date_ids = [] - parent_dir = os.path.dirname(samplesheet_csv_fpath) - pipeline_info_dir = os.path.join(parent_dir, 'pipeline_info') - for filename in os.listdir(pipeline_info_dir): - if filename.startswith("execution_report"): - execution_report_fpath = os.path.join(pipeline_info_dir, filename) - date_id = find_date_in_string(execution_report_fpath, r'(\d{4}-\d{2}-\d{2}[^.]+)') - date_ids.append(date_id) - date_list = map(find_date_in_string, date_ids, [r'\b(\d{4}-\d{2}-\d{2})']*len(date_ids)) - date_id_zipped = list(zip(date_ids, date_list)) - sorted_date_ids = [date_id[0] for date_id in sorted(date_id_zipped, key=lambda date: datetime.strptime(date[1], "%Y-%m-%d"), reverse=True)] - return sorted_date_ids[0] - def find_date_in_string(input_string, date_pattern): """Searches for a date within a given string.""" date = "" @@ -103,19 +89,18 @@ def get_sample_ids(samplesheet_csv): sample_ids = df['sample'].tolist() return sample_ids -def generate_master_html(template_html_fpath, sample_ids, seqrun_date, date_id): +def generate_master_html(template_html_fpath, sample_ids, seqrun_date): """Read the template from an HTML file.""" with open(template_html_fpath, "r") as file: master_template = file.read() template = Template(master_template) - rendered_html = template.render(sample_ids=sample_ids, seqrun_date=seqrun_date, date_id=date_id) + rendered_html = template.render(sample_ids=sample_ids, seqrun_date=seqrun_date) return rendered_html def main(): sample_ids = get_sample_ids(args.csv) seqrun_date = find_date_in_string(args.csv, r'/(\d{8})_') - date_id = get_date_id(args.csv) - rendered_html = generate_master_html(args.html, sample_ids, seqrun_date, date_id) + rendered_html = generate_master_html(args.html, sample_ids, seqrun_date) with open("master.html", "w") as fout: fout.write(rendered_html) diff --git a/nextflow.config b/nextflow.config index f079444..e481c1f 100644 --- a/nextflow.config +++ b/nextflow.config @@ -208,22 +208,25 @@ env { // Capture exit codes from upstream processes when piping process.shell = ['/bin/bash', '-euo', 'pipefail'] -def trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss') timeline { enabled = true - file = "${params.tracedir}/execution_timeline_${trace_timestamp}.html" + overwrite = true + file = "${params.tracedir}/execution_timeline.html" } report { enabled = true - file = "${params.tracedir}/execution_report_${trace_timestamp}.html" + overwrite = true + file = "${params.tracedir}/execution_report.html" } trace { enabled = true - file = "${params.tracedir}/execution_trace_${trace_timestamp}.txt" + overwrite = true + file = "${params.tracedir}/execution_trace.txt" } dag { enabled = true - file = "${params.tracedir}/pipeline_dag_${trace_timestamp}.html" + overwrite = true + file = "${params.tracedir}/pipeline_dag.html" } manifest { diff --git a/workflows/gmsemu.nf b/workflows/gmsemu.nf index d5791e9..57128f7 100644 --- a/workflows/gmsemu.nf +++ b/workflows/gmsemu.nf @@ -88,8 +88,6 @@ workflow GMSEMU { ch_input = GENERATE_INPUT.out.sample_sheet_merged } - GENERATE_MASTER_HTML(GENERATE_INPUT.out.sample_sheet_merged) - // Validate and stage input files INPUT_CHECK(ch_input) ch_versions = ch_versions.mix(INPUT_CHECK.out.versions) @@ -197,6 +195,7 @@ workflow GMSEMU { ) multiqc_report = MULTIQC.out.report.toList() + GENERATE_MASTER_HTML(GENERATE_INPUT.out.sample_sheet_merged, KRONA_KTIMPORTTAXONOMY.out.html, MULTIQC.out.report, NANOPLOT1.out.html) } /*