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 @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Fixed`

- [#894](https://github.com/nf-core/mag/pull/894) - Fix read order in metaSPAdes to allow co-assembly of paired-end data of multiple samples (reported by @maartenciers, fix by @jfy133 with contributions from @prototaxites, @d4straub and @dialvarezs)
- [#927](https://github.com/nf-core/mag/pull/927) - MetaBinner now succeeds when no contigs are too short or all are binned (reported by @MicroSeq, fix by @d4straub)
- [#929](https://github.com/nf-core/mag/pull/929) - Allow the domain_classification.R script to run with any assembler, not just Megahit or Spades (reported by @MicroSeq, fix by @prototaxites)

Expand Down
1 change: 1 addition & 0 deletions conf/test_alternatives.config
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ params {
// Input data
input = params.pipelines_testdata_base_path + 'mag/samplesheets/samplesheet.v4.csv'
clip_tool = 'trimmomatic'
coassemble_group = true
Comment thread
d4straub marked this conversation as resolved.
run_busco = true
busco_clean = true
run_checkm2 = true
Expand Down
25 changes: 17 additions & 8 deletions subworkflows/local/assembly/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,27 @@ workflow ASSEMBLY {
.groupTuple(by: 0)
.map { group, metas, reads ->
def assemble_as_single = params.single_end || (params.bbnorm && params.coassemble_group)
def meta = [:]
meta.id = "group-${group}"
meta.group = group
meta.single_end = assemble_as_single
meta.sr_platform = metas.sr_platform[0]
def meta = [
id: "group-${group}",
group: group,
single_end: assemble_as_single,
sr_platform: metas.sr_platform[0]
]
if (assemble_as_single) {
[meta, reads.collect { it }, []]
[meta, reads.collect { file -> file }, []]
}
else {
[meta, reads.collect { it[0] }, reads.collect { it[1] }]
[meta] + reads.sort { files -> files[0].getName() }.transpose()
Comment thread
jfy133 marked this conversation as resolved.
}
}

// We have to merge reads together to match tuple structure of POOL_SHORT_READS/
// This MUST be in a interleaved structure (s1_r1, s1_r2, s2_r1, s2_r2, ...)
// So we zip the lists of R1s and R2s, consistent order is ensured by the existing structure
ch_short_reads_grouped_for_pooling = ch_short_reads_grouped.map { meta, reads1, reads2 ->
[meta, [reads1, reads2].transpose().flatten()]
}

// long reads
// group and set group as new id
ch_long_reads_grouped = ch_long_reads
Expand Down Expand Up @@ -73,7 +82,7 @@ workflow ASSEMBLY {
ch_short_reads_spades = ch_short_reads_grouped.map { [it[0], it[1]] }
}
else {
POOL_SHORT_READS(ch_short_reads_grouped)
POOL_SHORT_READS(ch_short_reads_grouped_for_pooling)
ch_versions = ch_versions.mix(POOL_SHORT_READS.out.versions)
ch_short_reads_spades = POOL_SHORT_READS.out.reads
}
Expand Down
Loading