Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip blastn if there are no chunks #109

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading