Skip to content

Commit 88a0d88

Browse files
authored
Merge pull request #606 from broadinstitute/dp-fix-multiqc
Fix MultiQC task failure when all input files are empty/invalid
2 parents 5b8742e + 06a3e2d commit 88a0d88

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

pipes/WDL/tasks/tasks_reports.wdl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,10 +688,20 @@ task MultiQC {
688688
${"--config " + config} \
689689
${"--cl-config " + config_yaml }
690690
691+
# Ensure output directory exists (MultiQC may remove it if no results found)
692+
mkdir -p "${out_dir}"
693+
691694
if [ -z "${file_name}" ]; then
692695
mv "${out_dir}/${report_filename}_report.html" "${out_dir}/${report_filename}.html"
693696
fi
694697
698+
# Create placeholder HTML report if MultiQC didn't create one (happens when no valid results found)
699+
if [ ! -f "${out_dir}/${report_filename}.html" ]; then
700+
echo "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><title>MultiQC Report</title></head><body><h1>MultiQC Report</h1><p>No analysis results found in input files.</p></body></html>" > "${out_dir}/${report_filename}.html"
701+
fi
702+
703+
# Ensure data directory exists before tarring (MultiQC only creates it when results are found)
704+
mkdir -p "${out_dir}/${report_filename}_data"
695705
tar -c "${out_dir}/${report_filename}_data" | gzip -c > "${report_filename}_data.tar.gz"
696706
}
697707

0 commit comments

Comments
 (0)