Skip to content
Open
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
7 changes: 7 additions & 0 deletions modules/nf-core/presto/pairseq/environment.yml
Original file line number Diff line number Diff line change
@@ -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"
44 changes: 44 additions & 0 deletions modules/nf-core/presto/pairseq/main.nf
Original file line number Diff line number Diff line change
@@ -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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will using the same glob not resulting in both channels having both reads? Can't you somehow distinguish between read 1 and read 2 in the output to preserve the order?

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
"""
}
89 changes: 89 additions & 0 deletions modules/nf-core/presto/pairseq/meta.yml
Original file line number Diff line number Diff line change
@@ -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"
42 changes: 42 additions & 0 deletions modules/nf-core/presto/pairseq/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -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") }
)
Comment on lines +29 to +39

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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") }
)
assert process.success
assertAll(
{ assert snapshot(
process.out.reads,
process.out.findAll { key, val -> key.startsWith("versions") }
).match() },
{ assert path(process.out.logs.get(0)).getText().contains("PASS") }
)

a bit more compact way to write this

}
}
}
35 changes: 35 additions & 0 deletions modules/nf-core/presto/pairseq/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -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"
}
}
}