-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
239 additions
and
1 deletion.
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
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,14 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json | ||
name: "utils_references" | ||
description: Functionality for dealing with references that may be useful for any Nextflow pipeline | ||
keywords: | ||
- utility | ||
- pipeline | ||
- references | ||
components: [] | ||
input: [] | ||
output: [] | ||
authors: | ||
- "@maxulysse" | ||
maintainers: | ||
- "@maxulysse" |
57 changes: 57 additions & 0 deletions
57
subworkflows/local/utils_references/tests/main.function.nf.test
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,57 @@ | ||
|
||
nextflow_function { | ||
|
||
name "Test Functions" | ||
script "../main.nf" | ||
|
||
test("extract_references_file - without params") { | ||
|
||
function "extract_references_file" | ||
|
||
when { | ||
function { | ||
""" | ||
input[0] = Channel.of([[ | ||
genome:'GRCh38_chr22', | ||
id:'GRCh38_chr22', | ||
species:'Homo_sapiens', | ||
fasta:'\${params.igenomes_base}/Homo_sapiens/nf-core/references/testdata.GRCh38_chr22/Sequence/WholeGenomeFasta/genome.fasta', | ||
], []]) | ||
input[1] = [] | ||
input[2] = 'fasta' | ||
input[3] = 's3://nf-core-references/test_data/' | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert function.success | ||
assert snapshot(function.result).match() | ||
} | ||
} | ||
|
||
test("extract_references_value - without params") { | ||
|
||
function "extract_references_value" | ||
|
||
when { | ||
function { | ||
""" | ||
input[0] = Channel.of([[ | ||
genome:'GRCh38_chr22', | ||
id:'GRCh38_chr22', | ||
species:'Homo_sapiens', | ||
fasta:'\${params.igenomes_base}/Homo_sapiens/nf-core/references/testdata.GRCh38_chr22/Sequence/WholeGenomeFasta/genome.fasta', | ||
], []]) | ||
input[1] = [] | ||
input[2] = 'species' | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert function.success | ||
assert snapshot(function.result).match() | ||
} | ||
} | ||
} |
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,58 @@ | ||
nextflow_workflow { | ||
|
||
name "Test Workflow UTILS_REFERENCES" | ||
script "../main.nf" | ||
workflow "UTILS_REFERENCES" | ||
|
||
test("Without params") { | ||
|
||
when { | ||
workflow { | ||
""" | ||
input[0] = Channel.of([[ | ||
genome:'GRCh38_chr22', | ||
id:'GRCh38_chr22', | ||
species:'Homo_sapiens', | ||
fasta:'\${params.igenomes_base}/Homo_sapiens/nf-core/references/testdata.GRCh38_chr22/Sequence/WholeGenomeFasta/genome.fasta', | ||
], []]) | ||
input[1] = [] | ||
input[2] = [] | ||
input[3] = 'fasta' | ||
input[4] = 'species' | ||
input[5] = 's3://nf-core-references/test_data/' | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.success | ||
assert snapshot(workflow.out).match() | ||
} | ||
} | ||
|
||
test("With params") { | ||
|
||
when { | ||
workflow { | ||
""" | ||
input[0] = Channel.of([[ | ||
genome:'GRCh38_chr22', | ||
id:'GRCh38_chr22', | ||
species:'Homo_sapiens', | ||
fasta:'\${params.igenomes_base}/Homo_sapiens/nf-core/references/testdata.GRCh38_chr22/Sequence/WholeGenomeFasta/genome.fasta', | ||
], []]) | ||
input[1] = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/genome.fasta' | ||
input[2] = 'WBCel235' | ||
input[3] = 'fasta' | ||
input[4] = 'species' | ||
input[5] = 's3://nf-core-references/test_data/' | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.success | ||
assert snapshot(workflow.out).match() | ||
} | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
subworkflows/local/utils_references/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,88 @@ | ||
{ | ||
"Without params": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "GRCh38_chr22" | ||
}, | ||
"/nf-core-references/test_data/Homo_sapiens/nf-core/references/testdata.GRCh38_chr22/Sequence/WholeGenomeFasta/genome.fasta" | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "GRCh38_chr22" | ||
}, | ||
"Homo_sapiens" | ||
] | ||
], | ||
"references_file": [ | ||
[ | ||
{ | ||
"id": "GRCh38_chr22" | ||
}, | ||
"/nf-core-references/test_data/Homo_sapiens/nf-core/references/testdata.GRCh38_chr22/Sequence/WholeGenomeFasta/genome.fasta" | ||
] | ||
], | ||
"references_value": [ | ||
[ | ||
{ | ||
"id": "GRCh38_chr22" | ||
}, | ||
"Homo_sapiens" | ||
] | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "24.10.4" | ||
}, | ||
"timestamp": "2025-01-31T13:12:57.867733238" | ||
}, | ||
"With params": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "GRCh38_chr22" | ||
}, | ||
"/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/genome.fasta" | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "GRCh38_chr22" | ||
}, | ||
"WBCel235" | ||
] | ||
], | ||
"references_file": [ | ||
[ | ||
{ | ||
"id": "GRCh38_chr22" | ||
}, | ||
"/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/genome.fasta" | ||
] | ||
], | ||
"references_value": [ | ||
[ | ||
{ | ||
"id": "GRCh38_chr22" | ||
}, | ||
"WBCel235" | ||
] | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "24.10.4" | ||
}, | ||
"timestamp": "2025-01-31T13:13:08.097955852" | ||
} | ||
} |