Skip to content

Commit

Permalink
Merge pull request #109 from sanger-tol/patch
Browse files Browse the repository at this point in the history
Skip blastn if there are no chunks
  • Loading branch information
muffato authored Aug 22, 2024
2 parents 1c0bf53 + 3053bdb commit 0a5b28b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
9 changes: 7 additions & 2 deletions subworkflows/local/run_blastn.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }

Expand Down

0 comments on commit 0a5b28b

Please sign in to comment.