Skip to content

Commit d5a80a3

Browse files
takiifujita-uicharles-plessyTakahiro Fujitaamirata051Lea Picard
authored
New macse refinealignment (#10586)
* nf-core template for macse/refinealignment * First commit by Takii * Modified for main.nf * Remove TODO comment about optional inputs support Removed outdated TODO comment regarding optional inputs. * update on nf.test * fixed meta.yml * update meta.yml and delete TODO statements * all TODO statements removed and meta updated * add fa format * Updated main nf test * fixed with lint * change expression of obtaining version * Lint and fixed meta.yml * fixed meta.yml * lint fixed it * Solved problem of last PR * Changed depends on comment * Corrected test data URL to nf-core/test-datasets * fixed lint problem * fixed to correct test URL * Corrected URL expression in main.nf.test * fixed lint problem --------- Co-authored-by: Charles Plessy <charles.plessy@oist.jp> Co-authored-by: Takahiro Fujita <takahiro-fujita@deigo-login1.oist.jp> Co-authored-by: Amirata Ghaffarian <amirata.gh.m.n@gmail.com> Co-authored-by: Lea Picard <lea-picard@deigo-login3.oist.jp> Co-authored-by: Patricia Carolina Muskus Veitia <patricia-muskus@deigo-login4.oist.jp> Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> Co-authored-by: Takahiro Fujita <takahiro-fujita@deigo-login2.oist.jp> Co-authored-by: Takahiro Fujita <takahiro-fujita@deigo-login4.oist.jp> Co-authored-by: Cameron Lloyd <lloyd@med.unideb.hu> Co-authored-by: Takahiro Fujita <takahiro-fujita@deigo-login3.oist.jp>
1 parent 7773ae1 commit d5a80a3

File tree

5 files changed

+274
-0
lines changed

5 files changed

+274
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
3+
channels:
4+
- conda-forge
5+
- bioconda
6+
dependencies:
7+
- "bioconda::macse=2.07"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
process MACSE_REFINEALIGNMENT {
2+
tag "${meta}"
3+
label 'process_low'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
7+
? 'https://depot.galaxyproject.org/singularity/macse:2.07--hdfd78af_0'
8+
: 'biocontainers/macse:2.07--hdfd78af_0'}"
9+
10+
input:
11+
tuple val(meta), path(fasta)
12+
13+
output:
14+
tuple val(meta), path("*_NT.{fa,fas,fasta,aln}"), emit: nt
15+
tuple val(meta), path("*_AA.{fa,fas,fasta,aln}"), emit: aa
16+
tuple val("${task.process}"), val("macse"), eval("macse --version | sed -n 's/.*V\\([0-9]*\\.[0-9]*\\).*/\\1/p'"), topic: versions, emit: versions_macse
17+
18+
when:
19+
task.ext.when == null || task.ext.when
20+
21+
script:
22+
def args = task.ext.args ?: ''
23+
def prefix = task.ext.prefix ?: fasta.baseName
24+
25+
"""
26+
sed '/^>/!s/[[:space:]]//g' ${fasta} > ${prefix}.clean.fasta
27+
28+
macse -prog refineAlignment \\
29+
-align ${prefix}.clean.fasta \\
30+
${args}
31+
"""
32+
33+
stub:
34+
def prefix = task.ext.prefix ?: fasta.baseName
35+
"""
36+
echo ${args}
37+
touch ${prefix}_NT.fas
38+
touch ${prefix}_AA.fas
39+
"""
40+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: "macse_refinealignment"
2+
description: improves the input nucleotide alignment in a codon-aware manner
3+
keywords:
4+
- multiple sequence alignment
5+
- codon-aware
6+
- fasta
7+
tools:
8+
- "macse":
9+
description: "MACSE: Multiple Alignment of Coding SEquences Accounting for Frameshifts
10+
and Stop Codons."
11+
homepage: https://www.agap-ge2pop.org/macse/
12+
documentation: https://www.agap-ge2pop.org/macse/macse-documentation/
13+
tool_dev_url: https://github.com/nf-core/masce
14+
doi: "10.1371/journal.pone.0022594"
15+
licence:
16+
- "CeCILL 2.1"
17+
identifier: biotools:macse
18+
input:
19+
- - meta:
20+
type: map
21+
description: |
22+
Groovy Map containing sample information
23+
e.g. [ id:'test', single_end:false ]
24+
- fasta:
25+
type: file
26+
description: Aligned sequences in FASTA format. May be gzipped or
27+
uncompressed.
28+
pattern: "*.{fa,fas,fasta,aln}"
29+
ontologies:
30+
- edam: http://edamontology.org/format_2554
31+
- edam: http://edamontology.org/format_1921
32+
- edam: http://edamontology.org/format_1984
33+
output:
34+
nt:
35+
- - meta:
36+
type: map
37+
description: |
38+
Groovy Map containing sample information
39+
e.g. [ id:'test', single_end:false ]
40+
- "*_NT.{fa,fas,fasta,aln}":
41+
type: file
42+
description: Aligned sequences in FASTA format. May be gzipped or
43+
uncompressed.
44+
pattern: "*_NT.{fa,fas,fasta,aln}"
45+
ontologies:
46+
- edam: http://edamontology.org/format_2554
47+
- edam: http://edamontology.org/format_1921
48+
- edam: http://edamontology.org/format_1984
49+
aa:
50+
- - meta:
51+
type: map
52+
description: |
53+
Groovy Map containing sample information
54+
e.g. [ id:'test', single_end:false ]
55+
- "*_AA.{fa,fas,fasta,aln}":
56+
type: file
57+
description: Aligned sequences in FASTA format. May be gzipped or
58+
uncompressed.
59+
pattern: "*_AA.{fa,fas,fasta,aln}"
60+
ontologies:
61+
- edam: http://edamontology.org/format_2554
62+
- edam: http://edamontology.org/format_1921
63+
- edam: http://edamontology.org/format_1984
64+
versions_macse:
65+
- - "${task.process}":
66+
type: string
67+
description: The name of the process
68+
- macse:
69+
type: string
70+
description: The name of the tool
71+
- "macse --version | sed -n 's/.*V\\([0-9]*\\.[0-9]*\\).*/\\1/p'":
72+
type: eval
73+
description: The expression to obtain the version of the tool
74+
topics:
75+
versions:
76+
- - "${task.process}":
77+
type: string
78+
description: The name of the process
79+
- macse:
80+
type: string
81+
description: The name of the tool
82+
- "macse --version | sed -n 's/.*V\\([0-9]*\\.[0-9]*\\).*/\\1/p'":
83+
type: eval
84+
description: The expression to obtain the version of the tool
85+
authors:
86+
- "@charles-plessy"
87+
- "@pmuskusv"
88+
- "@takiifujita-ui"
89+
- "@leapicard"
90+
maintainers:
91+
- "@leapicard"
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// nf-core modules test macse/refinealignment
2+
nextflow_process {
3+
4+
name "Test Process MACSE_REFINEALIGNMENT"
5+
script "../main.nf"
6+
process "MACSE_REFINEALIGNMENT"
7+
8+
tag "modules"
9+
tag "modules_nfcore"
10+
tag "macse"
11+
tag "macse/refinealignment"
12+
13+
test("Raphidioptera - fasta") {
14+
when {
15+
process {
16+
"""
17+
input[0] = [
18+
[ id:'test' ],
19+
file(params.modules_testdata_base_path + 'genomics/eukaryotes/Raphidioptera/Raphidioptera_BOLD_COI_final_align_NT.aln', checkIfExists: true),
20+
]
21+
"""
22+
}
23+
}
24+
25+
then {
26+
assertAll(
27+
{ assert process.success },
28+
{ assert snapshot (
29+
process.out.aa,
30+
process.out.nt,
31+
process.out.findAll { key, val -> key.startsWith("versions")}
32+
).match()}
33+
)
34+
}
35+
36+
}
37+
38+
test("Raphidioptera - fasta - stub") {
39+
40+
options "-stub"
41+
42+
when {
43+
process {
44+
"""
45+
input[0] = [
46+
[ id:'test' ],
47+
file(params.modules_testdata_base_path + 'genomics/eukaryotes/Raphidioptera/Raphidioptera_BOLD_COI_final_align_NT.aln', checkIfExists: true),
48+
]
49+
"""
50+
}
51+
}
52+
53+
then {
54+
assertAll(
55+
{ assert process.success },
56+
{ assert snapshot (
57+
process.out.aa,
58+
process.out.nt,
59+
process.out.findAll { key, val -> key.startsWith("versions")}
60+
).match()}
61+
)
62+
}
63+
64+
}
65+
66+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"Raphidioptera - fasta": {
3+
"content": [
4+
[
5+
[
6+
{
7+
"id": "test"
8+
},
9+
"Raphidioptera_BOLD_COI_final_align_NT.clean_AA.fasta:md5,360a9975879ec3786ecd3519b06db0d7"
10+
]
11+
],
12+
[
13+
[
14+
{
15+
"id": "test"
16+
},
17+
"Raphidioptera_BOLD_COI_final_align_NT.clean_NT.fasta:md5,8c967ce79c68e25e75969779a23c2dd0"
18+
]
19+
],
20+
{
21+
"versions_macse": [
22+
[
23+
"MACSE_REFINEALIGNMENT",
24+
"macse",
25+
"2.07"
26+
]
27+
]
28+
}
29+
],
30+
"meta": {
31+
"nf-test": "0.9.3",
32+
"nextflow": "25.10.4"
33+
},
34+
"timestamp": "2026-03-19T15:41:21.463432407"
35+
},
36+
"Raphidioptera - fasta - stub": {
37+
"content": [
38+
[
39+
[
40+
{
41+
"id": "test"
42+
},
43+
"Raphidioptera_BOLD_COI_final_align_NT_AA.fas:md5,d41d8cd98f00b204e9800998ecf8427e"
44+
]
45+
],
46+
[
47+
[
48+
{
49+
"id": "test"
50+
},
51+
"Raphidioptera_BOLD_COI_final_align_NT_NT.fas:md5,d41d8cd98f00b204e9800998ecf8427e"
52+
]
53+
],
54+
{
55+
"versions_macse": [
56+
[
57+
"MACSE_REFINEALIGNMENT",
58+
"macse",
59+
"2.07"
60+
]
61+
]
62+
}
63+
],
64+
"meta": {
65+
"nf-test": "0.9.3",
66+
"nextflow": "25.10.4"
67+
},
68+
"timestamp": "2026-03-19T15:41:36.724574677"
69+
}
70+
}

0 commit comments

Comments
 (0)