From 2c25a7312044d637f71f9b6be00eea7ec54da359 Mon Sep 17 00:00:00 2001 From: MartinPippel Date: Thu, 21 Nov 2024 12:36:50 +0100 Subject: [PATCH] cleanup, remove -5 bwa default argument, remove samtools fixmate step, add ugly grep hack to avoid samtools header issue --- configs/modules.config | 9 ++++----- .../local/hic_curation/tworeadcombiner_fixmate_sort.nf | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/configs/modules.config b/configs/modules.config index a224035..c63b04a 100644 --- a/configs/modules.config +++ b/configs/modules.config @@ -319,9 +319,9 @@ process { } // scaffolding - withName: 'BWAMEM2_MEM' { + withName: 'BWAMEM2_MEM_SCAFFOLD' { ext.prefix = { "${meta.id}_${meta.assembly.build}_${reads.head().getBaseName(reads.head().name.endsWith(".gz") ? 2 : 1)}" } - ext.args = '-5SP -T0' + ext.args = '-SP -T0' ext.args2 = { sort_bam ? "--write-index" : "" } } @@ -371,7 +371,7 @@ process { // scaffolding curation withName: 'BWAMEM2_MEM_CURATION' { ext.prefix = { "${meta.id}_${meta.assembly.build}_${reads.head().getBaseName(reads.head().name.endsWith(".gz") ? 2 : 1)}" } - ext.args = '-5SP -T0' + ext.args = '-SP -T0' ext.args2 = { sort_bam ? "--write-index" : "" } } @@ -382,8 +382,7 @@ process { withName: 'TWOREADCOMBINER_FIXMATE_SORT' { ext.prefix = { "${bam.head().getBaseName(1)}" } ext.args = { "${params.hic_map_qv}" } // min hic map quality - ext.args2 = { "-mpu" } - ext.args3 = '--write-index -l1' + ext.args2 = '--write-index -l1' } withName: 'SCAFFOLD_CURATION:SAMTOOLS_MERGE_(HIFI|HIC)' { diff --git a/modules/local/hic_curation/tworeadcombiner_fixmate_sort.nf b/modules/local/hic_curation/tworeadcombiner_fixmate_sort.nf index 199099d..1b34dbe 100644 --- a/modules/local/hic_curation/tworeadcombiner_fixmate_sort.nf +++ b/modules/local/hic_curation/tworeadcombiner_fixmate_sort.nf @@ -22,7 +22,7 @@ process TWOREADCOMBINER_FIXMATE_SORT { """ perl ${projectDir}/bin/two_read_bam_combiner_sanger.pl ${bam} samtools ${args} | \\ - samtools fixmate -@${task.cpus} ${args2} - - | \\ + grep -v -e "^@HD" | \\ samtools sort ${args3} -@${task.cpus} -T sort_tmp -o ${prefix}_comb.bam - cat <<-END_VERSIONS > versions.yml