Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
caf4707
Initial implementation of deep mased
SkyLexS Mar 17, 2026
7b1aa6e
Fix DEEPMASED features: use -p 1 to avoid multiprocessing crash in Do…
SkyLexS Mar 17, 2026
9fcc1d2
Set DEEPMASED time limit to 48h
SkyLexS Mar 18, 2026
7a7c780
DEEPMASED: restore -p task.cpus, add --shm-size=8g to fix Docker /dev…
SkyLexS Mar 19, 2026
408d2b7
DEEPMASED: set 12 CPUs, 72GB RAM
SkyLexS Mar 19, 2026
589b38c
increasing time and resources for deepmased
SkyLexS Mar 22, 2026
5dabb01
Merge pull request #1005 from nf-core/dev
dialvarezs Mar 31, 2026
9c2480b
Split DEEPMASED into DEEPMASED_FEATURES and DEEPMASED_PREDICT
SkyLexS May 9, 2026
20bda3e
removed hardcodded parameter
SkyLexS May 12, 2026
b146ca8
removed hardcodded parameter
SkyLexS May 12, 2026
4ceb899
Merge branch 'nf-core:main' into deep_mased_imp
SkyLexS May 12, 2026
996f2d8
added optional parameters in the module.config
SkyLexS May 17, 2026
33a9052
sincroninzing modules and mag
SkyLexS Jun 13, 2026
0d9a431
syncronised with modules
SkyLexS Jun 17, 2026
ea43a6b
Merge branch 'dev' into deep_mased_imp
SkyLexS Jun 17, 2026
5b21b5d
fixing lint and test snapshots
SkyLexS Jun 17, 2026
169e582
fixing conflicts
SkyLexS Jun 17, 2026
8c5e2b4
regenerated the test snapshots
SkyLexS Jun 18, 2026
d5a61b8
rerun the tests and moved config to base config also edited the md files
SkyLexS Jun 20, 2026
32a8edb
Merge branch 'dev' into deep_mased_imp
SkyLexS Jun 21, 2026
742ed7e
modified a bit the tests and dealt with deepmased added some files in…
SkyLexS Jun 21, 2026
45461a9
Merge branch 'dev' into deep_mased_imp
SkyLexS Jul 12, 2026
9773bca
added PR number on changelog
SkyLexS Jul 12, 2026
d5b38e4
resolving linting errors
SkyLexS Jul 12, 2026
f491aed
fixing linting errors
SkyLexS Jul 12, 2026
17c85f1
fixing test snapshots and removing undeterministic tests
SkyLexS Jul 12, 2026
0a0d96c
fixing more tests
SkyLexS Jul 14, 2026
101a8e2
Merge branch 'dev' into deep_mased_imp
SkyLexS Jul 14, 2026
a2e83e6
fixing test snapshots
SkyLexS Jul 15, 2026
1284788
Merge branch 'dev' into deep_mased_imp
SkyLexS Jul 15, 2026
bc79433
fixing snapshots
SkyLexS Jul 15, 2026
34b95e8
Merge branch 'dev' into deep_mased_imp
SkyLexS Jul 15, 2026
41edf6e
fixing snapshots
SkyLexS Jul 16, 2026
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 @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#1042](https://github.com/nf-core/mag/pull/1042) - Add nf-test snapshot for `test_default` profile (by @dialvarezs)
- [#1044](https://github.com/nf-core/mag/pull/1044) - Add new `--gtdbtk_place_species` parameter (by @dialvarezs)
- [#1047](https://github.com/nf-core/mag/issues/1007) - Add `--gtdbtk_single_job` to run GTDB-Tk classification for all bins in a single job (requested by @sarah-shah-bioinf, by @dialvarezs)
- [#1051](https://github.com/nf-core/mag/pull/1051) - Add DeepMAsED assembly error detection to the MAG workflow as two sequential steps (`features` and `predict`) for short-read assemblies (by @SkyLexS).
- [#1048](https://github.com/nf-core/mag/pull/1048) - Add optional PyPOLCA polishing for long-read assemblies via `--run_pypolca` (by @Harshita-sriv)
- [#1059](https://github.com/nf-core/mag/pull/1059) - Add `--filtlong_filtering_by_shortreads` parameter to enable filtlong's short-read-based long read filtering (by @dialvarezs)
- [#1063](https://github.com/nf-core/mag/pull/1063) - Add new `--ale_per_base_output` parameter to enable ALE per-base output (by @dialvarezs)
Expand Down
4 changes: 4 additions & 0 deletions CITATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@

> Sieber, C. M. K., et al. 2018. "Recovery of Genomes from Metagenomes via a Dereplication, Aggregation and Scoring Strategy." Nature Microbiology 3 (7): 836-43. doi: 10.1038/s41564-018-0171-1

- [DeepMAsED](https://doi.org/10.1371/journal.pcbi.1009993)

> Athreya, A., Diment, J., Poroyko, V., & Treangen, T. J. (2022). DeepMAsED: Evaluating the quality of metagenomic assemblies using deep learning. PLoS Computational Biology, 18(5), e1009993. doi: 10.1371/journal.pcbi.1009993

- [FastP](https://doi.org/10.1093/bioinformatics/bty560)

> Chen, S., Zhou, Y., Chen, Y., & Gu, J. (2018). fastp: an ultra-fast all-in-one FASTQ preprocessor. Bioinformatics , 34(17), i884–i890. doi: 10.1093/bioinformatics/bty560.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ By default, the pipeline currently performs the following: it supports both shor
The pipeline then:

- performs assembly using [MEGAHIT](https://github.com/voutcn/megahit) and [SPAdes](http://cab.spbu.ru/software/spades/), and checks their quality using [Quast](http://quast.sourceforge.net/quast) and [ALE](https://github.com/sc932/ALE) (if short read data is used)
- performs per-contig assembly error detection for short-read assemblies using [DeepMAsED](https://github.com/leylabmpi/DeepMAsED)
- (optionally) polishes long-read assemblies with short reads using [pypolca](https://github.com/gbouras13/pypolca)
- (optionally) performs ancient DNA assembly validation using [PyDamage](https://github.com/maxibor/pydamage) and contig consensus sequence recalling with [Freebayes](https://github.com/freebayes/freebayes) and [BCFtools](http://samtools.github.io/bcftools/bcftools.html)
- predicts protein-coding genes for the assemblies using [Prodigal](https://github.com/hyattpd/Prodigal), and bins with [Prokka](https://github.com/tseemann/prokka) and optionally [MetaEuk](https://www.google.com/search?channel=fs&client=ubuntu-sn&q=MetaEuk)
Expand Down
10 changes: 10 additions & 0 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@ process {
time = { 8.h * task.attempt }
errorStrategy = { task.exitStatus in ((130..145) + [104, 175, 247]) ? 'retry' : 'finish' }
}
withName: DEEPMASED_FEATURES {
cpus = { 12 * task.attempt }
memory = { 120.GB * task.attempt }
time = { 96.h * task.attempt }
}
withName: DEEPMASED_PREDICT {
cpus = { 4 * task.attempt }
memory = { 24.GB * task.attempt }
time = { 4.h * task.attempt }
}
withName: METABAT2_METABAT2 {
cpus = { 8 * task.attempt }
memory = { 20.GB * task.attempt }
Expand Down
20 changes: 20 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,26 @@ process {
ext.args = { params.ale_per_base_output ? "--metagenome" : "--metagenome --nout" }
}

withName: DEEPMASED_FEATURES {
ext.args = { params.deepmased_features_gzip ? '--gzip' : '' }
publishDir = [
path: { "${params.outdir}/Assembly/${meta.assembler}/QC/${meta.id}/DeepMAsED/features" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
ext.prefix = { "${meta.id}-${meta.assembler}" }
}

withName: DEEPMASED_PREDICT {
ext.args = { [ params.deepmased_cpu_only ? '--cpu-only' : '', "--seed ${params.deepmased_predict_seed}" ].join(' ').trim() }
publishDir = [
path: { "${params.outdir}/Assembly/${meta.assembler}/QC/${meta.id}/DeepMAsED" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
ext.prefix = { "${meta.id}-${meta.assembler}" }
}

withName: 'QUAST_BINS|CONCAT_QUAST_SUMMARY' {
publishDir = [
path: { "${params.outdir}/GenomeBinning/QC" },
Expand Down
2 changes: 2 additions & 0 deletions conf/test_alternatives.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ params {

// Input data
input = params.pipelines_testdata_base_path + 'mag/samplesheets/samplesheet.v4.csv'
busco_db = params.pipelines_testdata_base_path + 'mag/databases/busco/bacteria_odb10.2024-01-08.tar.gz'
busco_db_lineage = 'bacteria_odb10'
clip_tool = 'trimmomatic'
coassemble_group = true
run_busco = true
Expand Down
1 change: 1 addition & 0 deletions conf/test_longreadonly.config
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ params {
skip_metabinner = true
skip_semibin = true
skip_ale = true
skip_deepmased = true
}

singularity.pullTimeout = 30.m
2 changes: 2 additions & 0 deletions conf/test_longreadonly_alternatives.config
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ params {
skip_comebin = true
skip_metabinner = true
skip_semibin = true
skip_metaeuk = true
skip_deepmased = true
}
21 changes: 21 additions & 0 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,27 @@ ALE can run only on assemblies generated from short reads, like SPAdes and MEGAH

</details>

### Assembly Quality Control with DeepMAsED

[DeepMAsED (Deep learning for Metagenome Assembly Error Detection)](https://github.com/leylabmpi/DeepMAsED) uses a pre-trained neural network to predict per-contig misassembly scores from read alignment features. It runs in two sequential steps implemented as separate Nextflow modules:

**`DEEPMASED_FEATURES`** extracts alignment statistics (coverage, mismatches, indels, base quality) from the BAM file for each contig and produces feature tables. This is the computationally intensive step.

**`DEEPMASED_PREDICT`** applies the pre-trained model to the feature tables and outputs a misassembly score per contig (0 = correctly assembled, 1 = likely misassembly).

DeepMAsED only runs on short-read assemblies (MEGAHIT, SPAdes). It cannot be used with long-read or hybrid assemblies.

<details markdown="1">
<summary>Output files</summary>

- `Assembly/[assembler]/QC/[sample/group]/DeepMAsED/features/`
- `[sample]-[assembler]_feature_file_paths.tsv`: Index file listing all generated feature table files
- `[sample]-[assembler]*_feats.tsv`: Per-contig feature tables (one per parallel processing bin)
- `Assembly/[assembler]/QC/[sample/group]/DeepMAsED/`
- `[sample]-[assembler]_deepmased_predictions.tsv`: Per-contig misassembly scores. Score of 0 indicates a correctly assembled contig; score of 1 indicates a likely misassembly.

</details>

## Gene prediction

Protein-coding genes are predicted for each assembly.
Expand Down
10 changes: 10 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,16 @@ This feature was removed in version 5.0.0 to strengthen the pipeline's focus on

If you require taxonomic profiling of raw reads, we recommend using [nf-core/taxprofiler](https://nf-co.re/taxprofiler/), which is specifically designed for taxonomic profiling of raw reads and supports a wide range of tools for this purpose.

## A note on DeepMAsED assembly error detection

When enabled, DeepMAsED performs per-contig assembly error detection on short-read assemblies (MEGAHIT and SPAdes).

Useful parameters:

- `--skip_deepmased` to skip DeepMAsED entirely.
- `--skip_deepmased_predict` to run only feature extraction.
- `--deepmased_cpu_only` to force CPU-only inference.

## BIgMAG compatibility

With the parameter `--generate_bigmag_file` a module will be triggered to generate a file that contains the output from all of the bin-quality tools that can be uploaded to the [BIgMAG](https://github.com/jeffe107/BIgMAG) dashboard for visualising and evaluating MAGs.
Expand Down
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,16 @@
"git_sha": "e753770db613ce014b3c4bc94f6cba443427b726",
"installed_by": ["modules"]
},
"deepmased/features": {
"branch": "master",
"git_sha": "8eb801777f42fb9e3e1f6e0402e7f571c59e431c",
"installed_by": ["modules"]
},
"deepmased/predict": {
"branch": "master",
"git_sha": "8eb801777f42fb9e3e1f6e0402e7f571c59e431c",
"installed_by": ["modules"]
},
"fastp": {
"branch": "master",
"git_sha": "d9ec4ef289ad39b8a662a7a12be50409b11df84b",
Expand Down
9 changes: 9 additions & 0 deletions modules/nf-core/deepmased/features/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions modules/nf-core/deepmased/features/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 114 additions & 0 deletions modules/nf-core/deepmased/features/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading