diff --git a/modules/nf-core/presto/pairseq/environment.yml b/modules/nf-core/presto/pairseq/environment.yml new file mode 100644 index 000000000000..a574fd241ce0 --- /dev/null +++ b/modules/nf-core/presto/pairseq/environment.yml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - "bioconda::presto=0.7.9" diff --git a/modules/nf-core/presto/pairseq/main.nf b/modules/nf-core/presto/pairseq/main.nf new file mode 100644 index 000000000000..57675d1d422b --- /dev/null +++ b/modules/nf-core/presto/pairseq/main.nf @@ -0,0 +1,44 @@ +process PRESTO_PAIRSEQ { + tag "$meta.id" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/presto:0.7.9--pyhdfd78af_0': + 'quay.io/biocontainers/presto:0.7.9--pyhdfd78af_0' }" + + input: + tuple val(meta), path(R1_reads), path(R2_reads) + val(barcode_position) + + output: + tuple val(meta), path("*_pair-pass.fastq.gz"), path("*_pair-pass.fastq.gz") , emit: reads + path "*_command_log.txt", emit: logs + tuple val("${task.process}"), val('presto'), eval('PairSeq.py --version | grep -o "[0-9][0-9.]*" | head -n 1'), emit: versions_presto, topic: versions + + when: + task.ext.when == null || task.ext.when + + script: + def copyfield = (barcode_position == 'R1')? '--1f BARCODE' : (barcode_position == 'R2')? '--2f BARCODE' : (barcode_position == 'R1R2')? '--1f BARCODE --2f BARCODE' : (barcode_position == 'clustersets')? '--1f CLUSTER --2f CLUSTER' : '' + def args = task.ext.args?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + PairSeq.py -1 ${R1_reads} \\ + -2 ${R2_reads} \\ + --outname ${prefix} \\ + $copyfield \\ + $args > ${prefix}_command_log.txt + + """ + + stub: + def copyfield = (barcode_position == 'R1')? '--1f BARCODE' : (barcode_position == 'R2')? '--2f BARCODE' : (barcode_position == 'R1R2')? '--1f BARCODE --2f BARCODE' : (barcode_position == 'clustersets')? '--1f CLUSTER --2f CLUSTER' : '' + def args = task.ext.args?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}-1_pair-pass.fastq.gz \\ + ${prefix}-2_pair-pass.fastq.gz \\ + ${prefix}_command_log.txt + """ +} diff --git a/modules/nf-core/presto/pairseq/meta.yml b/modules/nf-core/presto/pairseq/meta.yml new file mode 100644 index 000000000000..fe07a2b0c6e2 --- /dev/null +++ b/modules/nf-core/presto/pairseq/meta.yml @@ -0,0 +1,89 @@ +name: "presto_pairseq" +description: Sorts and matches sequence records with matching coordinates across + files +keywords: + - immcantation + - airrseq + - genomics + - immunoinformatics +tools: + - "presto": + description: "A bioinformatics toolkit for processing high-throughput lymphocyte + receptor sequencing data." + homepage: "https://immcantation.readthedocs.io" + documentation: "https://presto.readthedocs.io" + tool_dev_url: "https://bitbucket.org/kleinstein/presto" + doi: "10.1093/bioinformatics/btu138" + licence: + - "AGPL v3" + identifier: biotools:presto-measure +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test']` + - R1_reads: + type: file + description: compressed fastq file + pattern: "*.{fastq.gz}" + ontologies: + - edam: http://edamontology.org/format_1930 + - R2_reads: + type: file + description: compressed fastq file + pattern: "*.{fastq.gz}" + ontologies: + - edam: http://edamontology.org/format_1930 + - barcode_position: + type: string + description: Barcode position. One of "R1, R2, R1R2 or clustersets". Default + is "" +output: + reads: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test']` + - "*_pair-pass.fastq.gz": + type: file + description: paired fastq.gz file of R1 reads + pattern: "*.{fastq.gz}" + ontologies: + - edam: http://edamontology.org/format_1930 + - "*_pair-pass.fastq.gz": + type: file + description: paired fastq.gz file of R2 reads + pattern: "*.{fastq.gz}" + ontologies: + - edam: http://edamontology.org/format_1930 + logs: + - "*_command_log.txt": + type: file + description: command_logs + pattern: "*.txt" + ontologies: [] + versions_presto: + - - ${task.process}: + type: string + description: The name of the process + - presto: + type: string + description: the name of the tool + - PairSeq.py --version | grep -o "[0-9][0-9.]*" | head -n 1: + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - presto: + type: string + description: the name of the tool + - PairSeq.py --version | grep -o "[0-9][0-9.]*" | head -n 1: + type: eval + description: The expression to obtain the version of the tool +authors: + - "@Vivian0105" diff --git a/modules/nf-core/presto/pairseq/tests/main.nf.test b/modules/nf-core/presto/pairseq/tests/main.nf.test new file mode 100644 index 000000000000..9dacd6062720 --- /dev/null +++ b/modules/nf-core/presto/pairseq/tests/main.nf.test @@ -0,0 +1,42 @@ +nextflow_process { + + name "Test Process PRESTO_PAIRSEQ" + script "../main.nf" + process "PRESTO_PAIRSEQ" + + tag "modules" + tag "modules_nfcore" + tag "presto" + tag "presto/pairseq" + + test("homo_sapiens - fastq") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_airrseq_umi_R1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_airrseq_R2.fastq.gz', checkIfExists: true), + ] + input[1] = "" + """ + } + } + + then { + + assertAll( + { assert process.success}, + { assert snapshot( + process.out.reads.get(0).get(1), + process.out.reads.get(0).get(2) + ).match("test_snap_out")}, + { assert snapshot( + process.out.versions_presto).match("test_snap_versions") + }, + { assert path(process.out.logs.get(0)).getText().contains("PASS") } + ) + } + } +} diff --git a/modules/nf-core/presto/pairseq/tests/main.nf.test.snap b/modules/nf-core/presto/pairseq/tests/main.nf.test.snap new file mode 100644 index 000000000000..ff5138d3fee4 --- /dev/null +++ b/modules/nf-core/presto/pairseq/tests/main.nf.test.snap @@ -0,0 +1,35 @@ +{ + "test_snap_out": { + "content": [ + [ + "test-1_pair-pass.fastq.gz:md5,7f98eefe4c7111d4632685680b6b9a4b", + "test-2_pair-pass.fastq.gz:md5,51220f557d95ab70c0819e9a3e8e593a" + ], + [ + "test-1_pair-pass.fastq.gz:md5,7f98eefe4c7111d4632685680b6b9a4b", + "test-2_pair-pass.fastq.gz:md5,51220f557d95ab70c0819e9a3e8e593a" + ] + ], + "timestamp": "2026-07-01T11:37:32.233234794", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.4" + } + }, + "test_snap_versions": { + "content": [ + [ + [ + "PRESTO_PAIRSEQ", + "presto", + "0.7.9" + ] + ] + ], + "timestamp": "2026-07-01T11:37:32.31243821", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.4" + } + } +} \ No newline at end of file