Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into dev-checkm2
Browse files Browse the repository at this point in the history
  • Loading branch information
dialvarezs committed Oct 31, 2024
2 parents 76dac5c + cd5ebae commit 0ebab07
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 9 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### `Added`

- [#707](https://github.com/nf-core/mag/pull/707) - Added CheckM2 as an alternative bin completeness and QC tool (added by @dialvarezs)
- [#708](https://github.com/nf-core/mag/pull/708) - Added `--exclude_unbins_from_postbinning` parameter to exclude unbinned contigs from post-binning processes, speeding up Prokka in some cases (added by @dialvarezs)

### `Changed`

### `Fixed`

- [#708](https://github.com/nf-core/mag/pull/708) - Fixed channel passed as GUNC input (added by @dialvarezs)

### `Dependencies`

### `Deprecated`

## 3.2.1 [2024-10-30]

### `Added`

### `Changed`

### `Fixed`

- [#707](https://github.com/nf-core/mag/pull/674) - Fix missing space resulting in malformed args for MEGAHIT (reported by @d4straub, fix by @jfy133)

### `Dependencies`

| Tool | Previous version | New version |
Expand Down
2 changes: 1 addition & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ process {
}

withName: MEGAHIT {
ext.args = { params.megahit_options ? params.megahit_options + "-m ${task.memory.toBytes()}" : "-m ${task.memory.toBytes()}" }
ext.args = { params.megahit_options ? params.megahit_options + " -m ${task.memory.toBytes()}" : "-m ${task.memory.toBytes()}" }
ext.prefix = { "MEGAHIT-${meta.id}" }
publishDir = [path: { "${params.outdir}/Assembly/MEGAHIT" }, mode: params.publish_dir_mode, pattern: "*.{fa.gz,log}"]
}
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ params {
refine_bins_dastool = false
refine_bins_dastool_threshold = 0.5
postbinning_input = 'raw_bins_only'
exclude_unbins_from_postbinning = false

// Bin QC
skip_binqc = false
Expand Down
6 changes: 6 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,12 @@
"type": "integer",
"default": 3000,
"description": "Minimum contig length for Tiara to use for domain classification. For accurate classification, should be longer than 3000 bp."
},
"exclude_unbins_from_postbinning": {
"type": "boolean",
"description": "Exclude unbinned contigs in the post-binning steps (bin QC, taxonomic classification, and annotation steps).",
"help": "If you're not interested in assemby results that are not considered 'genome level', excluding unbinned contigs can greatly speed up downstream steps such as Prokka, that can be quite slow and spin up many tasks.",
"default": false
}
}
},
Expand Down
20 changes: 12 additions & 8 deletions workflows/mag.nf
Original file line number Diff line number Diff line change
Expand Up @@ -782,15 +782,19 @@ workflow MAG {
ch_input_for_postbinning_bins_unbins = ch_binning_results_bins.mix(ch_binning_results_unbins)
}

DEPTHS(ch_input_for_postbinning_bins_unbins, BINNING.out.metabat2depths, ch_short_reads)
ch_input_for_postbinning = params.exclude_unbins_from_postbinning
? ch_input_for_postbinning_bins
: ch_input_for_postbinning_bins_unbins

DEPTHS(ch_input_for_postbinning, BINNING.out.metabat2depths, ch_short_reads)
ch_input_for_binsummary = DEPTHS.out.depths_summary
ch_versions = ch_versions.mix(DEPTHS.out.versions)

/*
* Bin QC subworkflows: for checking bin completeness with either BUSCO, CHECKM, CHECKM2, and/or GUNC
*/

ch_input_bins_for_qc = ch_input_for_postbinning_bins_unbins.transpose()
ch_input_bins_for_qc = ch_input_for_postbinning.transpose()

BIN_QC(
ch_input_bins_for_qc,
Expand All @@ -802,7 +806,7 @@ workflow MAG {
ch_versions = ch_versions.mix(BIN_QC.out.versions)

if (params.run_gunc) {
ch_input_bins_for_gunc = ch_input_for_postbinning_bins_unbins.filter { meta, bins ->
ch_input_bins_for_gunc = ch_input_for_postbinning.filter { meta, bins ->
meta.domain != "eukarya"
}

Expand All @@ -817,7 +821,7 @@ workflow MAG {

ch_quast_bins_summary = Channel.empty()
if (!params.skip_quast) {
ch_input_for_quast_bins = ch_input_for_postbinning_bins_unbins
ch_input_for_quast_bins = ch_input_for_postbinning
.groupTuple()
.map { meta, bins ->
def new_bins = bins.flatten()
Expand Down Expand Up @@ -846,7 +850,7 @@ workflow MAG {
ch_cat_db = CAT_DB_GENERATE.out.db
}
CAT(
ch_input_for_postbinning_bins_unbins,
ch_input_for_postbinning,
ch_cat_db
)
// Group all classification results for each sample in a single file
Expand Down Expand Up @@ -877,7 +881,7 @@ workflow MAG {
ch_gtdbtk_summary = Channel.empty()
if (gtdb) {

ch_gtdb_bins = ch_input_for_postbinning_bins_unbins.filter { meta, bins ->
ch_gtdb_bins = ch_input_for_postbinning.filter { meta, bins ->
meta.domain != "eukarya"
}

Expand Down Expand Up @@ -911,7 +915,7 @@ workflow MAG {
*/

if (!params.skip_prokka) {
ch_bins_for_prokka = ch_input_for_postbinning_bins_unbins
ch_bins_for_prokka = ch_input_for_postbinning
.transpose()
.map { meta, bin ->
def meta_new = meta + [id: bin.getBaseName()]
Expand All @@ -930,7 +934,7 @@ workflow MAG {
}

if (!params.skip_metaeuk && (params.metaeuk_db || params.metaeuk_mmseqs_db)) {
ch_bins_for_metaeuk = ch_input_for_postbinning_bins_unbins
ch_bins_for_metaeuk = ch_input_for_postbinning
.transpose()
.filter { meta, bin ->
meta.domain in ["eukarya", "unclassified"]
Expand Down

0 comments on commit 0ebab07

Please sign in to comment.