Skip to content

Commit d51ec4b

Browse files
fix: Move bg to args
#470 (comment) Co-authored-by: pinin4fjords <[email protected]>
1 parent 5bc2b9e commit d51ec4b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

conf/modules.config

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,17 @@ process {
453453
}
454454

455455
withName: '.*:BAM_BEDGRAPH_BIGWIG_BEDTOOLS_UCSC:BEDTOOLS_GENOMECOV' {
456-
ext.args = { (meta.single_end && params.fragment_size > 0) ? "-fs ${params.fragment_size}" : '' }
456+
ext.args = {
457+
def args = []
458+
// Include fragment size only for single-end data
459+
if (meta.single_end && params.fragment_size > 0) {
460+
args << "-fs ${params.fragment_size}"
461+
}
462+
// Use -bga instead of -bg to include zero-coverage bins
463+
// This results in lower background levels and better IGV visualization
464+
args << "-bga"
465+
return args.join(' ')
466+
}
457467
ext.prefix = { "${meta.id}.mLB.clN" }
458468
publishDir = [
459469
[

modules/local/bedtools_genomecov.nf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,9 @@ process BEDTOOLS_GENOMECOV {
2626
SCALE_FACTOR=\$(grep '[0-9] mapped (' $flagstat | awk '{print 1000000/\$1}')
2727
echo \$SCALE_FACTOR > ${prefix}.scale_factor.txt
2828
29-
# Use --bga instead of -bg to include zero-coverage bins in output
30-
# This results in lower background levels and better visualization in IGV
31-
# Users can override this by specifying -bg in ext.args if needed
3229
bedtools \\
3330
genomecov \\
3431
-ibam $bam \\
35-
--bga \\
3632
-scale \$SCALE_FACTOR \\
3733
$pe \\
3834
$args \\

0 commit comments

Comments
 (0)