@@ -76,8 +76,12 @@ def helpMessage() {
7676 --bwamem Turn on BWA Mem instead of CM/BWA aln for mapping
7777
7878 BAM Filtering
79- --bam_retain_unmapped Keep all reads in BAM file for downstream analysis
80- --bam_mapping_quality_threshold Minimum mapping quality for reads filter
79+ --bam_retain_unmapped Retains all unmapped reads in the BAM file (default)
80+ --bam_separate_unmapped Separates mapped and unmapped reads, keep mapped BAM for downstream analysis.
81+ --bam_unmapped_to_fastq Converts unmapped reads in BAM format to fastq.gz format.
82+ --bam_discard_unmapped Discards unmapped reads in either FASTQ or BAM format, depending on choice in --bam_unmapped_rm_type
83+ --bam_unmapped_rm_type Defines which unmapped read format to discard, options are "bam" or "fastq.gz".
84+ --bam_mapping_quality_threshold Minimum mapping quality for reads filter, default 0.
8185
8286 DeDuplication
8387 --dedupper Deduplication method to use
@@ -175,7 +179,7 @@ params.bwamem = false
175179params. bam_retain_unmapped = false
176180params. bam_discard_unmapped = false
177181params. bam_unmapped_to_fastq = false
178- params. bam_unmapped_keep_type = ' bam'
182+ params. bam_unmapped_rm_type = ' bam'
179183
180184params. bam_mapping_quality_threshold = 0
181185
@@ -719,7 +723,7 @@ process samtools_filter {
719723
720724 script:
721725 prefix= " $bam " - ~/ (\. bam)? /
722- rm_type = " ${ params.bam_unmapped_keep_type } " == ' bam' ? ' bam' : ' fastq.gz'
726+ rm_type = " ${ params.bam_unmapped_rm_type } " == ' bam' ? ' bam' : ' fastq.gz'
723727 rm_unmapped = " ${ params.bam_discard_unmapped} " ? " rm *.unmapped.${ rm_type} " : ' '
724728 fq_convert = " ${ params.bam_unmapped_to_fastq} " ? " samtools fastq -tn ${ prefix} .unmapped.bam | pigz -p ${ task.cpus} > ${ prefix} .unmapped.fq.gz" : ' '
725729
0 commit comments