Skip to content
Closed
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/any2fasta/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::any2fasta=0.8.1"
36 changes: 36 additions & 0 deletions modules/nf-core/any2fasta/main.nf
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.

You can run

nextflow lint -format -sort-declarations -spaces 4 -harshil-alignment

on this file to clean this up nicely.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
process ANY2FASTA {
tag "$meta.id"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/any2fasta:0.8.1--hdfd78af_0' :
'biocontainers/any2fasta:0.8.1--hdfd78af_0' }"

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

output:
tuple val(meta), path("*.fasta"), emit: fasta
tuple val("${task.process}"), val('any2fasta'), eval("any2fasta -v 2>&1 | head -1 | sed 's/any2fasta //'"), topic: versions, emit: versions_any2fasta

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
any2fasta \\
$args \\
${sequence} \\
> ${prefix}.fasta
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.fasta
"""
}
70 changes: 70 additions & 0 deletions modules/nf-core/any2fasta/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "any2fasta"
description: Convert various sequence formats (GenBank, GFF, FASTQ, FASTA, CLUSTAL, Stockholm, GFA) to FASTA format. Input files may be gzip, bzip2, zip, or zstd compressed.
keywords:
- fasta
- conversion
- sequences
- format
- genomics
tools:
- "any2fasta":
description: "Convert various sequence formats to FASTA"
homepage: "https://github.com/tseemann/any2fasta"
documentation: "https://github.com/tseemann/any2fasta"
tool_dev_url: "https://github.com/tseemann/any2fasta"
licence:
- "GPL-3.0"
identifier: biotools:any2fasta

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- sequence:
type: file
description: |
Input sequence file in any supported format (GenBank, GFF, FASTQ, FASTA,
CLUSTAL, Stockholm, GFA). May be gzip, bzip2, zip, or zstd compressed.
pattern: "*.{gb,gbk,fa,fasta,fna,fq,fastq,gff,gfa,clw,sth,gb.gz,gbk.gz,fa.gz,fasta.gz,fq.gz,fastq.gz}"

output:
fasta:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*.fasta":
type: file
description: Output sequences in FASTA format
pattern: "*.fasta"
versions_any2fasta:
- - ${task.process}:
type: string
description: The name of the process
- any2fasta:
type: string
description: The name of the tool
- "any2fasta -v 2>&1 | head -1 | sed 's/any2fasta //'":
type: eval
description: The expression to obtain the version of the tool

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

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

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

tag "modules"
tag "modules_nfcore"
tag "any2fasta"

test("sarscov2 - fastq.gz") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
]
"""
}
}

then {
assert process.success
assertAll(
{ assert snapshot(
process.out
).match() }
Comment on lines +27 to +29
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.

You can use

{ assert snapshot(sanitizeOutput(process.out)).match() }

to clean up the snapshot using nft-utils. It is used to clean process and workflow outputs by removing the numbered keys. This will create snapshots that are more easy to read by humans.

Suggested change
{ assert snapshot(
process.out
).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }

)
}

}

test("sarscov2 - fasta") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
]
"""
}
}

then {
assert process.success
assertAll(
{ assert snapshot(
process.out
).match() }
Comment on lines +51 to +53
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
{ assert snapshot(
process.out
).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }

)
}

}

test("sarscov2 - fastq.gz - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
]
"""
}
}

then {
assert process.success
assertAll(
{ assert snapshot(
process.out
).match() }
Comment on lines +77 to +79
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
{ assert snapshot(
process.out
).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }

)
}

}

}
131 changes: 131 additions & 0 deletions modules/nf-core/any2fasta/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"sarscov2 - fastq.gz": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": true
},
"test.fasta:md5,f0c5c9110ce19e9ebbc9a6b6baf9e105"
]
],
"1": [
[
"ANY2FASTA",
"any2fasta",
"0.8.1"
]
],
"fasta": [
[
{
"id": "test",
"single_end": true
},
"test.fasta:md5,f0c5c9110ce19e9ebbc9a6b6baf9e105"
]
],
"versions_any2fasta": [
[
"ANY2FASTA",
"any2fasta",
"0.8.1"
]
]
}
],
"timestamp": "2026-03-20T22:41:21.33769732",
"meta": {
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
},
"sarscov2 - fastq.gz - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": true
},
"test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
"ANY2FASTA",
"any2fasta",
"0.8.1"
]
],
"fasta": [
[
{
"id": "test",
"single_end": true
},
"test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_any2fasta": [
[
"ANY2FASTA",
"any2fasta",
"0.8.1"
]
]
}
],
"timestamp": "2026-03-20T22:41:37.656452506",
"meta": {
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
},
"sarscov2 - fasta": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": true
},
"test.fasta:md5,6e9fe4042a72f2345f644f239272b7e6"
]
],
"1": [
[
"ANY2FASTA",
"any2fasta",
"0.8.1"
]
],
"fasta": [
[
{
"id": "test",
"single_end": true
},
"test.fasta:md5,6e9fe4042a72f2345f644f239272b7e6"
]
],
"versions_any2fasta": [
[
"ANY2FASTA",
"any2fasta",
"0.8.1"
]
]
}
],
"timestamp": "2026-03-20T22:41:29.533525971",
"meta": {
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/circlator/all/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::circlator=1.5.5"
40 changes: 40 additions & 0 deletions modules/nf-core/circlator/all/main.nf
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.

You can run

nextflow lint -format -sort-declarations -spaces 4 -harshil-alignment

on this file to clean this up nicely.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
process CIRCLATOR_ALL {
tag "$meta.id"
label 'process_high'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/circlator:1.5.5--py35_0':
'biocontainers/circlator:1.5.5--py35_0' }"

input:
tuple val(meta), path(assembly)
tuple val(meta2), path(reads)
Comment on lines +11 to +12
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.

Can we put all these inputs into one tuple? That will make sure you're sure that EVERY time everything comes together in the right combination.


output:
tuple val(meta), path("${prefix}"), emit: results
tuple val(meta), path("${prefix}/*.fasta"), emit: fasta
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.

Can we move the output fasta out of that folder and emit just the fasta?

What are other outputs of this module?

tuple val("${task.process}"), val('circlator'), eval("circlator version"), topic: versions, emit: versions_circlator

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

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
circlator all \\
$args \\
--threads $task.cpus \\
${assembly} \\
${reads} \\
${prefix}
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"
"""
mkdir -p ${prefix}
touch ${prefix}/06.fixstart.fasta
"""
}
Loading
Loading