From 1728df69ccbaf4ccb1027c6fd4e9191f48c22194 Mon Sep 17 00:00:00 2001 From: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com> Date: Thu, 28 Sep 2023 11:39:35 +0100 Subject: [PATCH] Blast (#3889) * blast suite container version update + stubs * tests updated and reformatted --- modules/nf-core/blast/blastn/main.nf | 25 +++++++++++---- modules/nf-core/blast/blastn/meta.yml | 3 +- modules/nf-core/blast/blastp/main.nf | 2 +- modules/nf-core/blast/makeblastdb/main.nf | 32 ++++++++++++++++--- modules/nf-core/blast/makeblastdb/meta.yml | 1 + modules/nf-core/blast/tblastn/main.nf | 25 +++++++++++---- modules/nf-core/blast/tblastn/meta.yml | 3 +- tests/modules/nf-core/blast/blastn/main.nf | 1 + tests/modules/nf-core/blast/blastn/test.yml | 22 +++++++------ tests/modules/nf-core/blast/blastp/test.yml | 24 +++++++------- .../modules/nf-core/blast/makeblastdb/main.nf | 1 + .../nf-core/blast/makeblastdb/test.yml | 18 +++++------ tests/modules/nf-core/blast/tblastn/main.nf | 2 +- tests/modules/nf-core/blast/tblastn/test.yml | 22 ++++++------- 14 files changed, 117 insertions(+), 64 deletions(-) diff --git a/modules/nf-core/blast/blastn/main.nf b/modules/nf-core/blast/blastn/main.nf index 9a1f3a55b71..85a54cd1ccb 100644 --- a/modules/nf-core/blast/blastn/main.nf +++ b/modules/nf-core/blast/blastn/main.nf @@ -2,18 +2,18 @@ process BLAST_BLASTN { tag "$meta.id" label 'process_medium' - conda "bioconda::blast=2.13.0" + conda "bioconda::blast=2.14.1" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/blast:2.13.0--hf3cf87c_0' : - 'biocontainers/blast:2.13.0--hf3cf87c_0' }" + 'https://depot.galaxyproject.org/singularity/blast:2.14.1--pl5321h6f7f691_0': + 'biocontainers/blast:2.14.1--pl5321h6f7f691_0' }" input: tuple val(meta), path(fasta) path db output: - tuple val(meta), path('*.blastn.txt'), emit: txt - path "versions.yml" , emit: versions + tuple val(meta), path('*.txt'), emit: txt + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -28,7 +28,20 @@ process BLAST_BLASTN { -db \$DB \\ -query $fasta \\ $args \\ - -out ${prefix}.blastn.txt + -out ${prefix}.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + blast: \$(blastn -version 2>&1 | sed 's/^.*blastn: //; s/ .*\$//') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.txt + cat <<-END_VERSIONS > versions.yml "${task.process}": blast: \$(blastn -version 2>&1 | sed 's/^.*blastn: //; s/ .*\$//') diff --git a/modules/nf-core/blast/blastn/meta.yml b/modules/nf-core/blast/blastn/meta.yml index 2742278d511..e43dcce98cd 100644 --- a/modules/nf-core/blast/blastn/meta.yml +++ b/modules/nf-core/blast/blastn/meta.yml @@ -31,7 +31,7 @@ output: - txt: type: file description: File containing blastn hits - pattern: "*.{blastn.txt}" + pattern: "*.txt" - versions: type: file description: File containing software versions @@ -39,3 +39,4 @@ output: authors: - "@joseespinosa" - "@drpatelh" + - "@vagkaratzas" diff --git a/modules/nf-core/blast/blastp/main.nf b/modules/nf-core/blast/blastp/main.nf index 1c94a3e6bb7..8f46dcb8cfc 100644 --- a/modules/nf-core/blast/blastp/main.nf +++ b/modules/nf-core/blast/blastp/main.nf @@ -13,7 +13,7 @@ process BLAST_BLASTP { output: tuple val(meta), path("*.csv"), emit: csv - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/blast/makeblastdb/main.nf b/modules/nf-core/blast/makeblastdb/main.nf index f57636116fb..fe705b3f9f4 100644 --- a/modules/nf-core/blast/makeblastdb/main.nf +++ b/modules/nf-core/blast/makeblastdb/main.nf @@ -2,17 +2,17 @@ process BLAST_MAKEBLASTDB { tag "$fasta" label 'process_medium' - conda "bioconda::blast=2.13.0" + conda "bioconda::blast=2.14.1" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/blast:2.13.0--hf3cf87c_0' : - 'biocontainers/blast:2.13.0--hf3cf87c_0' }" + 'https://depot.galaxyproject.org/singularity/blast:2.14.1--pl5321h6f7f691_0': + 'biocontainers/blast:2.14.1--pl5321h6f7f691_0' }" input: path fasta output: - path 'blast_db' , emit: db - path "versions.yml" , emit: versions + path 'blast_db' , emit: db + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -25,6 +25,28 @@ process BLAST_MAKEBLASTDB { $args mkdir blast_db mv ${fasta}* blast_db + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + blast: \$(blastn -version 2>&1 | sed 's/^.*blastn: //; s/ .*\$//') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + """ + touch ${fasta}.fasta + touch ${fasta}.fasta.ndb + touch ${fasta}.fasta.nhr + touch ${fasta}.fasta.nin + touch ${fasta}.fasta.njs + touch ${fasta}.fasta.not + touch ${fasta}.fasta.nsq + touch ${fasta}.fasta.ntf + touch ${fasta}.fasta.nto + mkdir blast_db + mv ${fasta}* blast_db + cat <<-END_VERSIONS > versions.yml "${task.process}": blast: \$(blastn -version 2>&1 | sed 's/^.*blastn: //; s/ .*\$//') diff --git a/modules/nf-core/blast/makeblastdb/meta.yml b/modules/nf-core/blast/makeblastdb/meta.yml index 83c4b292713..272798d20f4 100644 --- a/modules/nf-core/blast/makeblastdb/meta.yml +++ b/modules/nf-core/blast/makeblastdb/meta.yml @@ -29,3 +29,4 @@ output: authors: - "@joseespinosa" - "@drpatelh" + - "@vagkaratzas" diff --git a/modules/nf-core/blast/tblastn/main.nf b/modules/nf-core/blast/tblastn/main.nf index c8946532c27..58f6ea79851 100644 --- a/modules/nf-core/blast/tblastn/main.nf +++ b/modules/nf-core/blast/tblastn/main.nf @@ -2,18 +2,18 @@ process BLAST_TBLASTN { tag "$meta.id" label 'process_medium' - conda "bioconda::blast=2.13.0" + conda "bioconda::blast=2.14.1" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/blast:2.13.0--hf3cf87c_0' : - 'biocontainers/blast:2.13.0--hf3cf87c_0' }" + 'https://depot.galaxyproject.org/singularity/blast:2.14.1--pl5321h6f7f691_0': + 'biocontainers/blast:2.14.1--pl5321h6f7f691_0' }" input: tuple val(meta), path(fasta) path db output: - tuple val(meta), path('*.tblastn.txt') , emit: txt - path "versions.yml" , emit: versions + tuple val(meta), path('*.txt'), emit: txt + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -28,7 +28,20 @@ process BLAST_TBLASTN { -db \$DB \\ -query $fasta \\ $args \\ - -out ${prefix}.tblastn.txt + -out ${prefix}.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + blast: \$(tblastn -version 2>&1 | sed 's/^.*tblastn: //; s/ .*\$//') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.txt + cat <<-END_VERSIONS > versions.yml "${task.process}": blast: \$(tblastn -version 2>&1 | sed 's/^.*tblastn: //; s/ .*\$//') diff --git a/modules/nf-core/blast/tblastn/meta.yml b/modules/nf-core/blast/tblastn/meta.yml index 2359cae6b7b..ae9d003b3ab 100644 --- a/modules/nf-core/blast/tblastn/meta.yml +++ b/modules/nf-core/blast/tblastn/meta.yml @@ -31,7 +31,7 @@ output: - txt: type: file description: File containing blastn hits - pattern: "*.{tblastn.txt}" + pattern: "*.txt" - versions: type: file description: File containing software versions @@ -39,3 +39,4 @@ output: authors: - "@yumisims" - "@gq2" + - "@vagkaratzas" diff --git a/tests/modules/nf-core/blast/blastn/main.nf b/tests/modules/nf-core/blast/blastn/main.nf index cb0f8bdf52c..1d1f572cab9 100644 --- a/tests/modules/nf-core/blast/blastn/main.nf +++ b/tests/modules/nf-core/blast/blastn/main.nf @@ -6,6 +6,7 @@ include { BLAST_MAKEBLASTDB } from '../../../../../modules/nf-core/blast/makebla include { BLAST_BLASTN } from '../../../../../modules/nf-core/blast/blastn/main.nf' workflow test_blast_blastn { + input = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] BLAST_MAKEBLASTDB ( input ) diff --git a/tests/modules/nf-core/blast/blastn/test.yml b/tests/modules/nf-core/blast/blastn/test.yml index 2c3492a1b07..388ba22ec32 100644 --- a/tests/modules/nf-core/blast/blastn/test.yml +++ b/tests/modules/nf-core/blast/blastn/test.yml @@ -1,22 +1,24 @@ -- name: blast_blastn +- name: blast blastn command: nextflow run ./tests/modules/nf-core/blast/blastn -entry test_blast_blastn -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/blast/blastn/nextflow.config tags: - blast - blast/blastn files: - - path: ./output/blast/test.blastn.txt - - path: ./output/blast/blast_db/genome.fasta.nsq + - path: output/blast/test.txt + contains: + - "Query= MT192765.1 Severe acute respiratory syndrome coronavirus 2 isolate" + - path: output/blast/blast_db/genome.fasta.nsq md5sum: 982cbc7d9e38743b9b1037588862b9da - - path: ./output/blast/blast_db/genome.fasta.nin - - path: ./output/blast/blast_db/genome.fasta + - path: output/blast/blast_db/genome.fasta.nin + - path: output/blast/blast_db/genome.fasta md5sum: 6e9fe4042a72f2345f644f239272b7e6 - - path: ./output/blast/blast_db/genome.fasta.nhr + - path: output/blast/blast_db/genome.fasta.nhr md5sum: f4b4ddb034fd3dd7b25c89e9d50c004e - - path: ./output/blast/blast_db/genome.fasta.ndb + - path: output/blast/blast_db/genome.fasta.ndb md5sum: 0d553c830656469211de113c5022f06d - - path: ./output/blast/blast_db/genome.fasta.not + - path: output/blast/blast_db/genome.fasta.not md5sum: 1e53e9d08f1d23af0299cfa87478a7bb - - path: ./output/blast/blast_db/genome.fasta.nto + - path: output/blast/blast_db/genome.fasta.nto md5sum: 33cdeccccebe80329f1fdbee7f5874cb - - path: ./output/blast/blast_db/genome.fasta.ntf + - path: output/blast/blast_db/genome.fasta.ntf md5sum: de1250813f0c7affc6d12dac9d0fb6bb diff --git a/tests/modules/nf-core/blast/blastp/test.yml b/tests/modules/nf-core/blast/blastp/test.yml index 02a844a7d06..d5d3eadc4c2 100644 --- a/tests/modules/nf-core/blast/blastp/test.yml +++ b/tests/modules/nf-core/blast/blastp/test.yml @@ -1,24 +1,24 @@ -- name: "blast blastp" +- name: blast blastp command: nextflow run ./tests/modules/nf-core/blast/blastp -entry test_blast_blastp -c ./tests/config/nextflow.config tags: - - "blast" - - "blast/blastp" + - blast + - blast/blastp files: - path: output/blast/test.csv md5sum: 37a8b6ef8942b5d465be26126bce8965 - - path: ./output/blast/blast_db/genome.fasta + - path: output/blast/blast_db/genome.fasta md5sum: 6e9fe4042a72f2345f644f239272b7e6 - - path: ./output/blast/blast_db/genome.fasta.pdb + - path: output/blast/blast_db/genome.fasta.pdb md5sum: 0d553c830656469211de113c5022f06d - - path: ./output/blast/blast_db/genome.fasta.phr + - path: output/blast/blast_db/genome.fasta.phr md5sum: f4b4ddb034fd3dd7b25c89e9d50c004e - - path: ./output/blast/blast_db/genome.fasta.pin - - path: ./output/blast/blast_db/genome.fasta.pjs - - path: ./output/blast/blast_db/genome.fasta.pot + - path: output/blast/blast_db/genome.fasta.pin + - path: output/blast/blast_db/genome.fasta.pjs + - path: output/blast/blast_db/genome.fasta.pot md5sum: 1e53e9d08f1d23af0299cfa87478a7bb - - path: ./output/blast/blast_db/genome.fasta.psq + - path: output/blast/blast_db/genome.fasta.psq md5sum: cf2ba5f8fc9088651c82de851b4c45a4 - - path: ./output/blast/blast_db/genome.fasta.ptf + - path: output/blast/blast_db/genome.fasta.ptf md5sum: de1250813f0c7affc6d12dac9d0fb6bb - - path: ./output/blast/blast_db/genome.fasta.pto + - path: output/blast/blast_db/genome.fasta.pto md5sum: 33cdeccccebe80329f1fdbee7f5874cb diff --git a/tests/modules/nf-core/blast/makeblastdb/main.nf b/tests/modules/nf-core/blast/makeblastdb/main.nf index 6822a9fb4ab..bce5321b058 100644 --- a/tests/modules/nf-core/blast/makeblastdb/main.nf +++ b/tests/modules/nf-core/blast/makeblastdb/main.nf @@ -5,6 +5,7 @@ nextflow.enable.dsl = 2 include { BLAST_MAKEBLASTDB } from '../../../../../modules/nf-core/blast/makeblastdb/main.nf' workflow test_blast_makeblastdb { + input = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] BLAST_MAKEBLASTDB ( input ) diff --git a/tests/modules/nf-core/blast/makeblastdb/test.yml b/tests/modules/nf-core/blast/makeblastdb/test.yml index a1f527fb430..d65cb06e9b5 100644 --- a/tests/modules/nf-core/blast/makeblastdb/test.yml +++ b/tests/modules/nf-core/blast/makeblastdb/test.yml @@ -1,21 +1,21 @@ -- name: blast_makeblastdb +- name: blast makeblastdb command: nextflow run ./tests/modules/nf-core/blast/makeblastdb -entry test_blast_makeblastdb -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/blast/makeblastdb/nextflow.config tags: - blast - blast/makeblastdb files: - - path: ./output/blast/blast_db/genome.fasta.nsq + - path: output/blast/blast_db/genome.fasta.nsq md5sum: 982cbc7d9e38743b9b1037588862b9da - - path: ./output/blast/blast_db/genome.fasta.nin - - path: ./output/blast/blast_db/genome.fasta + - path: output/blast/blast_db/genome.fasta.nin + - path: output/blast/blast_db/genome.fasta md5sum: 6e9fe4042a72f2345f644f239272b7e6 - - path: ./output/blast/blast_db/genome.fasta.nhr + - path: output/blast/blast_db/genome.fasta.nhr md5sum: f4b4ddb034fd3dd7b25c89e9d50c004e - - path: ./output/blast/blast_db/genome.fasta.ndb + - path: output/blast/blast_db/genome.fasta.ndb md5sum: 0d553c830656469211de113c5022f06d - - path: ./output/blast/blast_db/genome.fasta.not + - path: output/blast/blast_db/genome.fasta.not md5sum: 1e53e9d08f1d23af0299cfa87478a7bb - - path: ./output/blast/blast_db/genome.fasta.nto + - path: output/blast/blast_db/genome.fasta.nto md5sum: 33cdeccccebe80329f1fdbee7f5874cb - - path: ./output/blast/blast_db/genome.fasta.ntf + - path: output/blast/blast_db/genome.fasta.ntf md5sum: de1250813f0c7affc6d12dac9d0fb6bb diff --git a/tests/modules/nf-core/blast/tblastn/main.nf b/tests/modules/nf-core/blast/tblastn/main.nf index ee40d8386f0..dfcb7b0167b 100644 --- a/tests/modules/nf-core/blast/tblastn/main.nf +++ b/tests/modules/nf-core/blast/tblastn/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { BLAST_TBLASTN } from '../../../../../modules/nf-core/blast/tblastn/main.nf' include { BLAST_MAKEBLASTDB } from '../../../../../modules/nf-core/blast/makeblastdb/main.nf' +include { BLAST_TBLASTN } from '../../../../../modules/nf-core/blast/tblastn/main.nf' workflow test_blast_tblastn { diff --git a/tests/modules/nf-core/blast/tblastn/test.yml b/tests/modules/nf-core/blast/tblastn/test.yml index 625f06dd09c..41badfcb498 100644 --- a/tests/modules/nf-core/blast/tblastn/test.yml +++ b/tests/modules/nf-core/blast/tblastn/test.yml @@ -4,22 +4,20 @@ - blast - blast/tblastn files: - - path: ./output/blast/test.tblastn.txt - md5sum: c26ccfa5ceae82fc6affdc77f5505b62 - - path: ./output/blast/versions.yml - md5sum: 63d79c4c09cfd691d6be814e7fa3efd3 - - path: ./output/blast/blast_db/genome.fasta.nsq + - path: output/blast/test.txt + md5sum: a78484fae1573991fabf727a7911c571 + - path: output/blast/blast_db/genome.fasta.nsq md5sum: 982cbc7d9e38743b9b1037588862b9da - - path: ./output/blast/blast_db/genome.fasta.nin - - path: ./output/blast/blast_db/genome.fasta + - path: output/blast/blast_db/genome.fasta.nin + - path: output/blast/blast_db/genome.fasta md5sum: 6e9fe4042a72f2345f644f239272b7e6 - - path: ./output/blast/blast_db/genome.fasta.nhr + - path: output/blast/blast_db/genome.fasta.nhr md5sum: f4b4ddb034fd3dd7b25c89e9d50c004e - - path: ./output/blast/blast_db/genome.fasta.ndb + - path: output/blast/blast_db/genome.fasta.ndb md5sum: 0d553c830656469211de113c5022f06d - - path: ./output/blast/blast_db/genome.fasta.not + - path: output/blast/blast_db/genome.fasta.not md5sum: 1e53e9d08f1d23af0299cfa87478a7bb - - path: ./output/blast/blast_db/genome.fasta.nto + - path: output/blast/blast_db/genome.fasta.nto md5sum: 33cdeccccebe80329f1fdbee7f5874cb - - path: ./output/blast/blast_db/genome.fasta.ntf + - path: output/blast/blast_db/genome.fasta.ntf md5sum: de1250813f0c7affc6d12dac9d0fb6bb