Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
14 changes: 8 additions & 6 deletions modules/nf-core/tcoffee/align/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ process TCOFFEE_ALIGN {
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def tree_args = tree ? "-usetree $tree" : ""
def template_args = template ? "-template_file $template" : ""
def outfile = compress ? "stdout" : "${prefix}.aln"
def write_output = compress ? " | pigz -cp ${task.cpus} > ${prefix}.aln.gz" : ""
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def tree_args = tree ? "-usetree $tree" : ""
def template_args = template ? "-template_file $template" : ""
def outfile = compress ? "stdout" : "${prefix}.aln"
def default_out_format = ("-output" in "${args}") ? "" : "-output fasta_aln"
def write_output = compress ? " | pigz -cp ${task.cpus} > ${prefix}.aln.gz" : ""
"""
export TEMP='./'
export TMP_4_TCOFFEE="./"
Expand All @@ -37,6 +38,7 @@ process TCOFFEE_ALIGN {
$tree_args \
$template_args \
$args \
$default_out_format \
-thread ${task.cpus} \
-outfile $outfile \
$write_output
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/tcoffee/align/tests/lib.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
process {
ext.args = { "-output fasta_aln -out_lib=sample_lib1.tc_lib" }
ext.args = { "-out_lib=sample_lib1.tc_lib" }
}
7 changes: 0 additions & 7 deletions modules/nf-core/tcoffee/align/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ nextflow_process {

test("align_sequence - compressed - seatoxin") {

config "./sequence.config"

when {
process {
"""
Expand All @@ -39,8 +37,6 @@ nextflow_process {

test("align_sequence - uncompressed - seatoxin") {

config "./sequence.config"

when {
process {
"""
Expand All @@ -65,8 +61,6 @@ nextflow_process {

test("align_with_guide_tree - uncompressed - seatoxin") {

config "./tree.config"

setup {

run("FAMSA_GUIDETREE") {
Expand Down Expand Up @@ -176,7 +170,6 @@ nextflow_process {

test("align_sequence - uncompressed - seatoxin - stub") {
options "-stub"
config "./sequence.config"

when {
process {
Expand Down
3 changes: 0 additions & 3 deletions modules/nf-core/tcoffee/align/tests/sequence.config

This file was deleted.

5 changes: 0 additions & 5 deletions modules/nf-core/tcoffee/align/tests/tree.config

This file was deleted.

12 changes: 7 additions & 5 deletions modules/nf-core/tcoffee/regressive/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,20 @@ process TCOFFEE_REGRESSIVE {
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def tree_args = tree ? "-reg_tree $tree" : ""
def template_args = template ? "-template_file $template" : ""
def outfile = compress ? "stdout" : "${prefix}.aln"
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def tree_args = tree ? "-reg_tree $tree" : ""
def template_args = template ? "-template_file $template" : ""
def default_out_format = ("-output" in "${args}") ? "" : "-output fasta_aln"
def outfile = compress ? "stdout" : "${prefix}.aln"
"""
export TEMP='./'
t_coffee -reg \
-seq ${fasta} \
$tree_args \
$template_args \
$args \
$default_out_format \
-reg_thread ${task.cpus} \
-outfile $outfile

Expand Down
7 changes: 0 additions & 7 deletions modules/nf-core/tcoffee/regressive/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ nextflow_process {

test("align_sequence - compressed - seatoxin") {

config "./sequence.config"

when {
process {
"""
Expand All @@ -39,8 +37,6 @@ nextflow_process {

test("align_sequence - uncompressed - seatoxin") {

config "./sequence.config"

when {
process {
"""
Expand All @@ -65,8 +61,6 @@ nextflow_process {

test("align_with_guide_tree - uncompressed - seatoxin") {

config "./tree.config"

setup {

run("FAMSA_GUIDETREE") {
Expand Down Expand Up @@ -107,7 +101,6 @@ nextflow_process {

test("align_sequence - uncompressed - seatoxin - stub") {
options "-stub"
config "./sequence.config"

when {
process {
Expand Down
3 changes: 0 additions & 3 deletions modules/nf-core/tcoffee/regressive/tests/sequence.config

This file was deleted.

5 changes: 0 additions & 5 deletions modules/nf-core/tcoffee/regressive/tests/tree.config

This file was deleted.

2 changes: 1 addition & 1 deletion modules/nf-core/tcoffee/tcs/tests/lib.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
process {

withName: "TCOFFEE_ALIGN"{
ext.args = { "-output fasta_aln -out_lib sample_lib1.tc_lib" }
ext.args = { "-out_lib sample_lib1.tc_lib" }
}

}
16 changes: 16 additions & 0 deletions subworkflows/nf-core/mafft_align/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
include { MAFFT_ALIGN as MAFFT_ALIGN_MODULE } from '../../../modules/nf-core/mafft/align/main'

workflow MAFFT_ALIGN {

take:
ch_fasta // channel: [ val(meta), fasta ]

main:

MAFFT_ALIGN_MODULE ( ch_fasta, [[], []], [[], []], [[], []], [[], []], [[], []], [] )

emit:
// TODO nf-core: edit emitted channels
alignment = MAFFT_ALIGN_MODULE.out.fas // channel: [ val(meta), *.fas ]
versions = MAFFT_ALIGN_MODULE.out.versions // channel: [ versions.yml ]
}
60 changes: 60 additions & 0 deletions subworkflows/nf-core/mafft_align/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json
name: "mafft_align"
description: Prepare channels for running MAFFT/align
keywords:
- msa
- mafft
- align
components:
- mafft/align
input:
- ch_fasta:
type: file
description: |
The input channel containing the FASTA files
pattern: "*.{bam/cram/sam}"
structure:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- fasta:
type: file
description: Input sequences in FASTA format
pattern: "*.{fa,fasta}"
ontologies:
- edam: http://edamontology.org/format_1929
output:
- alignment:
type: file
description: Channel containing the alignment file in fasta format.
structure:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test']`
- "*.aln.gz":
type: file
description: Alignment file, in FASTA format.
pattern: "*.aln.gz"
ontologies:
- edam: http://edamontology.org/format_1984
- versions:
type: file
description: Channel containing the software versions YAML file
structure:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML

authors:
- "@mirpedrol"
maintainers:
- "@mirpedrol"
- "@luisas"
- "@JoseEspinosa"
36 changes: 36 additions & 0 deletions subworkflows/nf-core/mafft_align/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
nextflow_workflow {

name "Test Subworkflow MAFFT_ALIGN"
script "../main.nf"
workflow "MAFFT_ALIGN"

tag "subworkflows"
tag "subworkflows_nfcore"
tag "subworkflows/mafft_align"
tag "mafft"
tag "mafft/align"


test("seatoxin-ref - fasta") {

when {
workflow {
"""
input[0] = [
[ [ id:'test' ] ], // meta map
file(params.modules_testdata_base_path + 'genomics/eukaryotes/anemonia_sulcata/seatoxin-ref.aln', checkIfExists: true),
]
"""
}
}
then {
assert workflow.success
assertAll(
{ assert snapshot(
workflow.out
).match() }
)
}
}

}
39 changes: 39 additions & 0 deletions subworkflows/nf-core/mafft_align/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"seatoxin-ref - fasta": {
"content": [
{
"0": [
[
[
{
"id": "test"
}
],
"[test].fas:md5,d443a4d46c7d85f5ea5f5f73148c6f34"
]
],
"1": [
"versions.yml:md5,e84c35bc0c2b5e69b0e70e5063a04b00"
],
"alignment": [
[
[
{
"id": "test"
}
],
"[test].fas:md5,d443a4d46c7d85f5ea5f5f73148c6f34"
]
],
"versions": [
"versions.yml:md5,e84c35bc0c2b5e69b0e70e5063a04b00"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.8"
},
"timestamp": "2025-12-10T10:56:30.188643"
}
}
Loading