From 915c530d963f63e20797b4e98843c96875c9a1e1 Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Mon, 5 Nov 2018 19:29:04 +0100 Subject: [PATCH 01/15] Adjustments for #76 , rename certain options to be more explicit --- docs/usage.md | 8 ++++---- main.nf | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 5bb1979dd..4b92d337d 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -383,17 +383,17 @@ Turn this on to utilize BWA Mem instead of `bwa aln` for alignment. Can be quite Users can configure to keep/discard/extract certain groups of reads efficiently in the nf-core/eager pipeline. -### `--bam_keep_mapped_only` +### `--bam_analyse_mapped_only` -This can be used to only keep mapped reads for downstream analysis. By default turned off, all reads are kept in the BAM file. Unmapped reads are stored both in BAM and FastQ format e.g. for different downstream processing. +This can be used to only keep mapped reads in the BAM file for downstream analysis. By default turned off, all reads are kept in the BAM file. Unmapped reads are stored both in BAM and FastQ format e.g. for different downstream processing. ### `--bam_keep_all` Turned on by default, keeps all reads that were mapped in the dataset. -### `--bam_filter_reads` +### `--bam_retain_all_reads` -Specify this, if you want to filter reads for downstream analysis. +Specify this, if you want to filter reads for downstream analysis. This keeps all mapped and unmapped reads in the output, but allows for quality threshold filtering using `--bam_mapping_quality_threshold`. ### `--bam_mapping_quality_threshold` diff --git a/main.nf b/main.nf index 82e085c91..46a037698 100644 --- a/main.nf +++ b/main.nf @@ -76,8 +76,8 @@ def helpMessage() { --bwamem Turn on BWA Mem instead of CM/BWA aln for mapping BAM Filtering - --bam_keep_mapped_only Only consider mapped reads for downstream analysis. Unmapped reads are extracted to separate output. - --bam_filter_reads Keep all reads in BAM file for downstream analysis + --bam_analyse_mapped_only Only consider mapped reads for downstream analysis. Unmapped reads are extracted to separate output. + --bam_retain_all_reads Keep all reads in BAM file for downstream analysis --bam_mapping_quality_threshold Minimum mapping quality for reads filter DeDuplication @@ -173,9 +173,9 @@ params.circularfilter = false params.bwamem = false //BAM Filtering steps (default = keep mapped and unmapped in BAM file) -params.bam_keep_mapped_only = false +params.bam_analyse_mapped_only = false params.bam_keep_all = true -params.bam_filter_reads = false +params.bam_retain_all_reads = false params.bam_mapping_quality_threshold = 0 //DamageProfiler settings @@ -715,12 +715,12 @@ process samtools_filter { file "*.unmapped.bam" optional true file "*.bai" - when: "${params.bam_filter_reads}" + when: "${params.bam_retain_all_reads}" script: prefix="$bam" - ~/(\.bam)?/ - if("${params.bam_keep_mapped_only}"){ + if("${params.bam_analyse_mapped_only}"){ """ samtools view -h $bam | tee >(samtools view - -@ ${task.cpus} -f4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.unmapped.bam) >(samtools view - -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.filtered.bam) samtools fastq -tn "${prefix}.unmapped.bam" | gzip > "${prefix}.unmapped.fq.gz" From 85be0a67eea64bbfedd466b71c3d1092eea85e44 Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Mon, 5 Nov 2018 19:31:45 +0100 Subject: [PATCH 02/15] Changelog update ++ [skip_ci] --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0f862f28..7976ceb12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * [#80](https://github.com/nf-core/eager/pull/80) - BWA Index file handling * [#77](https://github.com/nf-core/eager/pull/77) - Lots of documentation updates by [@jfy133](https://github.com/jfy133) +### `Changed` +* [#81](https://github.com/nf-core/eager/pull/81) - Renaming of certain BAM options + ## [2.0.2] - 2018-11-03 ### `Changed` From ee06114ccde1bab61acad6cfcdc052eddb28be36 Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Tue, 6 Nov 2018 12:48:17 +0100 Subject: [PATCH 03/15] Fix binac profile [skip_ci] --- conf/binac.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/binac.config b/conf/binac.config index c35e58c92..68ba98f1e 100644 --- a/conf/binac.config +++ b/conf/binac.config @@ -10,7 +10,7 @@ singularity { } process { - beforeScript = 'module load devel/singularity/2.4.1' + beforeScript = 'module load devel/singularity/2.6.0' executor = 'pbs' queue = 'short' } From ee142956584548ba1b7c5e36e2c431822e8f3749 Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Tue, 6 Nov 2018 14:05:26 +0100 Subject: [PATCH 04/15] Add James' suggestion --- docs/usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage.md b/docs/usage.md index 4b92d337d..ca80c6cdd 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -385,7 +385,7 @@ Users can configure to keep/discard/extract certain groups of reads efficiently ### `--bam_analyse_mapped_only` -This can be used to only keep mapped reads in the BAM file for downstream analysis. By default turned off, all reads are kept in the BAM file. Unmapped reads are stored both in BAM and FastQ format e.g. for different downstream processing. +This can be used to only keep mapped reads in the BAM file for downstream analysis. By default turned off, where all reads are kept in the bam file. Unmapped reads are stored both in BAM and FastQ format e.g. for different downstream processing. ### `--bam_keep_all` From 8a20a1205c3c0b7e40577fae96dc18def69fd18a Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Tue, 6 Nov 2018 14:10:26 +0100 Subject: [PATCH 05/15] Unmapped reads can now be discarded --- main.nf | 3 +++ nextflow.config | 1 + 2 files changed, 4 insertions(+) diff --git a/main.nf b/main.nf index 46a037698..07fd192f0 100644 --- a/main.nf +++ b/main.nf @@ -719,12 +719,15 @@ process samtools_filter { script: prefix="$bam" - ~/(\.bam)?/ + rm_unmapped='' + "${params.bam_discard_unmapped_entirely} ? rm_unmapped='rm *.unmapped.*' : '' if("${params.bam_analyse_mapped_only}"){ """ samtools view -h $bam | tee >(samtools view - -@ ${task.cpus} -f4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.unmapped.bam) >(samtools view - -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.filtered.bam) samtools fastq -tn "${prefix}.unmapped.bam" | gzip > "${prefix}.unmapped.fq.gz" samtools index -@ ${task.cpus} ${prefix}.filtered.bam + ${rm_unmapped} """ } else { """ diff --git a/nextflow.config b/nextflow.config index c7e09733d..0f719a7b4 100644 --- a/nextflow.config +++ b/nextflow.config @@ -27,6 +27,7 @@ params { complexity_filter = false complexity_filter_poly_g_min = 10 trim_bam = false + bam_discard_unmapped_entirely = false // AWS Batch awsqueue = false From 0e415132cec401baa414e353df08b3dcbae5f98e Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Tue, 6 Nov 2018 14:10:39 +0100 Subject: [PATCH 06/15] Add usage documentation for discarding unmapped reads entirely --- docs/usage.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/usage.md b/docs/usage.md index ca80c6cdd..93d546255 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -387,9 +387,13 @@ Users can configure to keep/discard/extract certain groups of reads efficiently This can be used to only keep mapped reads in the BAM file for downstream analysis. By default turned off, where all reads are kept in the bam file. Unmapped reads are stored both in BAM and FastQ format e.g. for different downstream processing. +### `--bam_discard_unmapped_entirely` + +This discards all unmapped and extracted reads entirely. By default, this is turned off. + ### `--bam_keep_all` -Turned on by default, keeps all reads that were mapped in the dataset. +Turned on by default, keeps all reads that were mapped in the dataset. ### `--bam_retain_all_reads` From 5268b7c5d7778cfaa6963947634f84622d9debbe Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Tue, 6 Nov 2018 14:13:29 +0100 Subject: [PATCH 07/15] Small syntax error fix --- main.nf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.nf b/main.nf index 07fd192f0..d512daa38 100644 --- a/main.nf +++ b/main.nf @@ -719,8 +719,7 @@ process samtools_filter { script: prefix="$bam" - ~/(\.bam)?/ - rm_unmapped='' - "${params.bam_discard_unmapped_entirely} ? rm_unmapped='rm *.unmapped.*' : '' + rm_unmapped = params.params.bam_discard_unmapped_entirely ? 'rm *.unmapped.*' : '' if("${params.bam_analyse_mapped_only}"){ """ From ee4db692bc081f8e5270c09d1d0f775142d3630f Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Wed, 7 Nov 2018 09:22:58 +0100 Subject: [PATCH 08/15] Fix syntax error --- main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.nf b/main.nf index d512daa38..3347e1fde 100644 --- a/main.nf +++ b/main.nf @@ -719,7 +719,7 @@ process samtools_filter { script: prefix="$bam" - ~/(\.bam)?/ - rm_unmapped = params.params.bam_discard_unmapped_entirely ? 'rm *.unmapped.*' : '' + rm_unmapped = "${params.bam_discard_unmapped_entirely}" ? 'rm *.unmapped.*' : '' if("${params.bam_analyse_mapped_only}"){ """ From 460c7c8905bbd3cf7d57b77aef5e371335c4788e Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Mon, 19 Nov 2018 09:00:57 +0100 Subject: [PATCH 09/15] Add better bam filtering / extraction protocol --- main.nf | 39 +++++++++++++++++++++------------------ nextflow.config | 1 - 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/main.nf b/main.nf index 569f3ddcf..c45f0dd18 100644 --- a/main.nf +++ b/main.nf @@ -76,8 +76,7 @@ def helpMessage() { --bwamem Turn on BWA Mem instead of CM/BWA aln for mapping BAM Filtering - --bam_analyse_mapped_only Only consider mapped reads for downstream analysis. Unmapped reads are extracted to separate output. - --bam_retain_all_reads Keep all reads in BAM file for downstream analysis + --bam_retain_unmapped Keep all reads in BAM file for downstream analysis --bam_mapping_quality_threshold Minimum mapping quality for reads filter DeDuplication @@ -173,11 +172,14 @@ params.circularfilter = false params.bwamem = false //BAM Filtering steps (default = keep mapped and unmapped in BAM file) -params.bam_analyse_mapped_only = false -params.bam_keep_all = true -params.bam_retain_all_reads = false +params.bam_retain_unmapped = false +params.bam_discard_unmapped = false +params.bam_unmapped_to_fastq = false +params.bam_unmapped_keep_type = 'bam' + params.bam_mapping_quality_threshold = 0 + //DamageProfiler settings params.damageprofiler_length = 100 params.damageprofiler_threshold = 15 @@ -715,23 +717,24 @@ process samtools_filter { file "*.unmapped.bam" optional true file "*.bai" - when: "${params.bam_retain_all_reads}" - script: prefix="$bam" - ~/(\.bam)?/ - rm_unmapped = "${params.bam_discard_unmapped_entirely}" ? 'rm *.unmapped.*' : '' + rm_type = "${params.bam_unmapped_keep_type}" == 'bam' ? 'bam' : 'fastq' + rm_unmapped = "${params.bam_discard_unmapped}" ? "rm *.unmapped.${rm_type}" : '' + fq_convert = "${params.bam_unmapped_to_fastq}" ? "samtools fastq -tn "${prefix}.unmapped.bam" | gzip > "${prefix}.unmapped.fq.gz"" : + - if("${params.bam_analyse_mapped_only}"){ - """ - samtools view -h $bam | tee >(samtools view - -@ ${task.cpus} -f4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.unmapped.bam) >(samtools view - -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.filtered.bam) - samtools fastq -tn "${prefix}.unmapped.bam" | gzip > "${prefix}.unmapped.fq.gz" - samtools index ${prefix}.filtered.bam - """ + if("${params.bam_separate_unmapped}"){ + """ + samtools view -h $bam | tee >(samtools view - -@ ${task.cpus} -f4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.unmapped.bam) >(samtools view - -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.filtered.bam) + samtools index ${prefix}.filtered.bam + $fq_convert + """ } else { - """ - samtools view -h $bam | tee >(samtools view - -@ ${task.cpus} -f4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.unmapped.bam) >(samtools view - -@ ${task.cpus} -q ${params.bam_mapping_quality_threshold} -o ${prefix}.filtered.bam) - samtools index ${prefix}.filtered.bam - """ + """ + samtools view -h $bam -@ ${task.cpus} -q ${params.bam_mapping_quality_threshold} -o ${prefix}.filtered.bam) + samtools index ${prefix}.filtered.bam + """ } } diff --git a/nextflow.config b/nextflow.config index c3baf3571..b0674963b 100644 --- a/nextflow.config +++ b/nextflow.config @@ -27,7 +27,6 @@ params { complexity_filter = false complexity_filter_poly_g_min = 10 trim_bam = false - bam_discard_unmapped_entirely = false // AWS Batch awsqueue = false From 19871abc2d4a411026f77b571d9e2212e8f3001c Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Mon, 19 Nov 2018 09:10:16 +0100 Subject: [PATCH 10/15] Small typo fix --- main.nf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.nf b/main.nf index c45f0dd18..b8fea47b2 100644 --- a/main.nf +++ b/main.nf @@ -721,7 +721,7 @@ process samtools_filter { prefix="$bam" - ~/(\.bam)?/ rm_type = "${params.bam_unmapped_keep_type}" == 'bam' ? 'bam' : 'fastq' rm_unmapped = "${params.bam_discard_unmapped}" ? "rm *.unmapped.${rm_type}" : '' - fq_convert = "${params.bam_unmapped_to_fastq}" ? "samtools fastq -tn "${prefix}.unmapped.bam" | gzip > "${prefix}.unmapped.fq.gz"" : + fq_convert = "${params.bam_unmapped_to_fastq}" ? "samtools fastq -tn ${prefix}.unmapped.bam | gzip > ${prefix}.unmapped.fq.gz" : '' if("${params.bam_separate_unmapped}"){ @@ -729,6 +729,7 @@ process samtools_filter { samtools view -h $bam | tee >(samtools view - -@ ${task.cpus} -f4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.unmapped.bam) >(samtools view - -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.filtered.bam) samtools index ${prefix}.filtered.bam $fq_convert + $rm_unmapped """ } else { """ From 8720bef02b037d50835199afaf568e4d7b4c5895 Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Mon, 19 Nov 2018 09:12:21 +0100 Subject: [PATCH 11/15] Add gz to fastq --- main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.nf b/main.nf index b8fea47b2..100bef009 100644 --- a/main.nf +++ b/main.nf @@ -719,7 +719,7 @@ process samtools_filter { script: prefix="$bam" - ~/(\.bam)?/ - rm_type = "${params.bam_unmapped_keep_type}" == 'bam' ? 'bam' : 'fastq' + rm_type = "${params.bam_unmapped_keep_type}" == 'bam' ? 'bam' : 'fastq.gz' rm_unmapped = "${params.bam_discard_unmapped}" ? "rm *.unmapped.${rm_type}" : '' fq_convert = "${params.bam_unmapped_to_fastq}" ? "samtools fastq -tn ${prefix}.unmapped.bam | gzip > ${prefix}.unmapped.fq.gz" : '' From 38c333e7fbb75399198c84457d98050ce3fd8355 Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Mon, 19 Nov 2018 09:14:30 +0100 Subject: [PATCH 12/15] Speed up using pigz! --- environment.yml | 1 + main.nf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 014fa9364..50a776826 100644 --- a/environment.yml +++ b/environment.yml @@ -22,6 +22,7 @@ dependencies: - bioconda::pmdtools=0.60 - conda-forge::r-rmarkdown=1.10 - conda-forge::libiconv=1.15 + - conda-forge::pigz=2.3.4 - bioconda::sequencetools=1.2.2 - bioconda::preseq=2.0.3 - bioconda::fastp=0.19.4 diff --git a/main.nf b/main.nf index 100bef009..7ec6fa508 100644 --- a/main.nf +++ b/main.nf @@ -721,7 +721,7 @@ process samtools_filter { prefix="$bam" - ~/(\.bam)?/ rm_type = "${params.bam_unmapped_keep_type}" == 'bam' ? 'bam' : 'fastq.gz' rm_unmapped = "${params.bam_discard_unmapped}" ? "rm *.unmapped.${rm_type}" : '' - fq_convert = "${params.bam_unmapped_to_fastq}" ? "samtools fastq -tn ${prefix}.unmapped.bam | gzip > ${prefix}.unmapped.fq.gz" : '' + fq_convert = "${params.bam_unmapped_to_fastq}" ? "samtools fastq -tn ${prefix}.unmapped.bam | pigz -p ${task.cpus} > ${prefix}.unmapped.fq.gz" : '' if("${params.bam_separate_unmapped}"){ From 3a52c838ea64282e8344b55f2ceae0f259dba838 Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Mon, 19 Nov 2018 09:21:44 +0100 Subject: [PATCH 13/15] Better help function :) --- main.nf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main.nf b/main.nf index 7ec6fa508..b471537c2 100644 --- a/main.nf +++ b/main.nf @@ -76,8 +76,12 @@ def helpMessage() { --bwamem Turn on BWA Mem instead of CM/BWA aln for mapping BAM Filtering - --bam_retain_unmapped Keep all reads in BAM file for downstream analysis - --bam_mapping_quality_threshold Minimum mapping quality for reads filter + --bam_retain_unmapped Retains all unmapped reads in the BAM file (default) + --bam_separate_unmapped Separates mapped and unmapped reads, keep mapped BAM for downstream analysis. + --bam_unmapped_to_fastq Converts unmapped reads in BAM format to fastq.gz format. + --bam_discard_unmapped Discards unmapped reads in either FASTQ or BAM format, depending on choice in --bam_unmapped_rm_type + --bam_unmapped_rm_type Defines which unmapped read format to discard, options are "bam" or "fastq.gz". + --bam_mapping_quality_threshold Minimum mapping quality for reads filter, default 0. DeDuplication --dedupper Deduplication method to use @@ -175,7 +179,7 @@ params.bwamem = false params.bam_retain_unmapped = false params.bam_discard_unmapped = false params.bam_unmapped_to_fastq = false -params.bam_unmapped_keep_type = 'bam' +params.bam_unmapped_rm_type = 'bam' params.bam_mapping_quality_threshold = 0 @@ -719,7 +723,7 @@ process samtools_filter { script: prefix="$bam" - ~/(\.bam)?/ - rm_type = "${params.bam_unmapped_keep_type}" == 'bam' ? 'bam' : 'fastq.gz' + rm_type = "${params.bam_unmapped_rm_type}" == 'bam' ? 'bam' : 'fastq.gz' rm_unmapped = "${params.bam_discard_unmapped}" ? "rm *.unmapped.${rm_type}" : '' fq_convert = "${params.bam_unmapped_to_fastq}" ? "samtools fastq -tn ${prefix}.unmapped.bam | pigz -p ${task.cpus} > ${prefix}.unmapped.fq.gz" : '' From 98bbf2700ec68ca5b7a817c52de5c42a45131973 Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Mon, 19 Nov 2018 09:29:11 +0100 Subject: [PATCH 14/15] Update usage as well in docs --- docs/usage.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 93d546255..d9d38376b 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -383,21 +383,25 @@ Turn this on to utilize BWA Mem instead of `bwa aln` for alignment. Can be quite Users can configure to keep/discard/extract certain groups of reads efficiently in the nf-core/eager pipeline. -### `--bam_analyse_mapped_only` +### `--bam_retain_unmapped` -This can be used to only keep mapped reads in the BAM file for downstream analysis. By default turned off, where all reads are kept in the bam file. Unmapped reads are stored both in BAM and FastQ format e.g. for different downstream processing. +Specify this to keep also unmapped reads in the BAM file. This is the default setting, only mapping quality filters are applied to all reads. -### `--bam_discard_unmapped_entirely` +### `--bam_separate_unmapped` -This discards all unmapped and extracted reads entirely. By default, this is turned off. +Separates the mapped and unmapepd reads, keeps only mapped reads in the BAM file for downstream analysis. -### `--bam_keep_all` +### `--bam_unmapped_to_fastq` -Turned on by default, keeps all reads that were mapped in the dataset. +Converted unmapped reads in BAM format to compressed FastQ format. -### `--bam_retain_all_reads` +### `--bam_discard_unmapped` -Specify this, if you want to filter reads for downstream analysis. This keeps all mapped and unmapped reads in the output, but allows for quality threshold filtering using `--bam_mapping_quality_threshold`. +Discards unmapped reads in either FastQ or BAM format, depending on the choice of the `--bam_unmapped_rm_type`. + +### `--bam_unmapped_rm_type` + +Defines which unmapped read format to discard, options available are `bam` or `fastq.gz`. By default, `fastq.gz` format will be kept and `bam` will be removed. ### `--bam_mapping_quality_threshold` From a05b426a5a082841185c54865175e37d70f36a22 Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Mon, 19 Nov 2018 13:20:12 +0100 Subject: [PATCH 15/15] Update defaults --- main.nf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.nf b/main.nf index b471537c2..02b572325 100644 --- a/main.nf +++ b/main.nf @@ -176,7 +176,8 @@ params.circularfilter = false params.bwamem = false //BAM Filtering steps (default = keep mapped and unmapped in BAM file) -params.bam_retain_unmapped = false +params.bam_retain_unmapped = true +params.bam_separate_unmapped = false params.bam_discard_unmapped = false params.bam_unmapped_to_fastq = false params.bam_unmapped_rm_type = 'bam'