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
6 changes: 6 additions & 0 deletions modules/nf-core/smudgeplot/all/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::fastk=1.2
- bioconda::smudgeplot=0.5.3
45 changes: 45 additions & 0 deletions modules/nf-core/smudgeplot/all/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
process SMUDGEPLOT_ALL {
tag "${meta.id}"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/32/320648514649f5379149eed196b162e0d409b785f670ddecdf948febd6917377/data':
'community.wave.seqera.io/library/fastk_smudgeplot:1352fed7dbb39646' }"

input:
tuple val(meta), path(smu)

output:
tuple val(meta), path("*.png"), emit: png
tuple val(meta), path("*_centralities.txt"), emit: centrality_txt
tuple val(meta), path("*.smudge_report.tsv"), emit: smudge_report
tuple val(meta), path("*.sma"), emit: sma
tuple val("${task.process}"), val('smudgeplot'), eval('smudgeplot -v |& sed "s/.*v//"'), emit: versions_smudgeplot, topic: versions
// FASTK does not report version to cli
tuple val("${task.process}"), val('fastk'), val('1.2'), emit: versions_fastk, topic: versions

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

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

// Export HOME to avoid issues with MATPLOTLIB needing a
// writable config directory
"""
export HOME=\$PWD/nxf_home

smudgeplot all \\
${args} \\
-o ${prefix} \\
${smu}
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.smu
"""
}
121 changes: 121 additions & 0 deletions modules/nf-core/smudgeplot/all/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: "smudgeplot_all"
description: Generating smudgeplot k-mer inference plots
keywords:
- Smudgeplot
- reference-free
- kmer
- plots
tools:
- "smudgeplot":
description: "Generating smudgeplot kmer counts"
homepage: "https://github.com/KamilSJaron/smudgeplot"
tool_dev_url: "https://github.com/KamilSJaron/smudgeplot"
licence: ["https://github.com/KamilSJaron/smudgeplot/blob/master/LICENSE.md"]
identifier: ""
input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- smu:
type: file
description: Smudgeplot kmer coverage flat file
pattern: "*.smu"
ontologies: []

output:
png:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.png":
type: file
description: Collection of output PNG files
pattern: "*.png"
ontologies:
- edam: http://edamontology.org/format_3603 # PNG
centrality_txt:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*_centralities.txt":
type: file
description: Centrality of kmers text file
pattern: "*_centralities.txt"
ontologies:
- edam: http://edamontology.org/format_2330
smudge_report:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.smudge_report.tsv":
type: file
description: Full smudgeplot report of smudges
pattern: "*.smudge_report.tsv"
ontologies:
- edam: http://edamontology.org/format_3475 # TSV
sma:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.sma":
type: file
description: Smudgeplot Kmer coverage file
pattern: "*.sma"
ontologies: []

versions_smudgeplot:
- - ${task.process}:
type: string
description: Name of the process
- smudgeplot:
type: string
description: The name of the tool
- smudgeplot -v |& sed "s/.*v//":
type: string
description: The expression to obtain the version of the tool
versions_fastk:
- - ${task.process}:
type: string
description: Name of the process
- fastk:
type: string
description: Name of the tool
- "1.2":
type: string
description: The expression to obtain the version of the tool

topics:
versions:
- - ${task.process}:
type: string
description: Name of the process
- smudgeplot:
type: string
description: The name of the tool
- smudgeplot -v |& sed "s/.*v//":
type: string
description: The expression to obtain the version of the tool
- - ${task.process}:
type: string
description: Name of the process
- fastk:
type: string
description: Name of the tool
- "1.2":
type: string
description: The expression to obtain the version of the tool

authors:
- "@DLBPointon"
maintainers:
- "@DLBPointon"
55 changes: 55 additions & 0 deletions modules/nf-core/smudgeplot/all/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
nextflow_process {

name "Test Process SMUDGEPLOT_ALL"
script "../main.nf"
process "SMUDGEPLOT_ALL"

tag "modules"
tag "modules_nfcore"
tag "smudgeplot"
tag "smudgeplot/all"
tag "fastk/fastk"

setup {
run("FASTK_FASTK") {
script "modules/nf-core/fastk/fastk/main.nf"
config "./nextflow.config"
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file("https://tolit.cog.sanger.ac.uk/test-data/Acropora_cervicornis/genomic_data/m84093_241116_151316_s2.hifi_reads.bc2028.subset.fasta.gz", checkIfExists: true)
]
"""
}
}

run("SMUDGEPLOT_HETMERS") {
script "modules/nf-core/smudgeplot/hetmers/main.nf"
config "./nextflow.config"
process {
"""
input[0] = FASTK_FASTK.out.ktab
"""
}
}
}

test("Acropora_cervicornis - reads") {

when {
process {
"""
input[0] = SMUDGEPLOT_HETMERS.out.kmer_cov
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
}
31 changes: 31 additions & 0 deletions modules/nf-core/smudgeplot/all/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"Acropora_cervicornis - reads": {
"content": [
{
"centrality_txt": [

],
"png": [

],
"sma": [

],
"smudge_report": [

],
"versions_fastk": [

],
"versions_smudgeplot": [

]
}
],
"timestamp": "2026-09-15T12:16:22.673108219",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
}
}
9 changes: 9 additions & 0 deletions modules/nf-core/smudgeplot/all/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
process {
withName: "FASTK_FASTK" {
ext.args = { "-k31 -t -P." }
}

withName: "SMUDGEPLOT_HETMERS" {
ext.args = { "-L 12 -t2 -tmp ./ --verbose" }
}
}
6 changes: 6 additions & 0 deletions modules/nf-core/smudgeplot/hetmers/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::fastk=1.2
- bioconda::smudgeplot=0.5.3
43 changes: 43 additions & 0 deletions modules/nf-core/smudgeplot/hetmers/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
process SMUDGEPLOT_HETMERS {
tag "${meta.id}"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/32/320648514649f5379149eed196b162e0d409b785f670ddecdf948febd6917377/data':
'community.wave.seqera.io/library/fastk_smudgeplot:1352fed7dbb39646' }"

input:
tuple val(meta), path(fastk_table, stageAs: "ktab_dir/*")

output:
tuple val(meta), path("*.smu"), emit: kmer_cov
tuple val("${task.process}"), val('smudgeplot'), eval('smudgeplot -v |& sed "s/.*v//"'), emit: versions_smudgeplot, topic: versions
// FASTK does not report version to cli
tuple val("${task.process}"), val('fastk'), val('1.2'), emit: versions_fastk, topic: versions

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

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

// Export HOME to avoid issues with MATPLOTLIB needing a
// writable config directory
"""
export HOME=\$PWD/nxf_home

smudgeplot hetmers \\
${args} \\
-o ${prefix} \\
${fastk_table.find { path -> path.toString().endsWith(".ktab") }}

"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.smu
"""
}
Loading
Loading