Skip to content

Commit 11f2f08

Browse files
authored
Merge pull request #12 from nf-core/feature/assembly_manifest
add nf-core style module for assembly_manifest
2 parents 1de7f16 + 0cacda1 commit 11f2f08

File tree

6 files changed

+257
-0
lines changed

6 files changed

+257
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Initial release of nf-core/seqsubmit, created with the [nf-core](https://nf-co.r
99

1010
### `Added`
1111

12+
- [#12](https://github.com/nf-core/seqsubmit/pull/12)
13+
- Add initial version of `GENERATE_ASSEMBLY_MANIFEST` (by @fxquah)
14+
1215
- [#2](https://github.com/nf-core/proteinfamilies/pull/2)
1316
- Added initial versions of local modules for `GENOME_UPLOAD` and `ENA_WEBIN_CLI`. (by @KateSakharova and @vagkaratzas)
1417
- Added initial version of the `GENOMESUBMIT` workflow. (by @KateSakharova and @vagkaratzas)
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+
- "bioconda::assembly_uploader=1.3.2"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
process GENERATE_ASSEMBLY_MANIFEST {
2+
tag "$meta.id"
3+
label 'process_single'
4+
5+
container "community.wave.seqera.io/library/pip_assembly-uploader:7e9461afbdd7a521"
6+
7+
input:
8+
tuple val(meta), path(assembly_fasta), path(data_csv)
9+
val(assembly_study)
10+
11+
output:
12+
tuple val(meta), path("${assembly_study}_upload/*.manifest") , emit: manifest
13+
path "versions.yml", emit: versions
14+
15+
when:
16+
task.ext.when == null || task.ext.when
17+
18+
script:
19+
def args = task.ext.args ?: ''
20+
def prefix = task.ext.prefix ?: "${meta.id}"
21+
"""
22+
assembly_manifest \\
23+
--study ${assembly_study} \\
24+
--data ${data_csv} \\
25+
--assembly_study ${assembly_study} \\
26+
--output ${assembly_study}_upload \\
27+
${args}
28+
29+
cat <<-END_VERSIONS > versions.yml
30+
"${task.process}":
31+
python: \$(python --version)
32+
END_VERSIONS
33+
"""
34+
35+
stub:
36+
def args = task.ext.args ?: ''
37+
def prefix = task.ext.prefix ?: "${meta.id}"
38+
"""
39+
mkdir ${assembly_study}_upload/
40+
touch ${assembly_study}_upload/test.manifest
41+
42+
cat <<-END_VERSIONS > versions.yml
43+
"${task.process}":
44+
python: \$(python --version)
45+
END_VERSIONS
46+
"""
47+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: "generate_assembly_manifest"
2+
description: Generate manifest files for genome assemblies using assembly-uploader
3+
keywords:
4+
- ena
5+
- manifest
6+
- upload
7+
tools:
8+
- assembly-uploader:
9+
description: Make a manifest file for each assembly.
10+
Co-assemblies cannot be generated from a mix of private and public runs -
11+
all runs used in a co-assembly must have the same privacy status (all private or all public).
12+
documentation: https://github.com/EBI-Metagenomics/assembly_uploader/
13+
licence: ["Apache License"]
14+
input:
15+
- - meta:
16+
type: map
17+
description: |
18+
Groovy Map containing sample information.
19+
e.g. [ id:'test', single_end:false ]
20+
- assembly_fasta:
21+
type: file
22+
description: Genome assembly FASTA file.
23+
- data_csv:
24+
type: file
25+
description: |
26+
CSV file containing metadata -
27+
runs (comma-separated and in quotes, example: "SRR1234,SRR5678"),
28+
coverage, assembler, version, filepath and optionally sample.
29+
- assembly_study:
30+
type: value
31+
description: |
32+
Pre-existing study ID to submit to if available.
33+
Must exist in the webin account.
34+
35+
output:
36+
- meta:
37+
type: map
38+
description: |
39+
Groovy Map containing sample information.
40+
e.g. [ id:'test', single_end:false ]
41+
- manifest:
42+
type: file
43+
description: Manifest file required for submission with webin-cli.
44+
- versions:
45+
type: file
46+
description: File containing software versions.
47+
pattern: "versions.yml"
48+
49+
authors:
50+
- "@fxquah"
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
nextflow_process {
2+
3+
name "Test Process GENERATE_ASSEMBLY_MANIFEST"
4+
script "../main.nf"
5+
process "GENERATE_ASSEMBLY_MANIFEST"
6+
7+
tag "modules"
8+
tag "modules_"
9+
tag "generate_assembly_manifest"
10+
11+
test("GENERATE_ASSEMBLY_MANIFEST completes with expected outputs") {
12+
when {
13+
process {
14+
"""
15+
input[0] = [
16+
[ id:'test' ],
17+
file(params.pipelines_testdata_base_path + "/test_data/contigs.fasta.gz", checkIfExists: true),
18+
file(params.pipelines_testdata_base_path + "/samplesheets/samplesheet_generatemanifest.csv", checkIfExists: true)
19+
]
20+
input[1] = "PRJ12345"
21+
"""
22+
23+
}
24+
}
25+
26+
then {
27+
assert process.success
28+
assertAll(
29+
{ assert snapshot(
30+
process.out,
31+
path(process.out.versions[0]).yaml
32+
).match() },
33+
{ assert process.out.manifest.size() == 1 },
34+
{ assert process.out.manifest[0][1].toString().endsWith(".manifest") },
35+
{
36+
def manifestContent = path(process.out.manifest[0][1]).text
37+
assert manifestContent.contains("PRJ12345") : "PRJ12345 not found in manifest file"
38+
}
39+
)
40+
}
41+
42+
}
43+
44+
test("GENERATE_ASSEMBLY_MANIFEST completes with expected outputs - stub") {
45+
46+
options "-stub"
47+
48+
when {
49+
process {
50+
"""
51+
input[0] = [
52+
[ id:'test' ],
53+
file('test_contigs.fastq.gz'),
54+
file('test_samplesheet_generatemanifest.csv')
55+
]
56+
input[1] = "PRJ12345"
57+
"""
58+
}
59+
}
60+
61+
then {
62+
assert process.success
63+
assertAll(
64+
{ assert snapshot(
65+
process.out,
66+
path(process.out.versions[0]).yaml
67+
).match() }
68+
)
69+
}
70+
71+
}
72+
73+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"GENERATE_ASSEMBLY_MANIFEST completes with expected outputs - stub": {
3+
"content": [
4+
{
5+
"0": [
6+
[
7+
{
8+
"id": "test"
9+
},
10+
"test.manifest:md5,d41d8cd98f00b204e9800998ecf8427e"
11+
]
12+
],
13+
"1": [
14+
"versions.yml:md5,188d7f56d019104ee5883d69eede27b4"
15+
],
16+
"manifest": [
17+
[
18+
{
19+
"id": "test"
20+
},
21+
"test.manifest:md5,d41d8cd98f00b204e9800998ecf8427e"
22+
]
23+
],
24+
"versions": [
25+
"versions.yml:md5,188d7f56d019104ee5883d69eede27b4"
26+
]
27+
},
28+
{
29+
"GENERATE_ASSEMBLY_MANIFEST": {
30+
"python": "Python 3.14.0"
31+
}
32+
}
33+
],
34+
"meta": {
35+
"nf-test": "0.9.3",
36+
"nextflow": "25.10.0"
37+
},
38+
"timestamp": "2025-10-29T11:00:23.072784"
39+
},
40+
"GENERATE_ASSEMBLY_MANIFEST completes with expected outputs": {
41+
"content": [
42+
{
43+
"0": [
44+
[
45+
{
46+
"id": "test"
47+
},
48+
"233126d4c4d023f18c7836ed36395e3c.manifest:md5,b31fec00db575da44ad17950ae2e37ff"
49+
]
50+
],
51+
"1": [
52+
"versions.yml:md5,188d7f56d019104ee5883d69eede27b4"
53+
],
54+
"manifest": [
55+
[
56+
{
57+
"id": "test"
58+
},
59+
"233126d4c4d023f18c7836ed36395e3c.manifest:md5,b31fec00db575da44ad17950ae2e37ff"
60+
]
61+
],
62+
"versions": [
63+
"versions.yml:md5,188d7f56d019104ee5883d69eede27b4"
64+
]
65+
},
66+
{
67+
"GENERATE_ASSEMBLY_MANIFEST": {
68+
"python": "Python 3.14.0"
69+
}
70+
}
71+
],
72+
"meta": {
73+
"nf-test": "0.9.3",
74+
"nextflow": "25.10.0"
75+
},
76+
"timestamp": "2025-10-29T11:00:16.801535"
77+
}
78+
}

0 commit comments

Comments
 (0)