From 21a9b1f8bef235501f2f9ef0dff127cd32cdae6d Mon Sep 17 00:00:00 2001 From: Thiseas Christos Lamnidis Date: Thu, 18 Nov 2021 16:11:31 +0100 Subject: [PATCH 01/10] Sample name as SM in bam read groups. Retain RG info on bam merges --- main.nf | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/main.nf b/main.nf index b76f3da16..36d36a592 100644 --- a/main.nf +++ b/main.nf @@ -1271,14 +1271,14 @@ process bwa { """ bwa aln -t ${task.cpus} $fasta ${r1} -n ${params.bwaalnn} -l ${params.bwaalnl} -k ${params.bwaalnk} -o ${params.bwaalno} -f ${libraryid}.r1.sai bwa aln -t ${task.cpus} $fasta ${r2} -n ${params.bwaalnn} -l ${params.bwaalnl} -k ${params.bwaalnk} -o ${params.bwaalno} -f ${libraryid}.r2.sai - bwa sampe -r "@RG\\tID:ILLUMINA-${libraryid}\\tSM:${libraryid}\\tPL:illumina\\tPU:ILLUMINA-${libraryid}-${seqtype}" $fasta ${libraryid}.r1.sai ${libraryid}.r2.sai ${r1} ${r2} | samtools sort -@ ${task.cpus - 1} -O bam - > ${libraryid}_"${seqtype}".mapped.bam + bwa sampe -r "@RG\\tID:ILLUMINA-${libraryid}\\tSM:${samplename}\\tPL:illumina\\tPU:ILLUMINA-${libraryid}-${seqtype}" $fasta ${libraryid}.r1.sai ${libraryid}.r2.sai ${r1} ${r2} | samtools sort -@ ${task.cpus - 1} -O bam - > ${libraryid}_"${seqtype}".mapped.bam samtools index "${libraryid}"_"${seqtype}".mapped.bam ${size} """ } else { //PE collapsed, or SE data """ bwa aln -t ${task.cpus} ${fasta} ${r1} -n ${params.bwaalnn} -l ${params.bwaalnl} -k ${params.bwaalnk} -o ${params.bwaalno} -f ${libraryid}.sai - bwa samse -r "@RG\\tID:ILLUMINA-${libraryid}\\tSM:${libraryid}\\tPL:illumina\\tPU:ILLUMINA-${libraryid}-${seqtype}" $fasta ${libraryid}.sai $r1 | samtools sort -@ ${task.cpus - 1} -O bam - > "${libraryid}"_"${seqtype}".mapped.bam + bwa samse -r "@RG\\tID:ILLUMINA-${libraryid}\\tSM:${samplename}\\tPL:illumina\\tPU:ILLUMINA-${libraryid}-${seqtype}" $fasta ${libraryid}.sai $r1 | samtools sort -@ ${task.cpus - 1} -O bam - > "${libraryid}"_"${seqtype}".mapped.bam samtools index "${libraryid}"_"${seqtype}".mapped.bam ${size} """ } @@ -1309,12 +1309,12 @@ process bwamem { if (!params.single_end && params.skip_collapse){ """ - bwa mem -t ${split_cpus} $fasta $r1 $r2 -R "@RG\\tID:ILLUMINA-${libraryid}\\tSM:${libraryid}\\tPL:illumina\\tPU:ILLUMINA-${libraryid}-${seqtype}" | samtools sort -@ ${split_cpus} -O bam - > "${libraryid}"_"${seqtype}".mapped.bam + bwa mem -t ${split_cpus} $fasta $r1 $r2 -R "@RG\\tID:ILLUMINA-${libraryid}\\tSM:${samplename}\\tPL:illumina\\tPU:ILLUMINA-${libraryid}-${seqtype}" | samtools sort -@ ${split_cpus} -O bam - > "${libraryid}"_"${seqtype}".mapped.bam samtools index ${size} -@ ${task.cpus} "${libraryid}".mapped.bam """ } else { """ - bwa mem -t ${split_cpus} $fasta $r1 -R "@RG\\tID:ILLUMINA-${libraryid}\\tSM:${libraryid}\\tPL:illumina\\tPU:ILLUMINA-${libraryid}-${seqtype}" | samtools sort -@ ${split_cpus} -O bam - > "${libraryid}"_"${seqtype}".mapped.bam + bwa mem -t ${split_cpus} $fasta $r1 -R "@RG\\tID:ILLUMINA-${libraryid}\\tSM:${samplename}\\tPL:illumina\\tPU:ILLUMINA-${libraryid}-${seqtype}" | samtools sort -@ ${split_cpus} -O bam - > "${libraryid}"_"${seqtype}".mapped.bam samtools index -@ ${task.cpus} "${libraryid}"_"${seqtype}".mapped.bam ${size} """ } @@ -1378,7 +1378,7 @@ process circularmapper{ """ bwa aln -t ${task.cpus} $elongated_root $r1 -n ${params.bwaalnn} -l ${params.bwaalnl} -k ${params.bwaalnk} -f ${libraryid}.r1.sai bwa aln -t ${task.cpus} $elongated_root $r2 -n ${params.bwaalnn} -l ${params.bwaalnl} -k ${params.bwaalnk} -f ${libraryid}.r2.sai - bwa sampe -r "@RG\\tID:ILLUMINA-${libraryid}\\tSM:${libraryid}\\tPL:illumina\\tPU:ILLUMINA-${libraryid}-${seqtype}" $elongated_root ${libraryid}.r1.sai ${libraryid}.r2.sai $r1 $r2 > tmp.out + bwa sampe -r "@RG\\tID:ILLUMINA-${libraryid}\\tSM:${samplename}\\tPL:illumina\\tPU:ILLUMINA-${libraryid}-${seqtype}" $elongated_root ${libraryid}.r1.sai ${libraryid}.r2.sai $r1 $r2 > tmp.out realignsamfile -Xmx${task.memory.toGiga()}g -e ${params.circularextension} -i tmp.out -r $fasta $filter samtools sort -@ ${task.cpus} -O bam tmp_realigned.bam > ${libraryid}_"${seqtype}".mapped.bam samtools index "${libraryid}"_"${seqtype}".mapped.bam ${size} @@ -1386,7 +1386,7 @@ process circularmapper{ } else { """ bwa aln -t ${task.cpus} $elongated_root $r1 -n ${params.bwaalnn} -l ${params.bwaalnl} -k ${params.bwaalnk} -f ${libraryid}.sai - bwa samse -r "@RG\\tID:ILLUMINA-${libraryid}\\tSM:${libraryid}\\tPL:illumina\\tPU:ILLUMINA-${libraryid}-${seqtype}" $elongated_root ${libraryid}.sai $r1 > tmp.out + bwa samse -r "@RG\\tID:ILLUMINA-${libraryid}\\tSM:${samplename}\\tPL:illumina\\tPU:ILLUMINA-${libraryid}-${seqtype}" $elongated_root ${libraryid}.sai $r1 > tmp.out realignsamfile -Xmx${task.memory.toGiga()}g -e ${params.circularextension} -i tmp.out -r $fasta $filter samtools sort -@ ${task.cpus} -O bam tmp_realigned.bam > "${libraryid}"_"${seqtype}".mapped.bam samtools index "${libraryid}"_"${seqtype}".mapped.bam ${size} @@ -1456,13 +1456,13 @@ process bowtie2 { //PE data without merging, PE data without any AR applied if ( seqtype == 'PE' && ( params.skip_collapse || params.skip_adapterremoval ) ){ """ - bowtie2 -x ${fasta} -1 ${r1} -2 ${r2} -p ${split_cpus} ${sensitivity} ${bt2n} ${bt2l} ${trim5} ${trim3} --maxins ${params.bt2_maxins} --rg-id ILLUMINA-${libraryid} --rg SM:${libraryid} --rg PL:illumina --rg PU:ILLUMINA-${libraryid}-${seqtype} 2> "${libraryid}"_bt2.log | samtools sort -@ ${split_cpus} -O bam > "${libraryid}"_"${seqtype}".mapped.bam + bowtie2 -x ${fasta} -1 ${r1} -2 ${r2} -p ${split_cpus} ${sensitivity} ${bt2n} ${bt2l} ${trim5} ${trim3} --maxins ${params.bt2_maxins} --rg-id ILLUMINA-${libraryid} --rg SM:${samplename} --rg PL:illumina --rg PU:ILLUMINA-${libraryid}-${seqtype} 2> "${libraryid}"_bt2.log | samtools sort -@ ${split_cpus} -O bam > "${libraryid}"_"${seqtype}".mapped.bam samtools index "${libraryid}"_"${seqtype}".mapped.bam ${size} """ } else { //PE collapsed, or SE data """ - bowtie2 -x ${fasta} -U ${r1} -p ${split_cpus} ${sensitivity} ${bt2n} ${bt2l} ${trim5} ${trim3} --rg-id ILLUMINA-${libraryid} --rg SM:${libraryid} --rg PL:illumina --rg PU:ILLUMINA-${libraryid}-${seqtype} 2> "${libraryid}"_bt2.log | samtools sort -@ ${split_cpus} -O bam > "${libraryid}"_"${seqtype}".mapped.bam + bowtie2 -x ${fasta} -U ${r1} -p ${split_cpus} ${sensitivity} ${bt2n} ${bt2l} ${trim5} ${trim3} --rg-id ILLUMINA-${libraryid} --rg SM:${samplename} --rg PL:illumina --rg PU:ILLUMINA-${libraryid}-${seqtype} 2> "${libraryid}"_bt2.log | samtools sort -@ ${split_cpus} -O bam > "${libraryid}"_"${seqtype}".mapped.bam samtools index "${libraryid}"_"${seqtype}".mapped.bam ${size} """ } @@ -1594,7 +1594,7 @@ ch_branched_for_seqtypemerge = ch_mapping_for_seqtype_merging """ samtools merge ${libraryid}_seqtypemerged.bam ${bam} ## Have to set validation as lenient because of BWA issue: "I see a read stands out the end of a chromosome and is flagged as unmapped (flag 0x4). [...]" http://bio-bwa.sourceforge.net/ - picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${libraryid}_seqtypemerged.bam O=${libraryid}_seqtypemerged_rg.bam RGID=1 RGLB="${libraryid}_seqtypemerged" RGPL=illumina RGPU=4410 RGSM="${libraryid}_seqtypemerged" VALIDATION_STRINGENCY=LENIENT + # picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${libraryid}_seqtypemerged.bam O=${libraryid}_seqtypemerged_rg.bam RGID=1 RGLB="${libraryid}_seqtypemerged" RGPL=illumina RGPU=4410 RGSM="${libraryid}_seqtypemerged" VALIDATION_STRINGENCY=LENIENT samtools index ${libraryid}_seqtypemerged_rg.bam ${size} """ @@ -1965,7 +1965,7 @@ process library_merge { """ samtools merge ${samplename}_libmerged_rmdup.bam ${bam} ## Have to set validation as lenient because of BWA issue: "I see a read stands out the end of a chromosome and is flagged as unmapped (flag 0x4). [...]" http://bio-bwa.sourceforge.net/ - picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${samplename}_libmerged_rmdup.bam O=${samplename}_libmerged_rg_rmdup.bam RGID=1 RGLB="${samplename}_merged" RGPL=illumina RGPU=4410 RGSM="${samplename}_merged" VALIDATION_STRINGENCY=LENIENT + # picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${samplename}_libmerged_rmdup.bam O=${samplename}_libmerged_rg_rmdup.bam RGID=1 RGLB="${samplename}_merged" RGPL=illumina RGPU=4410 RGSM="${samplename}_merged" VALIDATION_STRINGENCY=LENIENT samtools index ${samplename}_libmerged_rg_rmdup.bam ${size} """ } @@ -2258,7 +2258,7 @@ process additional_library_merge { def size = params.large_ref ? '-c' : '' """ samtools merge ${samplename}_libmerged_add.bam ${bam} - picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${samplename}_libmerged_add.bam O=${samplename}_libmerged_rg_add.bam RGID=1 RGLB="${samplename}_additionalmerged" RGPL=illumina RGPU=4410 RGSM="${samplename}_additionalmerged" VALIDATION_STRINGENCY=LENIENT + # picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${samplename}_libmerged_add.bam O=${samplename}_libmerged_rg_add.bam RGID=1 RGLB="${samplename}_additionalmerged" RGPL=illumina RGPU=4410 RGSM="${samplename}_additionalmerged" VALIDATION_STRINGENCY=LENIENT samtools index ${samplename}_libmerged_rg_add.bam ${size} """ } From ef525d178a62b25e11aca1b7ae579897bc961b5d Mon Sep 17 00:00:00 2001 From: Thiseas Christos Lamnidis Date: Thu, 18 Nov 2021 16:32:44 +0100 Subject: [PATCH 02/10] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbbc3ce01..b3320766f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### `Added` + - [#808](https://github.com/nf-core/eager/issues/808) Retain read group information across bam merges. Sample set to Sample name in bwa output RG. + ### `Fixed` ### `Dependencies` From 79fedba361a4c6549f61d24abeeab93c360667a6 Mon Sep 17 00:00:00 2001 From: Thiseas Christos Lamnidis Date: Thu, 18 Nov 2021 16:50:45 +0100 Subject: [PATCH 03/10] Flexible filtering of reads for pileupcaller genotyping. --- CHANGELOG.md | 1 + main.nf | 7 +++++-- nextflow.config | 2 ++ nextflow_schema.json | 18 ++++++++++++++++-- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3320766f..fc5f556c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### `Added` - [#808](https://github.com/nf-core/eager/issues/808) Retain read group information across bam merges. Sample set to Sample name in bwa output RG. + - Map and base quality filters prior to genotyping with pileupcaller can now be specified. ### `Fixed` diff --git a/main.nf b/main.nf index 36d36a592..42aa09f88 100644 --- a/main.nf +++ b/main.nf @@ -2488,10 +2488,13 @@ process genotyping_pileupcaller { def ssmode = strandedness == "single" ? "--singleStrandMode" : "" def bam_list = bam.flatten().join(" ") def sample_names = samplename.flatten().join(",") + def map_q = params.pileupcaller_min_map_quality + def base_q = params.pileupcaller_min_base_quality + """ - samtools mpileup -B -q 30 -Q 30 ${use_bed} -f ${fasta} ${bam_list} | pileupCaller ${caller} ${ssmode} ${transitions_mode} --sampleNames ${sample_names} ${use_snp} -e pileupcaller.${strandedness} + samtools mpileup -B --ignore-RG -q ${map_q} -Q ${base_q} ${use_bed} -f ${fasta} ${bam_list} | pileupCaller ${caller} ${ssmode} ${transitions_mode} --sampleNames ${sample_names} ${use_snp} -e pileupcaller.${strandedness} """ -} +}} process eigenstrat_snp_coverage { label 'mc_tiny' diff --git a/nextflow.config b/nextflow.config index f86b9dbd8..df37dd6e4 100644 --- a/nextflow.config +++ b/nextflow.config @@ -174,6 +174,8 @@ params { pileupcaller_bedfile = null pileupcaller_method = 'randomHaploid' pileupcaller_transitions_mode = 'AllSites' + pileupcaller_min_map_quality = 30 + pileupcaller_min_base_quality = 30 // ANGSD Genotype Likelihoods angsd_glmodel = 'samtools' angsd_glformat = 'binary' diff --git a/nextflow_schema.json b/nextflow_schema.json index 60629e272..ae2f7e442 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -1185,6 +1185,20 @@ "SkipTransitions" ] }, + "pileupcaller_min_map_quality": { + "type": "integer", + "default": 30, + "description": "The minimum mapping quality to be used for genotyping.", + "fa_icon": "fas fa-filter", + "help_text": "The minimum mapping quality to be used for genotyping. Affects the `samtools pileup` output that is used by pileupcaller. Affects `-q` parameter of samtools mpileup." + }, + "pileupcaller_min_base_quality": { + "type": "integer", + "default": 30, + "description": "The minimum base quality to be used for genotyping.", + "fa_icon": "fas fa-filter", + "help_text": "The minimum base quality to be used for genotyping. Affects the `samtools pileup` output that is used by pileupcaller. Affects `-Q` parameter of samtools mpileup." + }, "angsd_glmodel": { "type": "string", "default": "samtools", @@ -1641,7 +1655,7 @@ "maltextract_percentidentity": { "type": "number", "description": "Minimum percent identity alignments are required to have to be reported. Recommended to set same as MALT parameter.", - "default": 85, + "default": 85.0, "fa_icon": "fas fa-id-card", "help_text": "Minimum percent identity alignments are required to have to be reported. Higher values allows fewer mismatches between read and reference sequence, but therefore will provide greater confidence in the hit. Lower values allow more mismatches, which can account for damage and divergence of a related strain/species to the reference. Recommended to set same as MALT parameter or higher. Default: `85.0`.\n\nOnly when `--metagenomic_tool malt` is also supplied.\n\n> Modifies MaltExtract parameter: `--minPI`" }, @@ -1736,4 +1750,4 @@ "$ref": "#/definitions/metagenomic_authentication" } ] -} +} \ No newline at end of file From 0344f01f236ca32ad158fb8452a50fa5f8da612e Mon Sep 17 00:00:00 2001 From: Thiseas Christos Lamnidis Date: Thu, 18 Nov 2021 16:56:46 +0100 Subject: [PATCH 04/10] Fix typo --- main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.nf b/main.nf index 42aa09f88..9de4fac9f 100644 --- a/main.nf +++ b/main.nf @@ -2494,7 +2494,7 @@ process genotyping_pileupcaller { """ samtools mpileup -B --ignore-RG -q ${map_q} -Q ${base_q} ${use_bed} -f ${fasta} ${bam_list} | pileupCaller ${caller} ${ssmode} ${transitions_mode} --sampleNames ${sample_names} ${use_snp} -e pileupcaller.${strandedness} """ -}} +} process eigenstrat_snp_coverage { label 'mc_tiny' From 6cf64b73e03cd4b73c592b92e7b59558b6a8168f Mon Sep 17 00:00:00 2001 From: "Thiseas C. Lamnidis" Date: Thu, 18 Nov 2021 19:04:37 +0100 Subject: [PATCH 05/10] Correct bam merging output name --- main.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.nf b/main.nf index 36d36a592..e0fc88469 100644 --- a/main.nf +++ b/main.nf @@ -1595,7 +1595,7 @@ ch_branched_for_seqtypemerge = ch_mapping_for_seqtype_merging samtools merge ${libraryid}_seqtypemerged.bam ${bam} ## Have to set validation as lenient because of BWA issue: "I see a read stands out the end of a chromosome and is flagged as unmapped (flag 0x4). [...]" http://bio-bwa.sourceforge.net/ # picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${libraryid}_seqtypemerged.bam O=${libraryid}_seqtypemerged_rg.bam RGID=1 RGLB="${libraryid}_seqtypemerged" RGPL=illumina RGPU=4410 RGSM="${libraryid}_seqtypemerged" VALIDATION_STRINGENCY=LENIENT - samtools index ${libraryid}_seqtypemerged_rg.bam ${size} + samtools index ${libraryid}_seqtypemerged.bam ${size} """ } @@ -1966,7 +1966,7 @@ process library_merge { samtools merge ${samplename}_libmerged_rmdup.bam ${bam} ## Have to set validation as lenient because of BWA issue: "I see a read stands out the end of a chromosome and is flagged as unmapped (flag 0x4). [...]" http://bio-bwa.sourceforge.net/ # picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${samplename}_libmerged_rmdup.bam O=${samplename}_libmerged_rg_rmdup.bam RGID=1 RGLB="${samplename}_merged" RGPL=illumina RGPU=4410 RGSM="${samplename}_merged" VALIDATION_STRINGENCY=LENIENT - samtools index ${samplename}_libmerged_rg_rmdup.bam ${size} + samtools index ${samplename}_libmerged_rmdup.bam ${size} """ } @@ -2259,7 +2259,7 @@ process additional_library_merge { """ samtools merge ${samplename}_libmerged_add.bam ${bam} # picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${samplename}_libmerged_add.bam O=${samplename}_libmerged_rg_add.bam RGID=1 RGLB="${samplename}_additionalmerged" RGPL=illumina RGPU=4410 RGSM="${samplename}_additionalmerged" VALIDATION_STRINGENCY=LENIENT - samtools index ${samplename}_libmerged_rg_add.bam ${size} + samtools index ${samplename}_libmerged_add.bam ${size} """ } From 5bbcd3083092e3b8f9a9a34663328d17631f68d1 Mon Sep 17 00:00:00 2001 From: "Thiseas C. Lamnidis" Date: Thu, 18 Nov 2021 20:41:04 +0100 Subject: [PATCH 06/10] Correct process output for bam merging proceses --- main.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.nf b/main.nf index e0fc88469..6d0df1873 100644 --- a/main.nf +++ b/main.nf @@ -1587,7 +1587,7 @@ ch_branched_for_seqtypemerge = ch_mapping_for_seqtype_merging tuple samplename, libraryid, lane, seqtype, organism, strandedness, udg, file(bam), file(bai) from ch_branched_for_seqtypemerge.merge_me output: - tuple samplename, libraryid, lane, seqtype, organism, strandedness, udg, file("*_seqtypemerged_rg.bam"), file("*_seqtypemerged_rg*.{bai,csi}") into ch_seqtypemerge_for_filtering + tuple samplename, libraryid, lane, seqtype, organism, strandedness, udg, file("*_seqtypemerged.bam"), file("*_seqtypemerged*.{bai,csi}") into ch_seqtypemerge_for_filtering script: def size = params.large_ref ? '-c' : '' @@ -1958,7 +1958,7 @@ process library_merge { tuple samplename, libraryid, lane, seqtype, organism, strandedness, udg, file(bam), file(bai) from ch_fixedinput_for_librarymerging.dump(tag: "library_merge_input") output: - tuple samplename, val("${samplename}_libmerged"), lane, seqtype, organism, strandedness, udg, path("*_libmerged_rg_rmdup.bam"), path("*_libmerged_rg_rmdup.bam.{bai,csi}") into ch_output_from_librarymerging + tuple samplename, val("${samplename}_libmerged"), lane, seqtype, organism, strandedness, udg, path("*_libmerged_rmdup.bam"), path("*_libmerged_rmdup.bam.{bai,csi}") into ch_output_from_librarymerging script: def size = params.large_ref ? '-c' : '' @@ -2252,7 +2252,7 @@ process additional_library_merge { tuple samplename, libraryid, lane, seqtype, organism, strandedness, udg, path(bam), path(bai) from ch_trimmed_formerge.merge_me output: - tuple samplename, val("${samplename}_libmerged"), lane, seqtype, organism, strandedness, udg, path("*_libmerged_rg_add.bam"), path("*_libmerged_rg_add.bam.{bai,csi}") into ch_output_from_trimmerge + tuple samplename, val("${samplename}_libmerged"), lane, seqtype, organism, strandedness, udg, path("*_libmerged_add.bam"), path("*_libmerged_add.bam.{bai,csi}") into ch_output_from_trimmerge script: def size = params.large_ref ? '-c' : '' From 2db00fb79603beec498773e5577792aaa4c422a6 Mon Sep 17 00:00:00 2001 From: "Thiseas C. Lamnidis" Date: Fri, 19 Nov 2021 19:17:42 +0100 Subject: [PATCH 07/10] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc5f556c4..9a7b530da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### `Added` - - [#808](https://github.com/nf-core/eager/issues/808) Retain read group information across bam merges. Sample set to Sample name in bwa output RG. - - Map and base quality filters prior to genotyping with pileupcaller can now be specified. +- [#808](https://github.com/nf-core/eager/issues/808) Retain read group information across bam merges. Sample set to Sample name in bwa output RG. +- Map and base quality filters prior to genotyping with pileupcaller can now be specified. ### `Fixed` From b5802f9b01bc0f74e65e479a291996569c196fd6 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Tue, 23 Nov 2021 20:24:17 +0100 Subject: [PATCH 08/10] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a7b530da..dd3c68a3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -181,7 +181,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### `Deprecated` -## [2.3.0] - Aalen - 2021-01-11 +## [2.3.0] - Aalen - 2021-01-11 ### `Added` From fb124c27ce5e6829d56e9e86193e4d3f4ff0dcdf Mon Sep 17 00:00:00 2001 From: "Thiseas C. Lamnidis" Date: Tue, 23 Nov 2021 21:19:53 +0100 Subject: [PATCH 09/10] Update CHANGELOG.md Co-authored-by: James A. Fellows Yates --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd3c68a3d..c3e6a3000 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### `Added` -- [#808](https://github.com/nf-core/eager/issues/808) Retain read group information across bam merges. Sample set to Sample name in bwa output RG. +- [#808](https://github.com/nf-core/eager/issues/808) Retain read group information across bam merges. Sample set to sample name (rather than library name) in bwa output 'RG' readgroup tag. - Map and base quality filters prior to genotyping with pileupcaller can now be specified. ### `Fixed` From cecbf0b018e889dfa2046da0b2828455a3541cea Mon Sep 17 00:00:00 2001 From: "Thiseas C. Lamnidis" Date: Tue, 23 Nov 2021 21:22:19 +0100 Subject: [PATCH 10/10] Removed commented old code. --- main.nf | 5 ----- 1 file changed, 5 deletions(-) diff --git a/main.nf b/main.nf index e7610ef7f..5292e3a8a 100644 --- a/main.nf +++ b/main.nf @@ -1593,8 +1593,6 @@ ch_branched_for_seqtypemerge = ch_mapping_for_seqtype_merging def size = params.large_ref ? '-c' : '' """ samtools merge ${libraryid}_seqtypemerged.bam ${bam} - ## Have to set validation as lenient because of BWA issue: "I see a read stands out the end of a chromosome and is flagged as unmapped (flag 0x4). [...]" http://bio-bwa.sourceforge.net/ - # picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${libraryid}_seqtypemerged.bam O=${libraryid}_seqtypemerged_rg.bam RGID=1 RGLB="${libraryid}_seqtypemerged" RGPL=illumina RGPU=4410 RGSM="${libraryid}_seqtypemerged" VALIDATION_STRINGENCY=LENIENT samtools index ${libraryid}_seqtypemerged.bam ${size} """ @@ -1964,8 +1962,6 @@ process library_merge { def size = params.large_ref ? '-c' : '' """ samtools merge ${samplename}_libmerged_rmdup.bam ${bam} - ## Have to set validation as lenient because of BWA issue: "I see a read stands out the end of a chromosome and is flagged as unmapped (flag 0x4). [...]" http://bio-bwa.sourceforge.net/ - # picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${samplename}_libmerged_rmdup.bam O=${samplename}_libmerged_rg_rmdup.bam RGID=1 RGLB="${samplename}_merged" RGPL=illumina RGPU=4410 RGSM="${samplename}_merged" VALIDATION_STRINGENCY=LENIENT samtools index ${samplename}_libmerged_rmdup.bam ${size} """ } @@ -2258,7 +2254,6 @@ process additional_library_merge { def size = params.large_ref ? '-c' : '' """ samtools merge ${samplename}_libmerged_add.bam ${bam} - # picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${samplename}_libmerged_add.bam O=${samplename}_libmerged_rg_add.bam RGID=1 RGLB="${samplename}_additionalmerged" RGPL=illumina RGPU=4410 RGSM="${samplename}_additionalmerged" VALIDATION_STRINGENCY=LENIENT samtools index ${samplename}_libmerged_add.bam ${size} """ }