Skip to content

Commit 69b6694

Browse files
committed
added optional param to provide path for checkM2 database. updated relavent schema. improved annotation and code readability for branching samples with missing checkM2 values
1 parent 2e739bc commit 69b6694

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

nextflow.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ params {
2020
test_upload = true
2121
webincli_submit = true
2222
db_zenodo_id = '14897628'
23+
db_zenodo_path = null
2324

2425
// MultiQC options
2526
multiqc_config = null

nextflow_schema.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,5 +262,14 @@
262262
{
263263
"$ref": "#/$defs/pipeline_options"
264264
}
265-
]
265+
],
266+
"properties": {
267+
"db_zenodo_id": {
268+
"type": "string",
269+
"default": 14897628
270+
},
271+
"db_zenodo_path": {
272+
"type": "string"
273+
}
274+
}
266275
}

workflows/genomesubmit.nf

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,30 @@ workflow GENOMESUBMIT {
3535
def col7 = row[6]
3636
def col8 = row[7]
3737
def col9 = row[8]
38-
def missing = (!col7 || !col8 || !col9 || col7 == [] || col8 == [] || col9 == [])
39-
incomplete: missing
40-
complete: !missing
38+
def checkM2_missing = (!col7 || !col8 || !col9 || col7 == [] || col8 == [] || col9 == [])
39+
incomplete: checkM2_missing
40+
complete: !checkM2_missing
41+
}
42+
// Run checkM2 database download if any completeness/contamination values are missing & no db path provided
43+
if (params.db_zenodo_path == null) {
44+
CHECKM2_DATABASEDOWNLOAD(params.db_zenodo_id)
45+
ch_check2_db = CHECKM2_DATABASEDOWNLOAD.out.database
46+
}
47+
else {
48+
// Create a tuple that matches the expected structure from CHECKM2_DATABASEDOWNLOAD
49+
ch_check2_db = Channel.of(
50+
[
51+
[id: "db_zenodo_meta"],
52+
file(params.db_zenodo_path),
53+
]
54+
)
4155
}
42-
// Run checkM2 database download if any completeness/contamination values are provided
43-
CHECKM2_DATABASEDOWNLOAD(params.db_zenodo_id)
4456

4557
CHECKM2_PREDICT(
4658
branched.incomplete.map { row ->
4759
[row[0], file(row[1])]
4860
},
49-
CHECKM2_DATABASEDOWNLOAD.out.database,
61+
ch_check2_db,
5062
)
5163

5264

0 commit comments

Comments
 (0)