Skip to content

Commit cc87db0

Browse files
Merge branch 'ENSGENOMIO-18' into local_testing
2 parents 2eaa504 + ef8a3ea commit cc87db0

16 files changed

Lines changed: 1458 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
.nextflow*
22
.nf-test*
3+
__pycache__/
4+
*.pyc
5+
.python-version
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
dependencies:
6+
- ensembl-genomio=1.6.1
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// See the NOTICE file distributed with this work for additional information
2+
// regarding copyright ownership.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
process FASTA_RECOMBINE {
17+
18+
tag "${meta.id}"
19+
label 'process_medium'
20+
21+
conda "${moduleDir}/environment.yml"
22+
container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container
23+
? 'https://depot.galaxyproject.org/singularity/ensembl-genomio:1.6.1--pyhdfd78af_0'
24+
: 'quay.io/biocontainers/ensembl-genomio:1.6.1--pyhdfd78af_0'}"
25+
26+
input:
27+
tuple val(meta), path(fasta_manifest), path(agp)
28+
29+
output:
30+
tuple val(meta), path("${meta.id}.fa"), emit: recombined_fasta
31+
tuple val("${task.process}"), val('fasta_recombine'), eval("fasta_recombine --version"), emit: versions_fasta_recombine, topic: versions
32+
33+
when:
34+
task.ext.when == null || task.ext.when
35+
36+
script:
37+
def args = []
38+
39+
if (params.chunk_id_regex) {
40+
def rx = params.chunk_id_regex.replace("'", "'\"'\"'")
41+
args << "--chunk-id-regex '${rx}'"
42+
}
43+
44+
if (params.allow_revcomp) {
45+
args << "--allow-revcomp"
46+
}
47+
48+
def has_agp = agp && agp.baseName != 'NO_FILE'
49+
if (has_agp) {
50+
args << "--agp-file ${agp}"
51+
}
52+
53+
def out_fasta = "${meta.id}.fa"
54+
"""
55+
fasta_recombine \\
56+
--fasta-manifest ${fasta_manifest} \\
57+
--out-fasta ${out_fasta} \\
58+
${args.join(' ')}
59+
"""
60+
61+
stub:
62+
"""
63+
out_fa="${meta.id}.fa"
64+
touch "\$out_fa"
65+
"""
66+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "fasta_recombine"
2+
description: Recombine split FASTA sequences into a single FASTA file,
3+
optionally using an AGP file.
4+
keywords:
5+
- ensembl
6+
- fasta
7+
- genomics
8+
- genomio
9+
- recombine
10+
tools:
11+
- "fasta_recombine":
12+
description: "Recombine split FASTA sequences generated by ensembl-genomio."
13+
homepage: "https://github.com/Ensembl/ensembl-genomio"
14+
licence:
15+
- "Apache License version 2.0"
16+
identifier: ""
17+
input:
18+
- - meta:
19+
type: map
20+
description: |
21+
Groovy Map containing meta information
22+
e.g. `[ id:'accession1' ]`
23+
- fasta_manifest:
24+
type: file
25+
description: Manifest file listing split FASTA files to recombine.
26+
pattern: "*.txt"
27+
ontologies: []
28+
- agp:
29+
type: file
30+
description:
31+
Optional AGP file describing how split sequence chunks should
32+
be recombined. Use NO_FILE when not required.
33+
pattern: "*.{agp,NO_FILE}"
34+
ontologies: []
35+
output:
36+
recombined_fasta:
37+
- - meta:
38+
type: map
39+
description: |
40+
Groovy Map containing meta information
41+
e.g. `[ id:'accession1' ]`
42+
- ${meta.id}.fa:
43+
type: file
44+
description: Recombined FASTA file.
45+
pattern: "*.fa"
46+
ontologies: []
47+
versions_fasta_recombine:
48+
- - ${task.process}:
49+
type: string
50+
description: The name of the process.
51+
- fasta_recombine:
52+
type: string
53+
description: The name of the tool.
54+
- ? fasta_recombine --version
55+
: type: eval
56+
description: The expression to obtain the version of the tool
57+
topics:
58+
versions:
59+
- - ${task.process}:
60+
type: string
61+
description: The name of the process.
62+
- fasta_recombine:
63+
type: string
64+
description: The name of the tool.
65+
- ? fasta_recombine --version
66+
: type: eval
67+
description: The expression to obtain the version of the tool
68+
authors:
69+
- "ensembl-dev@ebi.ac.uk"
70+
maintainers:
71+
- "ensembl-dev@ebi.ac.uk"
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// See the NOTICE file distributed with this work for additional information
2+
// regarding copyright ownership.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
// nf-core modules test fasta/recombine
17+
nextflow_process {
18+
19+
name "Test Process FASTA_RECOMBINE"
20+
script "../main.nf"
21+
process "FASTA_RECOMBINE"
22+
23+
tag "modules"
24+
tag "modules_ensembl"
25+
tag "fasta"
26+
tag "fasta/recombine"
27+
28+
test("stub outputs: header mode") {
29+
30+
when {
31+
options "-stub"
32+
33+
process {
34+
"""
35+
def manifest = file("manifest.txt")
36+
manifest.text = "x\\n"
37+
38+
def no_file = file("NO_FILE")
39+
no_file.text = ""
40+
41+
input[0] = [
42+
[ id: 'test' ],
43+
manifest,
44+
no_file
45+
]
46+
"""
47+
}
48+
}
49+
50+
then {
51+
assert process.trace.tasks().size() == 1
52+
assert process.out.recombined_fasta.size() == 1
53+
assert process.success
54+
assert snapshot(process.out).match()
55+
}
56+
}
57+
58+
test("stub outputs: AGP mode") {
59+
60+
when {
61+
options "-stub"
62+
63+
process {
64+
"""
65+
def manifest = file("manifest.txt")
66+
manifest.text = "x\\n"
67+
68+
def agp = file("test.agp")
69+
agp.text = ""
70+
input[0] = [
71+
[ id: 'test' ],
72+
manifest,
73+
agp
74+
]
75+
"""
76+
}
77+
}
78+
79+
then {
80+
assert process.trace.tasks().size() == 1
81+
assert process.out.recombined_fasta.size() == 1
82+
assert process.success
83+
assert snapshot(process.out).match()
84+
}
85+
}
86+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"stub outputs: AGP mode": {
3+
"content": [
4+
{
5+
"0": [
6+
[
7+
{
8+
"id": "test"
9+
},
10+
"test.fa:md5,d41d8cd98f00b204e9800998ecf8427e"
11+
]
12+
],
13+
"1": [
14+
[
15+
"FASTA_RECOMBINE",
16+
"fasta_recombine",
17+
"1.6.3"
18+
]
19+
],
20+
"recombined_fasta": [
21+
[
22+
{
23+
"id": "test"
24+
},
25+
"test.fa:md5,d41d8cd98f00b204e9800998ecf8427e"
26+
]
27+
],
28+
"versions_fasta_recombine": [
29+
[
30+
"FASTA_RECOMBINE",
31+
"fasta_recombine",
32+
"1.6.3"
33+
]
34+
]
35+
}
36+
],
37+
"timestamp": "2026-05-14T14:39:11.350698",
38+
"meta": {
39+
"nf-test": "0.9.4",
40+
"nextflow": "25.10.3"
41+
}
42+
},
43+
"stub outputs: header mode": {
44+
"content": [
45+
{
46+
"0": [
47+
[
48+
{
49+
"id": "test"
50+
},
51+
"test.fa:md5,d41d8cd98f00b204e9800998ecf8427e"
52+
]
53+
],
54+
"1": [
55+
[
56+
"FASTA_RECOMBINE",
57+
"fasta_recombine",
58+
"1.6.3"
59+
]
60+
],
61+
"recombined_fasta": [
62+
[
63+
{
64+
"id": "test"
65+
},
66+
"test.fa:md5,d41d8cd98f00b204e9800998ecf8427e"
67+
]
68+
],
69+
"versions_fasta_recombine": [
70+
[
71+
"FASTA_RECOMBINE",
72+
"fasta_recombine",
73+
"1.6.3"
74+
]
75+
]
76+
}
77+
],
78+
"timestamp": "2026-05-14T14:39:09.216174",
79+
"meta": {
80+
"nf-test": "0.9.4",
81+
"nextflow": "25.10.3"
82+
}
83+
}
84+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
dependencies:
6+
- ensembl-genomio=1.6.1

0 commit comments

Comments
 (0)