Skip to content

Commit

Permalink
cleanup, remove -5 bwa default argument, remove samtools fixmate step…
Browse files Browse the repository at this point in the history
…, add ugly grep hack to avoid samtools header issue
  • Loading branch information
MartinPippel committed Nov 21, 2024
1 parent 2fca1ac commit eab8bde
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
9 changes: 4 additions & 5 deletions configs/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -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" : "" }
}

Expand Down Expand Up @@ -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" : "" }
}

Expand All @@ -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)' {
Expand Down
5 changes: 2 additions & 3 deletions modules/local/hic_curation/tworeadcombiner_fixmate_sort.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ process TWOREADCOMBINER_FIXMATE_SORT {

script:
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def args3 = task.ext.args3 ?: ''
def args2 = task.ext.args3 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
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
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ params {
// define how to sort the HiC-maps: [ length, name, nosort ]
hic_map_sort_by = 'length'
// define minimum map quality for HiC alignments
hic_map_qv = 1
hic_map_qv = 0
// pacbio hifi coverage cap for pretext and higlass coverage track, e.g. cap repeats at <hifi_coverage_cap>
hifi_coverage_cap = 100
// telomer motif
Expand Down
26 changes: 13 additions & 13 deletions subworkflows/local/scaffold/main.nf
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
include { constructAssemblyRecord } from "$projectDir/modules/local/functions"
include { getPrimaryAssembly } from "$projectDir/modules/local/functions"
include { joinByMetaKeys } from "$projectDir/modules/local/functions"
include { combineByMetaKeys } from "$projectDir/modules/local/functions"
include { BWAMEM2_INDEX } from "$projectDir/modules/nf-core/bwamem2/index/main"
include { BWAMEM2_MEM } from "$projectDir/modules/nf-core/bwamem2/mem/main"
include { SAMTOOLS_FAIDX } from "$projectDir/modules/nf-core/samtools/faidx/main"
include { PAIRTOOLS_PARSE } from "$projectDir/modules/nf-core/pairtools/parse/main"
include { PAIRTOOLS_SORT } from "$projectDir/modules/nf-core/pairtools/sort/main"
include { PAIRTOOLS_MERGE } from "$projectDir/modules/nf-core/pairtools/merge/main"
include { PAIRTOOLS_DEDUP } from "$projectDir/modules/nf-core/pairtools/dedup/main"
include { PAIRTOOLS_SPLIT } from "$projectDir/modules/nf-core/pairtools/split/main"
include { YAHS } from "$projectDir/modules/nf-core/yahs/main.nf"
include { constructAssemblyRecord } from "$projectDir/modules/local/functions"
include { getPrimaryAssembly } from "$projectDir/modules/local/functions"
include { joinByMetaKeys } from "$projectDir/modules/local/functions"
include { combineByMetaKeys } from "$projectDir/modules/local/functions"
include { BWAMEM2_INDEX as BWAMEM2_INDEX_SCAFFOLD } from "$projectDir/modules/nf-core/bwamem2/index/main"
include { BWAMEM2_MEM as BWAMEM2_MEM_SCAFFOLD } from "$projectDir/modules/nf-core/bwamem2/mem/main"
include { SAMTOOLS_FAIDX } from "$projectDir/modules/nf-core/samtools/faidx/main"
include { PAIRTOOLS_PARSE } from "$projectDir/modules/nf-core/pairtools/parse/main"
include { PAIRTOOLS_SORT } from "$projectDir/modules/nf-core/pairtools/sort/main"
include { PAIRTOOLS_MERGE } from "$projectDir/modules/nf-core/pairtools/merge/main"
include { PAIRTOOLS_DEDUP } from "$projectDir/modules/nf-core/pairtools/dedup/main"
include { PAIRTOOLS_SPLIT } from "$projectDir/modules/nf-core/pairtools/split/main"
include { YAHS } from "$projectDir/modules/nf-core/yahs/main.nf"


workflow SCAFFOLD {
Expand Down

0 comments on commit eab8bde

Please sign in to comment.