Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the coverage report, we were using the samtools flags for decont. instead of mapping #8

Merged
merged 11 commits into from
Jun 3, 2024
23 changes: 14 additions & 9 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,24 @@ process {
]
}

withName: 'BWAMEM2_MEM' {
// This BWAMEM2_MEM belongs to the decontamination module
withName: 'BWAMEM2_MEM_DECONT' {
cpus = { check_max( 12 * task.attempt, 'cpus' ) }
memory = { check_max( 72.GB * task.attempt, 'memory' ) }
time = { check_max( 16.h * task.attempt, 'time' ) }
time = { check_max( 1.h * task.attempt, 'time' ) }
mberacochea marked this conversation as resolved.
Show resolved Hide resolved

ext.args = "-M"
ext.args2 = [
'-f',
'12',
'-F',
'256',
'-uS',
].join(' ').trim()
ext.args2 = "-f 12 -F 256 -uS"
}

// This BWAMEM2_MEM belongs to the coverage module
withName: 'BWAMEM2_MEM_COVERAGE' {
cpus = { check_max( 12 * task.attempt, 'cpus' ) }
memory = { check_max( 12.GB * task.attempt, 'memory' ) }
time = { check_max( 1.h * task.attempt, 'time' ) }

ext.args = "-M"
ext.args2 = "-F 12 -F 256 -uS"
mberacochea marked this conversation as resolved.
Show resolved Hide resolved
mberacochea marked this conversation as resolved.
Show resolved Hide resolved
}

withName: 'SAMTOOLS_BAM2FQ' {
Expand Down
Ales-ibt marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include { BWAMEM2_MEM } from '../../../modules/ebi-metagenomics/bwamem2/mem/main'
include { SAMTOOLS_BAM2FQ } from '../../../modules/ebi-metagenomics/samtools/bam2fq/main'
include { BWAMEM2_MEM as BWAMEM2_MEM_DECONT } from '../../../modules/ebi-metagenomics/bwamem2/mem/main'
include { SAMTOOLS_BAM2FQ } from '../../../modules/ebi-metagenomics/samtools/bam2fq/main'


workflow READS_BWAMEM2_DECONTAMINATION {
Expand Down
12 changes: 6 additions & 6 deletions subworkflows/local/assembly_coverage.nf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include { BWAMEM2_INDEX } from '../../modules/nf-core/bwamem2/index/main'
include { BWAMEM2_MEM } from '../../modules/ebi-metagenomics/bwamem2/mem/main'
include { BWAMEM2_MEM as BWAMEM2_MEM_COVERAGE } from '../../modules/ebi-metagenomics/bwamem2/mem/main'
include { SAMTOOLS_IDXSTATS } from '../../modules/nf-core/samtools/idxstats/main'
include { METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS } from '../../modules/nf-core/metabat2/jgisummarizebamcontigdepths/main'

Expand All @@ -19,21 +19,21 @@ workflow ASSEMBLY_COVERAGE {

ch_versions = ch_versions.mix(BWAMEM2_INDEX.out.versions)

BWAMEM2_MEM(
BWAMEM2_MEM_COVERAGE(
reads,
BWAMEM2_INDEX.out.index
)
ch_versions = ch_versions.mix(BWAMEM2_MEM.out.versions)

ch_versions = ch_versions.mix(BWAMEM2_MEM_COVERAGE.out.versions)

METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS(
BWAMEM2_MEM.out.bam
BWAMEM2_MEM_COVERAGE.out.bam
)

ch_versions = ch_versions.mix(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.versions)

SAMTOOLS_IDXSTATS(
BWAMEM2_MEM.out.bam
BWAMEM2_MEM_COVERAGE.out.bam
)

mberacochea marked this conversation as resolved.
Show resolved Hide resolved
ch_versions = ch_versions.mix(SAMTOOLS_IDXSTATS.out.versions)
Expand Down
3 changes: 2 additions & 1 deletion workflows/miassembler.nf
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ workflow MIASSEMBLER {
- Paired-end reads are assembled with MetaSPAdes, unless specified otherwise
- An error is raised if the assembler and read layout are incompatible (shouldn't happen...)
*/
qc_reads_extended = READS_QC.out.qc_reads.map{ meta, reads ->
qc_reads_extended = READS_QC.out.qc_reads.map { meta, reads ->
if ( params.assembler == "megahit" || meta.single_end ) {
return [ meta + [assembler: "megahit", assembler_version: params.megahit_version], reads]
} else if ( ["metaspades", "spades"].contains(params.assembler) || !meta.single_end ) {
Expand All @@ -134,6 +134,7 @@ workflow MIASSEMBLER {
megahit: meta.assembler == "megahit"
xspades: ["metaspades", "spades"].contains(meta.assembler)
}.set { qc_reads }

ch_versions = ch_versions.mix(READS_QC.out.versions)

/******************/
Expand Down
Loading