From 915c530d963f63e20797b4e98843c96875c9a1e1 Mon Sep 17 00:00:00 2001 From: Alexander Peltzer Date: Mon, 5 Nov 2018 19:29:04 +0100 Subject: [PATCH] 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"