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
11 changes: 4 additions & 7 deletions modules/nf-core/mafft/align/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ process MAFFT_ALIGN {

output:
tuple val(meta), path("*.fas{.gz,}"), emit: fas
tuple val("${task.process}"), val("mafft"), eval("mafft --version 2>&1 | sed 's/ (.*) //g'"), topic: versions, emit: versions_mafft
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("pigz"), eval("pigz --version 2>&1 | sed 's/pigz //g'") , topic: versions, emit: versions_pigz

when:
Expand Down Expand Up @@ -49,14 +49,11 @@ process MAFFT_ALIGN {
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
if ("$fasta" == "${prefix}.fas" ) error "Input and output names are the same, set prefix in module configuration to disambiguate!"
if ("${fasta}" == "${prefix}.fas" ) error "Input and output names are the same, set prefix in module configuration to disambiguate!"
"""
echo ${args}

if [[ "$compress" == "true" ]]; then
echo "" | pigz -cp ${task.cpus} > ${prefix}.fas.gz
if [[ "${compress}" == "true" ]]; then
echo "" | gzip > ${prefix}.fas.gz
else
touch ${prefix}.fas
fi
Expand Down
50 changes: 27 additions & 23 deletions modules/nf-core/mafft/align/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ keywords:
- multiple sequence alignment
tools:
- "mafft":
description: Multiple alignment program for amino acid or nucleotide sequences
based on fast Fourier transform
description: Multiple alignment program for amino acid or nucleotide
sequences based on fast Fourier transform
homepage: https://mafft.cbrc.jp/alignment/software/
documentation: https://mafft.cbrc.jp/alignment/software/manual/manual.html
tool_dev_url: https://mafft.cbrc.jp/alignment/software/source.html
doi: "10.1093/nar/gkf436"
licence: ["BSD"]
licence:
- "BSD"
identifier: biotools:MAFFT
- "pigz":
description: "Parallel implementation of the gzip algorithm."
Expand All @@ -27,8 +28,8 @@ input:
e.g. [ id:'test', single_end:false ]
- fasta:
type: file
description: FASTA file containing the sequences to align. May be gzipped or
uncompressed.
description: FASTA file containing the sequences to align. May be gzipped
or uncompressed.
pattern: "*.{fa,fasta}{.gz,}"
ontologies:
- edam: http://edamontology.org/format_1919 # SEQUENCE-LIKE
Expand All @@ -40,8 +41,8 @@ input:
e.g. [ id:'test', single_end:false ]
- add:
type: file
description: FASTA file containing sequences to align to the sequences in `fasta`
using `--add`. May be gzipped or uncompressed.
description: FASTA file containing sequences to align to the sequences in
`fasta` using `--add`. May be gzipped or uncompressed.
pattern: "*.{fa,fasta}{.gz,}"
ontologies:
- edam: http://edamontology.org/format_1919 # SEQUENCE-LIKE
Expand All @@ -53,8 +54,8 @@ input:
e.g. [ id:'test', single_end:false ]
- addfragments:
type: file
description: FASTA file containing sequences to align to the sequences in `fasta`
using `--addfragments`. May be gzipped or uncompressed.
description: FASTA file containing sequences to align to the sequences in
`fasta` using `--addfragments`. May be gzipped or uncompressed.
pattern: "*.{fa,fasta}{.gz,}"
ontologies:
- edam: http://edamontology.org/format_1919 # SEQUENCE-LIKE
Expand All @@ -66,8 +67,8 @@ input:
e.g. [ id:'test', single_end:false ]
- addfull:
type: file
description: FASTA file containing sequences to align to the sequences in `fasta`
using `--addfull`. May be gzipped or uncompressed.
description: FASTA file containing sequences to align to the sequences in
`fasta` using `--addfull`. May be gzipped or uncompressed.
pattern: "*.{fa,fasta}{.gz,}"
ontologies:
- edam: http://edamontology.org/format_1919 # SEQUENCE-LIKE
Expand All @@ -79,8 +80,8 @@ input:
e.g. [ id:'test', single_end:false ]
- addprofile:
type: file
description: FASTA file containing sequences to align to the sequences in `fasta`
using `--addprofile`. May be gzipped or uncompressed.
description: FASTA file containing sequences to align to the sequences in
`fasta` using `--addprofile`. May be gzipped or uncompressed.
pattern: "*.{fa,fasta}{.gz,}"
ontologies:
- edam: http://edamontology.org/format_1919 # SEQUENCE-LIKE
Expand All @@ -92,17 +93,17 @@ input:
e.g. [ id:'test', single_end:false ]
- addlong:
type: file
description: FASTA file containing sequences to align to the sequences in `fasta`
using `--addlong`. May be gzipped or uncompressed.
description: FASTA file containing sequences to align to the sequences in
`fasta` using `--addlong`. May be gzipped or uncompressed.
pattern: "*.{fa,fasta}{.gz,}"
ontologies:
- edam: http://edamontology.org/format_1919 # SEQUENCE-LIKE
- edam: http://edamontology.org/format_1929 # FASTA
- compress:
type: boolean
description: Flag representing whether the output MSA should be compressed. Set
to true to enable/false to disable compression. Compression is done using pigz,
and is multithreaded.
description: Flag representing whether the output MSA should be compressed.
Set to true to enable/false to disable compression. Compression is done
using pigz, and is multithreaded.
output:
fas:
- - meta:
Expand All @@ -112,7 +113,8 @@ output:
e.g. [ id:'test', single_end:false ]
- "*.fas{.gz,}":
type: file
description: Aligned sequences in FASTA format. May be gzipped or uncompressed.
description: Aligned sequences in FASTA format. May be gzipped or
uncompressed.
pattern: "*.fas{.gz,}"
ontologies:
- edam: http://edamontology.org/format_2554 # ALIGNMENT FORMAT TXT
Expand All @@ -125,9 +127,10 @@ output:
- mafft:
type: string
description: The tool name
- mafft --version 2>&1 | sed 's/ (.*) //g':
- mafft --version 2>&1 | sed 's/v//;s/ .*//':
type: eval
description: The tool version
description: The expression to obtain the version of the tool

versions_pigz:
- - ${task.process}:
type: string
Expand All @@ -147,9 +150,10 @@ topics:
- mafft:
type: string
description: The tool name
- mafft --version 2>&1 | sed 's/ (.*) //g':
- mafft --version 2>&1 | sed 's/v//;s/ .*//':
type: eval
description: The tool version
description: The expression to obtain the version of the tool

- - ${task.process}:
type: string
description: The process name
Expand Down
54 changes: 27 additions & 27 deletions modules/nf-core/mafft/align/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/scaffolds.fasta', checkIfExists: true)
]
input[1] = [[:], []]
Expand All @@ -29,7 +29,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

Expand All @@ -40,7 +40,7 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/scaffolds.fasta', checkIfExists: true)
]
input[1] = [[:], []]
Expand All @@ -56,7 +56,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

Expand All @@ -68,10 +68,10 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = [[ id:'test', single_end:false ], // meta map
input[1] = [[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/informative_sites.fas', checkIfExists: true)
]
input[2] = [[:], []]
Expand All @@ -86,7 +86,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
Expand All @@ -97,12 +97,12 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = [[:], []]
input[2] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/informative_sites.fas', checkIfExists: true)
]
input[3] = [[:], []]
Expand All @@ -116,7 +116,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
Expand All @@ -127,12 +127,12 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = [[:], []]
input[2] = [[:], []]
input[3] = [[ id:'test', single_end:false ], // meta map
input[3] = [[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/informative_sites.fas', checkIfExists: true)
]
input[4] = [[:], []]
Expand All @@ -145,7 +145,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

Expand All @@ -157,13 +157,13 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = [[:], []]
input[2] = [[:], []]
input[3] = [[:], []]
input[4] = [[ id:'test', single_end:false ], // meta map
input[4] = [[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/informative_sites.fas', checkIfExists: true)
]
input[5] = [[:], []]
Expand All @@ -175,7 +175,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

Expand All @@ -187,15 +187,15 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = [[:], []]
input[2] = [[:], []]
input[3] = [[:], []]
input[4] = [[:], []]
input[5] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/informative_sites.fas', checkIfExists: true)
]
input[6] = true
Expand All @@ -206,7 +206,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

Expand All @@ -218,15 +218,15 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/all_sites.fas', checkIfExists: true)
]
input[2] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/informative_sites.fas', checkIfExists: true)
]
input[3] = [[:], []]
Expand All @@ -240,7 +240,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

Expand All @@ -254,7 +254,7 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/scaffolds.fasta', checkIfExists: true)
]
input[1] = [[:], []]
Expand All @@ -270,7 +270,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

Expand All @@ -284,7 +284,7 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/scaffolds.fasta', checkIfExists: true)
]
input[1] = [[:], []]
Expand All @@ -300,7 +300,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

Expand Down
Loading