diff --git a/modules/nf-core/anarcii/main.nf b/modules/nf-core/anarcii/main.nf index 966a5142958d..afca576c33a7 100644 --- a/modules/nf-core/anarcii/main.nf +++ b/modules/nf-core/anarcii/main.nf @@ -3,12 +3,13 @@ process ANARCII { label 'process_single' conda "${moduleDir}/environment.yml" - container "${workflow.containerEngine in ['singularity', 'apptainer'] + container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/c5/c56cb3320588978063f0893876f4f2b6f088dadc75628f60a746ee54e72350a6/data' : 'community.wave.seqera.io/library/python_pip_anarcii:4e5c3ffabd22d3fc'}" input: tuple val(meta), path(fasta) + val seq_type output: tuple val(meta), path("*.csv"), emit: anarcii @@ -22,6 +23,7 @@ process ANARCII { def prefix = task.ext.prefix ?: "${meta.id}" """ anarcii \\ + -t ${seq_type} \\ ${args}\\ -o ${prefix}.csv \\ ${fasta} diff --git a/modules/nf-core/anarcii/meta.yml b/modules/nf-core/anarcii/meta.yml index 0c0bd345f5ce..c0c44d51e911 100644 --- a/modules/nf-core/anarcii/meta.yml +++ b/modules/nf-core/anarcii/meta.yml @@ -27,6 +27,11 @@ input: pattern: "*.fasta" ontologies: - edam: http://edamontology.org/format_1929 + - seq_type: + type: string + description: | + Receptor type to number, passed to ANARCII's `-t` flag. Selects the model used for alignment. + pattern: "antibody|tcr|vnar|vhh|shark|unknown" output: anarcii: - - meta: diff --git a/modules/nf-core/anarcii/tests/main.nf.test b/modules/nf-core/anarcii/tests/main.nf.test index 15ee9c4237ce..b7f4210056a6 100644 --- a/modules/nf-core/anarcii/tests/main.nf.test +++ b/modules/nf-core/anarcii/tests/main.nf.test @@ -18,6 +18,7 @@ nextflow_process { [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/anarcii/anarcii_vdjdb.fasta', checkIfExists: true), ] + input[1] = 'tcr' """ } } @@ -30,6 +31,17 @@ nextflow_process { assert "Score" in anarciiResults.columnNames assert "Query start" in anarciiResults.columnNames assert "Query end" in anarciiResults.columnNames + // A mismatched seq_type leaves sequences unnumbered as chain "F" instead of failing + assert anarciiResults.columns["Chain"].every { it in ["A", "B"] } + // Score drifts with thread count, so the file md5 is not portable across machines + assert snapshot( + anarciiResults.columnNames.sort(), + anarciiResults.columns["Name"], + anarciiResults.columns["Chain"], + anarciiResults.columns["Query start"], + anarciiResults.columns["Query end"], + process.out.versions_anarcii + ).match() } } @@ -44,6 +56,7 @@ nextflow_process { [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/anarcii/anarcii_vdjdb.fasta', checkIfExists: true), ] + input[1] = 'tcr' """ } } diff --git a/modules/nf-core/anarcii/tests/main.nf.test.snap b/modules/nf-core/anarcii/tests/main.nf.test.snap index 7c6d258b896a..1e69ba6b1934 100644 --- a/modules/nf-core/anarcii/tests/main.nf.test.snap +++ b/modules/nf-core/anarcii/tests/main.nf.test.snap @@ -1,4 +1,207 @@ { + "human - fasta": { + "content": [ + [ + "1", + "10", + "100", + "101", + "102", + "103", + "104", + "105", + "106", + "107", + "108", + "109", + "11", + "110", + "111", + "111A", + "111B", + "112", + "112A", + "112B", + "113", + "114", + "115", + "116", + "117", + "118", + "119", + "12", + "120", + "121", + "122", + "123", + "124", + "125", + "126", + "127", + "128", + "13", + "14", + "15", + "16", + "17", + "18", + "19", + "2", + "20", + "21", + "22", + "23", + "24", + "25", + "26", + "27", + "28", + "29", + "3", + "30", + "31", + "32", + "33", + "34", + "35", + "36", + "37", + "38", + "39", + "4", + "40", + "41", + "42", + "43", + "44", + "45", + "46", + "47", + "48", + "49", + "5", + "50", + "51", + "52", + "53", + "54", + "55", + "56", + "57", + "58", + "59", + "6", + "60", + "61", + "62", + "63", + "64", + "65", + "66", + "67", + "68", + "69", + "7", + "70", + "71", + "72", + "73", + "74", + "75", + "76", + "77", + "78", + "79", + "8", + "80", + "81", + "82", + "83", + "84", + "85", + "86", + "87", + "88", + "89", + "9", + "90", + "91", + "92", + "93", + "94", + "95", + "96", + "97", + "98", + "99", + "Chain", + "Name", + "Query end", + "Query start", + "Score" + ], + [ + "298|TRA", + "298|TRB", + "299|TRA", + "299|TRB", + "300|TRA", + "300|TRB", + "301|TRA", + "301|TRB", + "302|TRA", + "302|TRB" + ], + [ + "A", + "B", + "A", + "B", + "A", + "B", + "A", + "B", + "A", + "B" + ], + [ + 20, + 19, + 19, + 19, + 20, + 19, + 18, + 19, + 18, + 19 + ], + [ + 133, + 133, + 132, + 131, + 135, + 137, + 130, + 130, + 130, + 133 + ], + [ + [ + "ANARCII", + "anarcii", + "2.0.5" + ] + ] + ], + "timestamp": "2026-08-26T11:14:14.316916324", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + }, "human - fasta - stub": { "content": [ {