Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### `Changed`

- [#1000](https://github.com/nf-core/mag/pull/1000) - Update GUNC modules and enable the tool in tests (by @dialvarezs)
- [#1004](https://github.com/nf-core/mag/pull/1004) - Replace `collectFile` with `qsv/cat` on GUNC summary merging (by @dialvarezs)

### `Fixed`

Expand Down
4 changes: 4 additions & 0 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,8 @@ process {
withName: CHECKM2_PREDICT {
errorStrategy = { task.exitStatus in ((130..145) + 104 + 175) ? 'retry' : task.exitStatus == 1 ? 'ignore' : 'finish' }
}
withName: 'CONCAT_BUSCO_TSV|CONCAT_CHECKM_TSV|CONCAT_CHECKM2_TSV|CONCAT_GUNC_TSV|CONCAT_GUNC_CHECKM_TSV' {
cpus = 1
memory = { 1.GB * task.attempt }
}
}
3 changes: 1 addition & 2 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -553,13 +553,12 @@ process {
]
}

withName: 'CONCAT_BUSCO_TSV|CONCAT_CHECKM_TSV|CONCAT_CHECKM2_TSV' {
withName: 'CONCAT_BUSCO_TSV|CONCAT_CHECKM_TSV|CONCAT_CHECKM2_TSV|CONCAT_GUNC_TSV|CONCAT_GUNC_CHECKM_TSV' {
ext.prefix = { "${meta.id}_summary" }
ext.args = "--delimiter '\t'"
publishDir = [
path: { "${params.outdir}/GenomeBinning/QC" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

Expand Down
59 changes: 28 additions & 31 deletions subworkflows/local/bin_qc/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@
* BUSCO/CheckM/CheckM2/GUNC: Quantitative measures for the assessment of genome assembly
*/

include { BUSCO_BUSCO } from '../../../modules/nf-core/busco/busco/main'
include { BUSCO_BUSCO } from '../../../modules/nf-core/busco/busco/main'
// 2016-01-19: Temporarily diabling Checkm2 database downloading due to Zenodo blocking Aria2 downloads
//include { CHECKM2_DATABASEDOWNLOAD } from '../../../modules/nf-core/checkm2/databasedownload/main'
include { CHECKM_QA } from '../../../modules/nf-core/checkm/qa/main'
include { CHECKM_LINEAGEWF } from '../../../modules/nf-core/checkm/lineagewf/main'
include { CHECKM2_PREDICT } from '../../../modules/nf-core/checkm2/predict/main'
include { QSV_CAT as CONCAT_BUSCO_TSV } from '../../../modules/nf-core/qsv/cat/main'
include { QSV_CAT as CONCAT_CHECKM_TSV } from '../../../modules/nf-core/qsv/cat/main'
include { QSV_CAT as CONCAT_CHECKM2_TSV } from '../../../modules/nf-core/qsv/cat/main'
include { GUNC_DOWNLOADDB } from '../../../modules/nf-core/gunc/downloaddb/main'
include { GUNC_RUN } from '../../../modules/nf-core/gunc/run/main'
include { GUNC_MERGECHECKM } from '../../../modules/nf-core/gunc/mergecheckm/main'
include { UNTAR as BUSCO_UNTAR } from '../../../modules/nf-core/untar/main'
include { UNTAR as CHECKM_UNTAR } from '../../../modules/nf-core/untar/main'
include { UNTAR as CHECKM2_UNTAR } from '../../../modules/nf-core/untar/main'
include { CHECKM_QA } from '../../../modules/nf-core/checkm/qa/main'
include { CHECKM_LINEAGEWF } from '../../../modules/nf-core/checkm/lineagewf/main'
include { CHECKM2_PREDICT } from '../../../modules/nf-core/checkm2/predict/main'
include { QSV_CAT as CONCAT_BUSCO_TSV } from '../../../modules/nf-core/qsv/cat/main'
include { QSV_CAT as CONCAT_CHECKM_TSV } from '../../../modules/nf-core/qsv/cat/main'
include { QSV_CAT as CONCAT_CHECKM2_TSV } from '../../../modules/nf-core/qsv/cat/main'
include { QSV_CAT as CONCAT_GUNC_TSV } from '../../../modules/nf-core/qsv/cat/main'
include { QSV_CAT as CONCAT_GUNC_CHECKM_TSV } from '../../../modules/nf-core/qsv/cat/main'
include { GUNC_DOWNLOADDB } from '../../../modules/nf-core/gunc/downloaddb/main'
include { GUNC_RUN } from '../../../modules/nf-core/gunc/run/main'
include { GUNC_MERGECHECKM } from '../../../modules/nf-core/gunc/mergecheckm/main'
include { UNTAR as BUSCO_UNTAR } from '../../../modules/nf-core/untar/main'
include { UNTAR as CHECKM_UNTAR } from '../../../modules/nf-core/untar/main'
include { UNTAR as CHECKM2_UNTAR } from '../../../modules/nf-core/untar/main'


workflow BIN_QC {
Expand Down Expand Up @@ -205,29 +207,24 @@ workflow BIN_QC {

GUNC_RUN(ch_input_bins_for_gunc, ch_db_for_gunc)

// Make sure to keep directory in sync with modules.conf
ch_gunc_summary = GUNC_RUN.out.maxcss_level_tsv
.map { _meta, gunc_summary -> gunc_summary }
.collectFile(
name: "gunc_summary.tsv",
keepHeader: true,
sort: { file -> file.toString() },
storeDir: "${params.outdir}/GenomeBinning/QC/",
)
gunc_summaries = GUNC_RUN.out.maxcss_level_tsv
.toSortedList { tuple -> tuple[0].values().join('|') }
.map { tuples -> [[id: 'gunc'], tuples.collect { _meta, summary -> summary }] }

CONCAT_GUNC_TSV(gunc_summaries, 'rowskey', 'tsv', true)

ch_gunc_summary = CONCAT_GUNC_TSV.out.csv.map { _meta, csv -> csv }

if (params.run_checkm) {
ch_input_to_mergecheckm = GUNC_RUN.out.maxcss_level_tsv.combine(CHECKM_QA.out.output, by: 0)

GUNC_MERGECHECKM(ch_input_to_mergecheckm)

// Make sure to keep directory in sync with modules.conf
GUNC_MERGECHECKM.out.tsv
.map { _meta, gunc_checkm_summary -> gunc_checkm_summary }
.collectFile(
name: "gunc_checkm_summary.tsv",
keepHeader: true,
sort: { file -> file.toString() },
storeDir: "${params.outdir}/GenomeBinning/QC/",
)
gunc_checkm_summaries = GUNC_MERGECHECKM.out.tsv
.map { _meta, summary -> [[id: 'gunc_checkm'], summary] }
.groupTuple()

CONCAT_GUNC_CHECKM_TSV(gunc_checkm_summaries, 'rowskey', 'tsv', true)
}
}

Expand Down
13 changes: 8 additions & 5 deletions tests/test_assembly_input.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
"-profile assembly_input": {
"content": [
285,
286,
{
"ADJUST_MAXBIN2_EXT": {
"coreutils": 9.5
Expand All @@ -91,6 +91,9 @@
"CONCAT_BUSCO_TSV": {
"qsv": "5.1.0"
},
"CONCAT_GUNC_TSV": {
"qsv": "5.1.0"
},
"CONCOCT_CONCOCT": {
"concoct": "1.1.0"
},
Expand Down Expand Up @@ -174,9 +177,9 @@
}
}
],
"timestamp": "2026-03-27T09:29:22.073080452",
"timestamp": "2026-03-27T17:58:59.080247138",
"meta": {
"nf-test": "0.9.4",
"nf-test": "0.9.5",
"nextflow": "25.10.4"
}
},
Expand Down Expand Up @@ -560,9 +563,9 @@
"bin_depths_summary.tsv:md5,7153f759db72abb02e2ee3c2ab1b5e56"
]
],
"timestamp": "2026-03-24T15:04:09.101990795",
"timestamp": "2026-03-27T17:58:59.223381841",
"meta": {
"nf-test": "0.9.4",
"nf-test": "0.9.5",
"nextflow": "25.10.4"
}
},
Expand Down
Loading