chipseq icon indicating copy to clipboard operation
chipseq copied to clipboard

Change bigWig creating to use `--bga` option

Open FelixKrueger opened this issue 6 months ago • 1 comments

Description of the bug

We have observed an interesting behaviour when it comes to the bigWig file generation in both the ChIP-seq as well as CUT&RUN workflow, and I wanted to open this up to your collective input.

The ChIP-seq pipeline runs the following code to generate bigWig files:

bedtools genomecov \
    -ibam H3K27me3.mLb.clN.sorted.bam \
    -bg \
    -scale $SCALE_FACTOR \
    -pc \
    | sort -T '.' -k1,1 -k2,2n > H3K27me3.bedGraph

This default behaviour creates bigWig files that appear to have a relatively high level of background. When using the option --bga (instead of --bg), uncovered bins get assigned values of 0 and are not skipped. This appears to result to lower levels of background, which is more pleasing to the eye in IGV:

Image

I have just discussed this with @FloWuenne and @edmundmiller during the weekly helpdesk, and they agreed that this behaviour should be changed (@JoseEspinosa for visibility).

Very detailed additional findings, inclduing IGV screenshots etc, are availalbe on the nf-core Slack: https://nfcore.slack.com/archives/CFP55NZ5G/p1747062371347069

The current ChIP-seq workflow seems to use this local code: https://github.com/nf-core/chipseq/blob/51eba00b32885c4d0bec60db3cb0a45eb61e34c5/modules/local/bedtools_genomecov.nf#L30

But ideally BEDTOOLS_GENOMECOV should be changed over to using the nf-core module, together with changing the -bg to --bga. Users still wishing to specify--bg could do so via the ext.args parameter.

Command used and terminal output


Relevant files

No response

System information

No response

FelixKrueger avatar Jun 24 '25 18:06 FelixKrueger

An alternative solution to simply changing the parameter hardcoded in the module could be to replace the local module with the nf-core module, provide these additional flags via ext.args and thereby allowing end-users to chose which parameter they want. This would maintain functionality across new releases but provide the option to modify behaviour for users going forward: https://github.com/nf-core/chipseq/issues/469

FloWuenne avatar Jun 24 '25 19:06 FloWuenne