Skip to content
Merged
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
1 change: 1 addition & 0 deletions modules/nf-core/nanomonsv/parse/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::htslib=1.21
- bioconda::nanomonsv=0.8.0
- conda-forge::python=3.12.9
42 changes: 16 additions & 26 deletions modules/nf-core/nanomonsv/parse/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -19,48 +19,38 @@ process NANOMONSV_PARSE {
tuple val(meta), path("${prefix}.rearrangement.sorted.bedpe.gz.tbi"), emit: rearrangements_index
tuple val(meta), path("${prefix}.bp_info.sorted.bed.gz") , emit: bp_info
tuple val(meta), path("${prefix}.bp_info.sorted.bed.gz.tbi") , emit: bp_info_index
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('nanomonsv'), eval("nanomonsv --version 2>&1 | sed 's/^nanomonsv //'") , topic: versions, emit: versions_nanomonsv
tuple val("${task.process}"), val('mafft'), eval("mafft --version 2>&1 | sed 's/^v//; s/ (.*//'") , topic: versions, emit: versions_mafft
tuple val("${task.process}"), val('racon'), eval("racon --version 2>&1 | sed 's/^v//'") , topic: versions, emit: versions_racon
tuple val("${task.process}"), val('tabix'), eval("tabix --version 2>&1 | sed '1!d;s/^tabix (htslib) //'"), topic: versions, emit: versions_tabix
tuple val("${task.process}"), val('bgzip'), eval("bgzip --version 2>&1 | sed '1!d;s/^bgzip (htslib) //'"), topic: versions, emit: versions_bgzip
tuple val("${task.process}"), val('python'), eval("python3 --version | sed 's/Python //g'") , topic: versions, emit: versions_python

when:
task.ext.when == null || task.ext.when

script:
prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args ?: ''
"""
nanomonsv parse ${args} ${bam} ${prefix}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
nanomonsv: \$(echo \$(nanomonsv --version 2>&1) | sed 's/^nanomonsv //')
mafft: \$(echo \$(mafft --version 2>&1) | sed 's/^v//; s/ (.*//')
racon: \$(echo \$(racon --version 2>&1) | sed 's/^v//')
tabix: \$(echo \$(tabix --version 2>&1) | sed 's/^tabix (htslib) //; s/ Copyright.*//')
bgzip: \$(echo \$(bgzip --version 2>&1) | sed 's/^bgzip (htslib) //; s/ Copyright.*//')
python: \$(python3 --version | sed 's/Python //g')
END_VERSIONS
"""
nanomonsv parse \\
${args} \\
${bam} \\
${prefix}
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"

"""
echo | gzip > ${prefix}.insertion.sorted.bed.gz
echo "" | gzip > ${prefix}.insertion.sorted.bed.gz
touch ${prefix}.insertion.sorted.bed.gz.tbi
echo | gzip > ${prefix}.deletion.sorted.bed.gz
echo "" | gzip > ${prefix}.deletion.sorted.bed.gz
touch ${prefix}.deletion.sorted.bed.gz.tbi
echo | gzip > ${prefix}.rearrangement.sorted.bedpe.gz
echo "" | gzip > ${prefix}.rearrangement.sorted.bedpe.gz
touch ${prefix}.rearrangement.sorted.bedpe.gz.tbi
echo | gzip > ${prefix}.bp_info.sorted.bed.gz
echo "" | gzip > ${prefix}.bp_info.sorted.bed.gz
touch ${prefix}.bp_info.sorted.bed.gz.tbi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
nanomonsv: \$(echo \$(nanomonsv --version 2>&1) | sed 's/^nanomonsv //')
mafft: \$(echo \$(mafft --version 2>&1) | sed 's/^v//; s/ (.*//')
racon: \$(echo \$(racon --version 2>&1) | sed 's/^v//')
tabix: \$(echo \$(tabix --version 2>&1) | sed 's/^tabix (htslib) //; s/ Copyright.*//')
bgzip: \$(echo \$(bgzip --version 2>&1) | sed 's/^bgzip (htslib) //; s/ Copyright.*//')
python: \$(python3 --version | sed 's/Python //g')
END_VERSIONS
"""
}
145 changes: 135 additions & 10 deletions modules/nf-core/nanomonsv/parse/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ tools:
documentation: https://github.com/friend1ws/nanomonsv#commands
tool_dev_url: https://github.com/friend1ws/nanomonsv
doi: "10.1101/2020.07.22.214262 "
licence: ["GPL v3"]
licence:
- "GPL v3"
identifier: ""
input:
- - meta:
Expand Down Expand Up @@ -58,7 +59,8 @@ output:
e.g. [ id:'test', single_end:false ]
- ${prefix}.insertion.sorted.bed.gz.tbi:
type: file
description: Index for gzipped BED file containing reads supporting insertions
description: Index for gzipped BED file containing reads supporting
insertions
pattern: "*.{bed.gz.tbi}"
ontologies: []
deletions:
Expand All @@ -80,7 +82,8 @@ output:
e.g. [ id:'test', single_end:false ]
- ${prefix}.deletion.sorted.bed.gz.tbi:
type: file
description: Index for gzipped BED file containing reads supporting deletions
description: Index for gzipped BED file containing reads supporting
deletions
pattern: "*.{bed.gz.tbi}"
ontologies: []
rearrangements:
Expand All @@ -102,7 +105,8 @@ output:
e.g. [ id:'test', single_end:false ]
- ${prefix}.rearrangement.sorted.bedpe.gz.tbi:
type: file
description: Index for gzipped BED file containing reads supporting rearrangements
description: Index for gzipped BED file containing reads supporting
rearrangements
pattern: "*.{bed.gz.tbi}"
ontologies: []
bp_info:
Expand All @@ -127,13 +131,134 @@ output:
description: Index for gzipped BED file containing breakpoint info
pattern: "*.{bed.gz.tbi}"
ontologies: []
versions_nanomonsv:
- - ${task.process}:
type: string
description: The name of the process
- nanomonsv:
type: string
description: The name of the tool
- nanomonsv --version 2>&1 | sed 's/^nanomonsv //':
type: eval
description: The expression to obtain the version of the tool

versions_mafft:
- - ${task.process}:
type: string
description: The name of the process
- mafft:
type: string
description: The name of the tool
- mafft --version 2>&1 | sed 's/^v//; s/ (.*//':
type: eval
description: The expression to obtain the version of the tool

versions_racon:
- - ${task.process}:
type: string
description: The name of the process
- racon:
type: string
description: The name of the tool
- racon --version 2>&1 | sed 's/^v//':
type: eval
description: The expression to obtain the version of the tool

versions_tabix:
- - ${task.process}:
type: string
description: The name of the process
- tabix:
type: string
description: The name of the tool
- tabix --version 2>&1 | sed '1!d;s/^tabix (htslib) //':
type: eval
description: The expression to obtain the version of the tool

versions_bgzip:
- - ${task.process}:
type: string
description: The name of the process
- bgzip:
type: string
description: The name of the tool
- bgzip --version 2>&1 | sed '1!d;s/^bgzip (htslib) //':
type: eval
description: The expression to obtain the version of the tool

versions_python:
- - ${task.process}:
type: string
description: The name of the process
- python:
type: string
description: The name of the tool
- python3 --version | sed 's/Python //g':
type: eval
description: The expression to obtain the version of the tool

topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- - ${task.process}:
type: string
description: The name of the process
- nanomonsv:
type: string
description: The name of the tool
- nanomonsv --version 2>&1 | sed 's/^nanomonsv //':
type: eval
description: The expression to obtain the version of the tool

- - ${task.process}:
type: string
description: The name of the process
- mafft:
type: string
description: The name of the tool
- mafft --version 2>&1 | sed 's/^v//; s/ (.*//':
type: eval
description: The expression to obtain the version of the tool

- - ${task.process}:
type: string
description: The name of the process
- racon:
type: string
description: The name of the tool
- racon --version 2>&1 | sed 's/^v//':
type: eval
description: The expression to obtain the version of the tool

- - ${task.process}:
type: string
description: The name of the process
- tabix:
type: string
description: The name of the tool
- tabix --version 2>&1 | sed '1!d;s/^tabix (htslib) //':
type: eval
description: The expression to obtain the version of the tool

- - ${task.process}:
type: string
description: The name of the process
- bgzip:
type: string
description: The name of the tool
- bgzip --version 2>&1 | sed '1!d;s/^bgzip (htslib) //':
type: eval
description: The expression to obtain the version of the tool

- - ${task.process}:
type: string
description: The name of the process
- python:
type: string
description: The name of the tool
- python3 --version | sed 's/Python //g':
type: eval
description: The expression to obtain the version of the tool

authors:
- "@awgymer"
maintainers:
Expand Down
31 changes: 12 additions & 19 deletions modules/nf-core/nanomonsv/parse/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@ nextflow_process {
when {
process {
"""
input[0] = Channel.of(
[
[id:'control'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam.bai', checkIfExists:true)
]
)
input[0] = [
[id:'control'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam.bai', checkIfExists:true)
]
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
Expand All @@ -37,23 +35,18 @@ nextflow_process {
when {
process {
"""
input[0] = Channel.of(
[
[id:'control'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam.bai', checkIfExists:true)
]
)
input[0] = [
[id:'control'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam.bai', checkIfExists:true)
]
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out,
path(process.out.versions[0]).yaml
).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
Expand Down
Loading