forked from nf-core/modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add foldmason * Add test * fix prettier * fix prettier * Update modules/nf-core/foldmason/easymsa/tests/main.nf.test Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/foldmason/easymsa/main.nf Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/foldmason/easymsa/tests/main.nf.test Co-authored-by: Simon Pearce <[email protected]> * Update main.nf * Update main.nf.test * Update meta.yml * Update modules/nf-core/foldmason/easymsa/tests/main.nf.test Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/foldmason/easymsa/tests/main.nf.test Co-authored-by: Simon Pearce <[email protected]> * Add stub run tests --------- Co-authored-by: Simon Pearce <[email protected]>
- Loading branch information
Showing
6 changed files
with
385 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
name: "foldmason_easymsa" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- bioconda::foldmason=1.763a428 | ||
- conda-forge::pigz=2.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
process FOLDMASON_EASYMSA { | ||
tag "$meta.id" | ||
label 'process_medium' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "community.wave.seqera.io/library/foldmason_pigz:97b3311addb0f4a7" | ||
|
||
input: | ||
tuple val(meta), path(pdbs) | ||
val(compress) | ||
|
||
output: | ||
tuple val(meta), path("${prefix}_3di.fa${compress ? '.gz' : ''}"), emit: msa_3di | ||
tuple val(meta), path("${prefix}_aa.fa${compress ? '.gz' : ''}"), emit: msa_aa | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
foldmason easy-msa \\ | ||
$args \\ | ||
--threads $task.cpus \\ | ||
${pdbs} \\ | ||
${prefix} \\ | ||
tmp | ||
if ${compress}; then | ||
pigz -p ${task.cpus} ${prefix}.fa | ||
fi | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
foldmason: \$(foldmason | grep "foldmason Version:" | cut -d":" -f 2 | awk '{\$1=\$1;print}') | ||
pigz: \$(echo \$(pigz --version 2>&1) | sed 's/^.*pigz\\w*//' )) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
echo "" ${compress ? '| gzip' : ''} > ${prefix}_3di.fa${compress ? '.gz' : ''} | ||
echo "" ${compress ? '| gzip' : ''} > ${prefix}_aa.fa${compress ? '.gz' : ''} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
foldmason: \$(foldmason | grep "foldmason Version:" | cut -d":" -f 2 | awk '{\$1=\$1;print}') | ||
pigz: \$(echo \$(pigz --version 2>&1) | sed 's/^.*pigz\\w*//' )) | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "foldmason_easymsa" | ||
description: Aligns protein structures using foldmason | ||
keywords: | ||
- alignment | ||
- MSA | ||
- genomics | ||
- structure | ||
tools: | ||
- "foldmason": | ||
description: "Multiple Protein Structure Alignment at Scale with FoldMason" | ||
homepage: "https://github.com/steineggerlab/foldmason" | ||
documentation: "https://github.com/steineggerlab/foldmason" | ||
tool_dev_url: "https://github.com/steineggerlab/foldmason" | ||
doi: "10.1101/2024.08.01.606130" | ||
licence: ["GPL v3"] | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- pdbs: | ||
type: file | ||
description: Input protein structures in PDB format. | ||
pattern: "*.{pdb,mmcif}" | ||
- 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. | ||
|
||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- msa_3di: | ||
type: file | ||
description: Fasta file containing the multiple sequence alignment with 3Di alphabet | ||
pattern: "*.{fa}" | ||
- msa_aa: | ||
type: file | ||
description: Fasta file containing the multiple sequence alignment with Amino Acid alphabet | ||
pattern: "*.{fa}" | ||
|
||
authors: | ||
- "@luisas" | ||
maintainers: | ||
- "@luisas" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
nextflow_process { | ||
|
||
name "Test Process FOLDMASON_EASYMSA" | ||
script "../main.nf" | ||
process "FOLDMASON_EASYMSA" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "foldmason" | ||
tag "foldmason/easymsa" | ||
tag "untar" | ||
|
||
test("Test on seatoxin dataset - uncompressed") { | ||
setup { | ||
|
||
run("UNTAR") { | ||
script "../../../../../modules/nf-core/untar/main.nf" | ||
process { | ||
""" | ||
archive = file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/structures/seatoxin-ref.tar.gz", checkIfExists: true) | ||
input[0] = Channel.of(tuple([id:'test'], archive)) | ||
""" | ||
} | ||
} | ||
} | ||
|
||
when { | ||
params { | ||
} | ||
process { | ||
""" | ||
input[0] = UNTAR.out.untar.map { meta,dir -> [meta, file(dir).listFiles().collect()]} | ||
input[1] = false | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
test("Test on seatoxin dataset - compressed") { | ||
setup { | ||
|
||
run("UNTAR") { | ||
script "../../../../../modules/nf-core/untar/main.nf" | ||
process { | ||
""" | ||
archive = file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/structures/seatoxin-ref.tar.gz", checkIfExists: true) | ||
input[0] = Channel.of(tuple([id:'test'], archive)) | ||
""" | ||
} | ||
} | ||
} | ||
|
||
when { | ||
params { | ||
} | ||
process { | ||
""" | ||
input[0] = UNTAR.out.untar.map { meta,dir -> [[ id:'test' ], file(dir).listFiles().collect()]} | ||
input[1] = false | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
test("Stub run") { | ||
options "-stub" | ||
|
||
setup { | ||
|
||
run("UNTAR") { | ||
script "../../../../../modules/nf-core/untar/main.nf" | ||
process { | ||
""" | ||
archive = file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/structures/seatoxin-ref.tar.gz", checkIfExists: true) | ||
input[0] = Channel.of(tuple([id:'test'], archive)) | ||
""" | ||
} | ||
} | ||
} | ||
|
||
when { | ||
params { | ||
} | ||
process { | ||
""" | ||
input[0] = UNTAR.out.untar.map { meta,dir -> [meta, file(dir).listFiles().collect()]} | ||
input[1] = false | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
} |
149 changes: 149 additions & 0 deletions
149
modules/nf-core/foldmason/easymsa/tests/main.nf.test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
{ | ||
"Stub run": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_3di.fa:md5,68b329da9893e34099c7d8ad5cb9c940" | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_aa.fa:md5,68b329da9893e34099c7d8ad5cb9c940" | ||
] | ||
], | ||
"2": [ | ||
"versions.yml:md5,da4694171d1b0bb9559f7049334126ed" | ||
], | ||
"msa_3di": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_3di.fa:md5,68b329da9893e34099c7d8ad5cb9c940" | ||
] | ||
], | ||
"msa_aa": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_aa.fa:md5,68b329da9893e34099c7d8ad5cb9c940" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,da4694171d1b0bb9559f7049334126ed" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.04.4" | ||
}, | ||
"timestamp": "2024-08-28T09:10:12.591561643" | ||
}, | ||
"Test on seatoxin dataset - uncompressed": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_3di.fa:md5,ba1b6c8c5df11bdebfea12070bd9cb17" | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_aa.fa:md5,33e93479603115b46ef76af3f6a20cf1" | ||
] | ||
], | ||
"2": [ | ||
"versions.yml:md5,da4694171d1b0bb9559f7049334126ed" | ||
], | ||
"msa_3di": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_3di.fa:md5,ba1b6c8c5df11bdebfea12070bd9cb17" | ||
] | ||
], | ||
"msa_aa": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_aa.fa:md5,33e93479603115b46ef76af3f6a20cf1" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,da4694171d1b0bb9559f7049334126ed" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.04.4" | ||
}, | ||
"timestamp": "2024-08-28T08:58:09.52040475" | ||
}, | ||
"Test on seatoxin dataset - compressed": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_3di.fa:md5,ba1b6c8c5df11bdebfea12070bd9cb17" | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_aa.fa:md5,33e93479603115b46ef76af3f6a20cf1" | ||
] | ||
], | ||
"2": [ | ||
"versions.yml:md5,da4694171d1b0bb9559f7049334126ed" | ||
], | ||
"msa_3di": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_3di.fa:md5,ba1b6c8c5df11bdebfea12070bd9cb17" | ||
] | ||
], | ||
"msa_aa": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_aa.fa:md5,33e93479603115b46ef76af3f6a20cf1" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,da4694171d1b0bb9559f7049334126ed" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.04.4" | ||
}, | ||
"timestamp": "2024-08-28T08:58:21.721568566" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foldmason/easymsa: | ||
- "modules/nf-core/foldmason/easymsa/**" |