diff --git a/CHANGELOG.md b/CHANGELOG.md index b1f08975..bf3e3e6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [[0.5.1](https://github.com/sanger-tol/blobtoolkit/releases/tag/0.5.1)] – Snorlax (patch 1) – [2024-08-22] + +### Enhancements & fixes + +- Bugfix: skip BLASTN if there are no chunks to align + ## [[0.5.0](https://github.com/sanger-tol/blobtoolkit/releases/tag/0.5.0)] – Snorlax – [2024-07-31] General tidy up of the configuration and the pipeline diff --git a/nextflow.config b/nextflow.config index db5ef388..84bae361 100644 --- a/nextflow.config +++ b/nextflow.config @@ -243,7 +243,7 @@ manifest { description = """Quality assessment of genome assemblies""" mainScript = 'main.nf' nextflowVersion = '!>=23.04.0' - version = '0.5.0' + version = '0.5.1' doi = '10.5281/zenodo.7949058' } diff --git a/subworkflows/local/run_blastn.nf b/subworkflows/local/run_blastn.nf index 1ea64b82..7dc92fd7 100644 --- a/subworkflows/local/run_blastn.nf +++ b/subworkflows/local/run_blastn.nf @@ -41,10 +41,14 @@ workflow RUN_BLASTN { BLOBTOOLKIT_CHUNK ( SEQTK_SUBSEQ.out.sequences, [[],[]] ) ch_versions = ch_versions.mix ( BLOBTOOLKIT_CHUNK.out.versions.first() ) + // Check that there are still sequences left after chunking (which excludes masked regions) + BLOBTOOLKIT_CHUNK.out.chunks + | filter { it[1].size() > 0 } + | set { ch_chunks } // Run blastn search // run blastn excluding taxon_id - BLASTN_TAXON ( BLOBTOOLKIT_CHUNK.out.chunks, blastn, taxon_id ) + BLASTN_TAXON ( ch_chunks, blastn, taxon_id ) ch_versions = ch_versions.mix ( BLASTN_TAXON.out.versions.first() ) // check if blastn output table is empty @@ -56,7 +60,8 @@ workflow RUN_BLASTN { | set { ch_blastn_taxon_out } // repeat the blastn search without excluding taxon_id - ch_blastn_taxon_out.empty.join ( BLOBTOOLKIT_CHUNK.out.chunks ) + ch_blastn_taxon_out.empty + | join ( ch_chunks ) | map { meta, txt, fasta -> [meta, fasta] } | set { ch_blast_blastn_input }