Skip to content

Commit d5613ab

Browse files
committed
Fix the input types to use a flat fasta and not an array
1 parent ddef5bd commit d5613ab

3 files changed

Lines changed: 42 additions & 13 deletions

File tree

subworkflows/local/functional_annotation/main.nf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ workflow FUNCTIONAL_ANNOTATION {
1616
.map {
1717
meta, fasta ->
1818
[
19-
[id:"${meta.id}_${fasta[0].splitFasta(record: [id: true]).id[0].replaceAll(/\|/, '-')}"] ,
20-
fasta[0].splitFasta(file:true)
19+
[id:"${meta.id}_${fasta.splitFasta(record: [id: true]).id[0].replaceAll(/\|/, '-')}"] ,
20+
fasta.splitFasta(file:true)
2121
]
2222
}
2323
.transpose()
24-
.view()
2524
.set { ch_multifasta }
2625

2726
//

subworkflows/local/functional_annotation/tests/main.nf.test

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ nextflow_workflow {
1616

1717

1818
// TODO nf-core: Change the test name preferably indicating the test-data and file-format used
19-
test("snap25 isoforms - bcl2 - ced9") {
19+
test("Test two input channels, one fasta record each") {
2020

2121
when {
2222
params {
@@ -25,10 +25,45 @@ nextflow_workflow {
2525
workflow {
2626
"""
2727
// TODO nf-core: define inputs of the workflow here. Example:
28-
input[0] = Channel.of([
29-
[ id:'test', single_end:false ], // meta map
28+
input[0] = Channel.fromList([
29+
[
30+
[ id:'T1024' ], // meta map
31+
file(params.pipelines_testdata_base_path + 'proteinfold/testdata/sequences/T1024.fasta', checkIfExists: true)
32+
],
33+
[
34+
[ id:'T1026' ], // meta map
35+
file(params.pipelines_testdata_base_path + 'proteinfold/testdata/sequences/T1026.fasta', checkIfExists: true)
36+
]
37+
])
38+
"""
39+
}
40+
}
41+
42+
then {
43+
assertAll(
44+
// { assert snapshot(workflow.out).match()},
45+
{ assert workflow.success},
46+
//TODO nf-core: Add all required assertions to verify the test output.
47+
)
48+
}
49+
}
50+
51+
// TODO nf-core: Change the test name preferably indicating the test-data and file-format used
52+
test("Test single input fasta with 4 fasta records: snap25 isoforms - bcl2 - ced9") {
53+
54+
when {
55+
params {
56+
pipelines_testdata_base_path = "https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/"
57+
}
58+
workflow {
59+
"""
60+
// TODO nf-core: define inputs of the workflow here. Example:
61+
input[0] = Channel.fromList([
62+
[
63+
[ id:'test' ], // meta map
3064
file(params.pipelines_testdata_base_path + 'proteinannotator/reference/snap25_isoforms_bcl2_ced9.fasta', checkIfExists: true)
31-
])
65+
]
66+
])
3267
"""
3368
}
3469
}

subworkflows/local/utils_nfcore_proteinannotator_pipeline/main.nf

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,11 @@ workflow PIPELINE_INITIALISATION {
7171
.fromList(samplesheetToList(params.input, "${projectDir}/assets/schema_input.json"))
7272
.map {
7373
meta, fasta ->
74-
return [ meta, [ fasta ] ]
74+
return [ meta, fasta ]
7575
}
76-
.groupTuple()
7776
.map { samplesheet ->
7877
validateInputSamplesheet(samplesheet)
7978
}
80-
.map {
81-
meta, fastas ->
82-
return [ meta, fastas.flatten() ]
83-
}
8479
.set { ch_samplesheet }
8580

8681
emit:

0 commit comments

Comments
 (0)