diff --git a/CHANGELOG.md b/CHANGELOG.md index e58b901..2782053 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unrelased] +### Fixed +- merge_gff_compare failing with empty GFF files. + ## [v1.6.0] ### Fixed - v1.5.0 bug; access to undefined channel output bug when using precomputed transcriptome. diff --git a/main.nf b/main.nf index 4ef6872..8861eeb 100644 --- a/main.nf +++ b/main.nf @@ -271,7 +271,7 @@ process merge_gff_bundles{ memory "2 GB" input: - tuple val(sample_id), path (gff_bundle) + tuple val(sample_id), path ('gff_bundles/annotation*.gff') output: tuple val(sample_id), path("${sample_id}.gff"), emit: gff tuple val(sample_id), path("transcriptome_summary.pickle"), emit: summary @@ -281,11 +281,13 @@ process merge_gff_bundles{ echo '##gff-version 2' >> $merged_gff; echo '#pipeline-nanopore-isoforms: stringtie' >> $merged_gff; - for fn in ${gff_bundle}; - do - grep -v '#' \$fn >> $merged_gff - - done + find -L gff_bundles -type f -name "*.gff" \ + -exec awk '!/^#/ {print}' {} \\; >> "${sample_id}.gff" + if ! [ -s "${sample_id}.gff" ]; then + echo "No transcripts found for ${sample_id}" + # This is unlikely to ever happen, but if it does, we should fail the workflow. + exit 70 + fi workflow-glue summarise_gff \ $merged_gff \