Skip to content

Commit

Permalink
Add mafft guidetree (nf-core#7097)
Browse files Browse the repository at this point in the history
* move mafft to mafft_align

* add mafft guidetree

* update mafft align

* add mafft guidetree tests

* fixes

* up

* update other mafft tests

* update mafft

* fix

* don't lint deleted files

* filter out main.nf.test and main.nf.snapshot

* try different strategy

* fix other

* fix other

* add tests

* remove pytest

* up

* update nftest

* fix

---------

Co-authored-by: mashehu <[email protected]>
  • Loading branch information
2 people authored and LouisLeNezet committed Dec 4, 2024
1 parent a35192c commit a0657ec
Show file tree
Hide file tree
Showing 24 changed files with 502 additions and 91 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ jobs:
with:
filters: |
modules:
- 'modules/nf-core/**'
- 'tests/modules/nf-core/**'
- added|modified: 'modules/nf-core/**'
- added|modified: 'tests/modules/nf-core/**'
subworkflows:
- 'subworkflows/nf-core/**'
- 'tests/subworkflows/nf-core/**'
- added|modified: 'subworkflows/nf-core/**'
- added|modified: 'tests/subworkflows/nf-core/**'
token: ""
list-files: "json"

Expand All @@ -84,7 +84,7 @@ jobs:
.replace('modules/nf-core/', '')
.split('/')
.slice(0, 2)
.filter(x => x !== 'main.nf' && x !== 'tests' && x !== 'meta.yml' && x !== 'environment.yml')
.filter(x => !x.startsWith('main.nf') && x !== 'tests' && x !== 'meta.yml' && x !== 'environment.yml')
.join('/'))
)
];
Expand Down
14 changes: 14 additions & 0 deletions modules/nf-core/epang/split/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,18 @@ process EPANG_SPLIT {
epang: \$(echo \$(epa-ng --version 2>&1) | sed 's/^EPA-ng v//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_query.fasta
gzip ${prefix}_query.fasta
touch ${prefix}_reference.fasta
gzip ${prefix}_reference.fasta
cat <<-END_VERSIONS > versions.yml
"${task.process}":
epang: \$(echo \$(epa-ng --version 2>&1) | sed 's/^EPA-ng v//')
END_VERSIONS
"""
}
83 changes: 83 additions & 0 deletions modules/nf-core/epang/split/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "epang"
tag "epang/split"
tag "mafft/align"

setup {
run("MAFFT_ALIGN") {
script "../../../mafft/align/main.nf"
process {
"""
input[0] = [ [ id:'test', single_end:false ], // meta map
file('https://raw.githubusercontent.com/nf-core/test-datasets/phyloplace/testdata/PF14720_seed.alnfaa', checkIfExists: true)
]
input[1] = [[id:"test2"],
file('https://raw.githubusercontent.com/nf-core/test-datasets/phyloplace/testdata/PF14720_3_sequences.faa', checkIfExists: true)
]
input[2] = [[:],[]]
input[3] = [[:],[]]
input[4] = [[:],[]]
input[5] = [[:],[]]
input[6] = false
"""
}
}
}


test("PF14720") {

when {
process {
"""
input[0] = MAFFT_ALIGN.out.fas.map {
[
[ id:'test'],
file('https://raw.githubusercontent.com/nf-core/test-datasets/phyloplace/testdata/PF14720_seed.alnfaa', checkIfExists: true),
it[1]
]
}
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}


test("PF14720 - stub") {
options "-stub"
when {
process {
"""
input[0] = MAFFT_ALIGN.out.fas.map {
[
[ id:'test'],
file('https://raw.githubusercontent.com/nf-core/test-datasets/phyloplace/testdata/PF14720_seed.alnfaa', checkIfExists: true),
it[1]
]
}
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}
}
100 changes: 100 additions & 0 deletions modules/nf-core/epang/split/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"PF14720 - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test_query.fasta.gz:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test"
},
"test_reference.fasta.gz:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
"versions.yml:md5,83ff91cc742cb443b1793f2b28dbf21a"
],
"query": [
[
{
"id": "test"
},
"test_query.fasta.gz:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"reference": [
[
{
"id": "test"
},
"test_reference.fasta.gz:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,83ff91cc742cb443b1793f2b28dbf21a"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.1"
},
"timestamp": "2024-11-27T15:15:38.13000903"
},
"PF14720": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.query.fasta.gz:md5,ff1159ff8a5d2587fb20309a81da3c29"
]
],
"1": [
[
{
"id": "test"
},
"test.reference.fasta.gz:md5,e7753871101c48c42fc417ce0e9b398a"
]
],
"2": [
"versions.yml:md5,83ff91cc742cb443b1793f2b28dbf21a"
],
"query": [
[
{
"id": "test"
},
"test.query.fasta.gz:md5,ff1159ff8a5d2587fb20309a81da3c29"
]
],
"reference": [
[
{
"id": "test"
},
"test.reference.fasta.gz:md5,e7753871101c48c42fc417ce0e9b398a"
]
],
"versions": [
"versions.yml:md5,83ff91cc742cb443b1793f2b28dbf21a"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.1"
},
"timestamp": "2024-11-27T14:47:33.857838942"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/epang/split/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
epang/split:
- "modules/nf-core/epang/split/**"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process MAFFT {
process MAFFT_ALIGN {
tag "$meta.id"
label 'process_high'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: mafft
name: mafft_align
description: Multiple sequence alignment using MAFFT
keywords:
- fasta
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
nextflow_process {

name "Test Process MAFFT"
name "Test Process MAFFT_ALIGN"
script "../main.nf"
process "MAFFT"
process "MAFFT_ALIGN"
tag "modules"
tag "modules_nfcore"
tag "mafft"
tag "mafft/align"

test("SARS-CoV-2 scaffolds fasta - uncompressed") {
when {
Expand Down
Loading

0 comments on commit a0657ec

Please sign in to comment.