Skip to content

Commit 4ceb316

Browse files
authored
Merge pull request #111 from EBI-Metagenomics/update/extractcoords_tests
Update EXTRACTCOORDS module
2 parents 1363425 + b8ce292 commit 4ceb316

File tree

7 files changed

+259
-34
lines changed

7 files changed

+259
-34
lines changed

modules/ebi-metagenomics/extractcoords/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ channels:
44
- conda-forge
55
- bioconda
66
dependencies:
7-
- "bioconda::mgnify-pipelines-toolkit=1.0.1"
7+
- "bioconda::mgnify-pipelines-toolkit=1.2.11"

modules/ebi-metagenomics/extractcoords/main.nf

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,34 @@ process EXTRACTCOORDS {
55

66
conda "${moduleDir}/environment.yml"
77
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
8-
'https://depot.galaxyproject.org/singularity/mgnify-pipelines-toolkit:1.0.4--pyhdfd78af_0':
9-
'biocontainers/mgnify-pipelines-toolkit:1.0.4--pyhdfd78af_0' }"
8+
'https://depot.galaxyproject.org/singularity/mgnify-pipelines-toolkit:1.2.11--pyhdfd78af_0':
9+
'biocontainers/mgnify-pipelines-toolkit:1.2.11--pyhdfd78af_0' }"
1010

1111
input:
1212
tuple val(meta), path(easel_coords_fasta)
1313
tuple val(meta2), path(matched_seqs_with_coords)
14+
val separate_subunits
1415

1516
output:
16-
tuple val(meta), path("sequence-categorisation/*SSU.fasta") , optional: true, emit: ssu_fasta
17-
tuple val(meta), path("sequence-categorisation/*LSU.fasta") , optional: true, emit: lsu_fasta
18-
tuple val(meta), path("sequence-categorisation/*5S.fasta") , optional: true, emit: fiveS_fasta
19-
tuple val(meta), path("sequence-categorisation/*5_8S.fasta") , optional: true, emit: five_eightS_fasta
20-
tuple val(meta), path("sequence-categorisation/*other_ncRNA.fasta"), optional: true, emit: ncrna_fasta
21-
tuple val(meta), path("*concat_SSU_LSU_coords.txt") , emit: concat_ssu_lsu_coords
22-
path "versions.yml" , emit: versions
17+
tuple val(meta), path("sequence-categorisation/*SSU.fasta") , optional: true, emit: ssu_fasta
18+
tuple val(meta), path("sequence-categorisation/*LSU.fasta") , optional: true, emit: lsu_fasta
19+
tuple val(meta), path("sequence-categorisation/*rRNA_bacteria*.fasta"), optional: true, emit: rrna_bacteria
20+
tuple val(meta), path("sequence-categorisation/*rRNA_archaea*.fasta") , optional: true, emit: rrna_archaea
21+
tuple val(meta), path("sequence-categorisation/*rRNA_eukarya*.fasta") , optional: true, emit: eukarya
22+
tuple val(meta), path("sequence-categorisation/*5S.fasta") , optional: true, emit: fiveS_fasta
23+
tuple val(meta), path("sequence-categorisation/*5_8S.fasta") , optional: true, emit: five_eightS_fasta
24+
tuple val(meta), path("sequence-categorisation/*other_ncRNA.fasta") , optional: true, emit: ncrna_fasta
25+
tuple val(meta), path("*concat_SSU_LSU_coords.txt") , emit: concat_ssu_lsu_coords
26+
path "versions.yml" , emit: versions
2327

2428
when:
2529
task.ext.when == null || task.ext.when
2630

2731
script:
2832
def prefix = task.ext.prefix ?: "${meta.id}"
33+
def separate_subunits_flag = separate_subunits ? "--separate-subunits-by-models" : ""
2934
"""
30-
get_subunits -i $easel_coords_fasta -n ${prefix}
35+
get_subunits -i $easel_coords_fasta -n ${prefix} ${separate_subunits_flag}
3136
3237
get_subunits_coords -i $matched_seqs_with_coords -s SSU -l LSU
3338

modules/ebi-metagenomics/extractcoords/meta.yml

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,24 @@ input:
2424
e.g. `[ id:'sample1', single_end:false ]`
2525
- easel_coords_fasta:
2626
type: file
27-
description: Fasta file output from running esl-sfetch to extract sequences
28-
by name
27+
description: Fasta file output from running esl-sfetch to extract
28+
sequences by name
2929
pattern: "*.fasta"
30+
ontologies: []
3031
- - meta2:
3132
type: map
3233
description: |
3334
Groovy Map containing sample information
3435
e.g. `[ id:'sample1', single_end:false ]`
3536
- matched_seqs_with_coords:
3637
type: file
37-
description: Space-separated cmsearchdeoverlap output formatted for use by esl-sfetch
38+
description: Space-separated cmsearchdeoverlap output formatted for use by
39+
esl-sfetch
3840
pattern: "*.txt"
41+
ontologies: []
42+
- - separate_subunits:
43+
type: boolean
44+
description: Specify true to separate hits into the different RNA subunits
3945
output:
4046
- ssu_fasta:
4147
- meta:
@@ -47,6 +53,7 @@ output:
4753
type: file
4854
description: Fasta file containing the SSU sequences
4955
pattern: "*.fasta"
56+
ontologies: []
5057
- lsu_fasta:
5158
- meta:
5259
type: map
@@ -57,33 +64,70 @@ output:
5764
type: file
5865
description: Fasta file containing the LSU sequences
5966
pattern: "*.fasta"
67+
ontologies: []
68+
- rrna_bacteria:
69+
- meta:
70+
type: map
71+
description: |
72+
Groovy Map containing sample information
73+
e.g. `[ id:'sample1', single_end:false ]`
74+
- sequence-categorisation/*rRNA_bacteria*.fasta:
75+
type: file
76+
description: Fasta file containing bacterial rRNA
77+
pattern: "*.fasta"
78+
ontologies: []
79+
- rrna_archaea:
80+
- meta:
81+
type: map
82+
description: |
83+
Groovy Map containing sample information
84+
e.g. `[ id:'sample1', single_end:false ]`
85+
- sequence-categorisation/*rRNA_archaea*.fasta:
86+
type: file
87+
description: Fasta file containing archaeal rRNA
88+
pattern: "*.fasta"
89+
ontologies: []
90+
- eukarya:
91+
- meta:
92+
type: map
93+
description: |
94+
Groovy Map containing sample information
95+
e.g. `[ id:'sample1', single_end:false ]`
96+
- sequence-categorisation/*rRNA_eukarya*.fasta:
97+
type: file
98+
description: Fasta file containing eukaryan rRNA
99+
pattern: "*.fasta"
100+
ontologies: []
60101
- fiveS_fasta:
61102
- meta:
62103
type: map
63104
description: |
64105
Groovy Map containing sample information
65106
e.g. `[ id:'sample1', single_end:false ]`
66-
- "sequence-categorisation/*5S.fasta":
107+
- sequence-categorisation/*5S.fasta:
67108
type: file
68109
description: "5S rRNA nucleotide sequences"
110+
ontologies: []
69111
- five_eightS_fasta:
70112
- meta:
71113
type: map
72114
description: |
73115
Groovy Map containing sample information
74116
e.g. `[ id:'sample1', single_end:false ]`
75-
- "sequence-categorisation/*5_8S.fasta":
117+
- sequence-categorisation/*5_8S.fasta:
76118
type: file
77119
description: "5 and 8S rRNA nucleotide sequences"
120+
ontologies: []
78121
- ncrna_fasta:
79122
- meta:
80123
type: map
81124
description: |
82125
Groovy Map containing sample information
83126
e.g. `[ id:'sample1', single_end:false ]`
84-
- "sequence-categorisation/*other_ncRNA.fasta":
127+
- sequence-categorisation/*other_ncRNA.fasta:
85128
type: file
86129
description: "non-coding RNA nucleotide sequences"
130+
ontologies: []
87131
- concat_ssu_lsu_coords:
88132
- meta:
89133
type: map
@@ -92,14 +136,17 @@ output:
92136
e.g. `[ id:'sample1', single_end:false ]`
93137
- "*concat_SSU_LSU_coords.txt":
94138
type: file
95-
description: Space-separated concatenated file of coordinates of matches of
96-
both SSU and LSU
139+
description: Space-separated concatenated file of coordinates of matches
140+
of both SSU and LSU
97141
pattern: "*.txt"
142+
ontologies: []
98143
- versions:
99144
- versions.yml:
100145
type: file
101146
description: File containing software versions
102147
pattern: "versions.yml"
148+
ontologies:
149+
- edam: http://edamontology.org/format_3750 # YAML
103150
authors:
104151
- "@chrisata"
105152
maintainers:

modules/ebi-metagenomics/extractcoords/tests/main.nf.test

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,34 @@ nextflow_process {
2222
[ id:'test', single_end:false ], // meta map
2323
file("${moduleDir}/tests/test_matched_seqs_with_coords.txt", checkIfExists: true),
2424
]
25+
input[2] = true
26+
"""
27+
}
28+
}
29+
30+
then {
31+
assertAll(
32+
{ assert process.success },
33+
{ assert snapshot(process.out).match() }
34+
)
35+
}
36+
37+
}
38+
39+
test("extractcoords - test it without splitting subunits") {
40+
41+
when {
42+
process {
43+
"""
44+
input[0] = [
45+
[ id:'test', single_end:false ], // meta map
46+
file("${moduleDir}/tests/test.fasta", checkIfExists: true)
47+
]
48+
input[1] = [
49+
[ id:'test', single_end:false ], // meta map
50+
file("${moduleDir}/tests/test_matched_seqs_with_coords.txt", checkIfExists: true),
51+
]
52+
input[2] = []
2553
"""
2654
}
2755
}
@@ -50,6 +78,7 @@ nextflow_process {
5078
[ id:'test', single_end:false ], // meta map
5179
file("${moduleDir}/tests/test_matched_seqs_with_coords.txt", checkIfExists: true),
5280
]
81+
input[2] = true
5382
"""
5483
}
5584
}

0 commit comments

Comments
 (0)