diff --git a/modules/nf-core/blast/blastn/main.nf b/modules/nf-core/blast/blastn/main.nf index 0de1de0e8cd..f7da3d219f5 100644 --- a/modules/nf-core/blast/blastn/main.nf +++ b/modules/nf-core/blast/blastn/main.nf @@ -10,6 +10,9 @@ process BLAST_BLASTN { input: tuple val(meta) , path(fasta) tuple val(meta2), path(db) + path taxidlist + val taxids + val negative_tax output: tuple val(meta), path('*.txt'), emit: txt @@ -23,6 +26,12 @@ process BLAST_BLASTN { def prefix = task.ext.prefix ?: "${meta.id}" def is_compressed = fasta.getExtension() == "gz" ? true : false def fasta_name = is_compressed ? fasta.getBaseName() : fasta + def negative_tax_cmd = negative_tax ? "negative_" : "" + def taxidlist_cmd = taxidlist ? "-${negative_tax_cmd}taxidlist ${taxidlist}" : "" + def taxids_cmd = taxids ? "-${negative_tax_cmd}taxids ${taxids}" : "" + if (taxidlist_cmd.any() && taxids_cmd.any()) { + log.error("ERROR: taxidlist and taxids can not be used at the same time, choose only one argument to use for tax id filtering.") + } """ if [ "${is_compressed}" == "true" ]; then @@ -39,6 +48,8 @@ process BLAST_BLASTN { -num_threads ${task.cpus} \\ -db \$DB \\ -query ${fasta_name} \\ + ${taxidlist_cmd} \\ + ${taxids_cmd} \\ ${args} \\ -out ${prefix}.txt diff --git a/modules/nf-core/blast/blastn/tests/main.nf.test b/modules/nf-core/blast/blastn/tests/main.nf.test index aacc93c5d7c..f11796fcc32 100644 --- a/modules/nf-core/blast/blastn/tests/main.nf.test +++ b/modules/nf-core/blast/blastn/tests/main.nf.test @@ -31,6 +31,9 @@ nextflow_process { """ input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = BLAST_MAKEBLASTDB.out.db + input[2] = [] + input[3] = [] + input[4] = [] """ } } @@ -55,6 +58,9 @@ nextflow_process { """ input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) ] input[1] = BLAST_MAKEBLASTDB.out.db + input[2] = [] + input[3] = [] + input[4] = [] """ } } diff --git a/modules/nf-core/blast/blastn/tests/main.nf.test.snap b/modules/nf-core/blast/blastn/tests/main.nf.test.snap index 348a6f5fa89..3b6703866e0 100644 --- a/modules/nf-core/blast/blastn/tests/main.nf.test.snap +++ b/modules/nf-core/blast/blastn/tests/main.nf.test.snap @@ -7,9 +7,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.5" + "nextflow": "24.10.6" }, - "timestamp": "2025-04-01T11:32:43.169365323" + "timestamp": "2025-08-04T14:26:27.847166" }, "versions_zipped": { "content": [ @@ -19,8 +19,8 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.5" + "nextflow": "24.10.6" }, - "timestamp": "2025-04-01T11:32:48.452742327" + "timestamp": "2025-08-04T14:52:40.954652" } } \ No newline at end of file