From c859e3cd8533762b8158051b31afe837baa87a1e Mon Sep 17 00:00:00 2001 From: d-jch <141316588+d-jch@users.noreply.github.com> Date: Wed, 22 Apr 2026 21:32:20 +0800 Subject: [PATCH] Improve mirtop stats script with GFF check Add conditional handling for empty GFF files in mirtop stats. --- modules/nf-core/mirtop/stats/main.nf | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/mirtop/stats/main.nf b/modules/nf-core/mirtop/stats/main.nf index 2c73fb745b40..517a143560b4 100644 --- a/modules/nf-core/mirtop/stats/main.nf +++ b/modules/nf-core/mirtop/stats/main.nf @@ -23,11 +23,17 @@ process MIRTOP_STATS { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ - mirtop \\ - stats \\ - $args \\ - --out stats \\ - $mirtop_gff + mkdir -p stats + if grep -qv "^#" "$mirtop_gff"; then + mirtop \\ + stats \\ + $args \\ + --out stats \\ + $mirtop_gff + else + touch stats/mirtop_stats.txt + touch stats/mirtop_stats.log + fi mv stats/mirtop_stats.log stats/${prefix}_stats.log mv stats/mirtop_stats.txt stats/${prefix}_stats.txt