Skip to content

Commit e92fa1c

Browse files
authored
Merge pull request #470 from nf-core/cursor/fix-issue-in-nf-core-chipseq-4f44
Use --bga when creating bigWigs
2 parents cd1f242 + 81a2a58 commit e92fa1c

24 files changed

+786
-247
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- [[PR #444](https://github.com/nf-core/chipseq/pull/444)] - Add empty map to ch_gff so that when provided by the user `GFFREAD` works.
1414
- [[#451](https://github.com/nf-core/chipseq/issues/451)] - Pass `map.single_read` to `SUBREAD_FEATURECOUNTS` as to correctly set parameter `-p`.
1515
- [[PR #462](https://github.com/nf-core/chipseq/pull/462)] - Updated pipeline template to [nf-core/tools 3.2.1](https://github.com/nf-core/tools/releases/tag/3.2.1)
16+
- [[#468](https://github.com/nf-core/chipseq/issues/468)] - Changed bigWig generation to use `-bga` option instead of `-bg` in `bedtools genomecov` for lower background levels and better IGV visualization. Users can revert to previous behavior using configuration. See [documentation](https://nf-co.re/chipseq/dev/docs/output/#normalised-bigwig-files) for details.
1617

1718
### Parameters
1819

conf/modules.config

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -453,19 +453,28 @@ 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+
// Add paired-end correction for paired-end data
463+
if (!meta.single_end) {
464+
args << "-pc"
465+
}
466+
// Use -bga instead of -bg to include zero-coverage bins
467+
// This results in lower background levels and better IGV visualization
468+
args << "-bga"
469+
return args.join(' ')
470+
}
457471
ext.prefix = { "${meta.id}.mLB.clN" }
458472
publishDir = [
459473
[
460474
path: { "${params.outdir}/${params.aligner}/merged_library/bigwig" },
461475
mode: params.publish_dir_mode,
462-
pattern: "*.bigWig"
476+
pattern: "*.bedGraph"
463477
],
464-
[
465-
path: { "${params.outdir}/${params.aligner}/merged_library/bigwig/scale" },
466-
mode: params.publish_dir_mode,
467-
pattern: "*.txt"
468-
]
469478
]
470479
}
471480

docs/output.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,17 @@ The [Preseq](http://smithlabresearch.org/software/preseq/) package is aimed at p
147147

148148
The [bigWig](https://genome.ucsc.edu/goldenpath/help/bigWig.html) format is in an indexed binary format useful for displaying dense, continuous data in Genome Browsers such as the [UCSC](https://genome.ucsc.edu/cgi-bin/hgTracks) and [IGV](http://software.broadinstitute.org/software/igv/). This mitigates the need to load the much larger BAM files for data visualisation purposes which will be slower and result in memory issues. The coverage values represented in the bigWig file can also be normalised in order to be able to compare the coverage across multiple samples - this is not possible with BAM files. The bigWig format is also supported by various bioinformatics software for downstream processing such as meta-profile plotting.
149149

150+
> [!IMPORTANT]
151+
> As of v2.2.0, the pipeline uses the `-bga` option in `bedtools genomecov` instead of `-bg`. This includes zero-coverage bins in the output, resulting in lower background levels and better visualization in IGV. Users who prefer the previous behavior can override this by adding `-bg` to the `ext.args` parameter in their configuration:
152+
>
153+
> ```groovy
154+
> process {
155+
> withName: '.*:BAM_BEDGRAPH_BIGWIG_BEDTOOLS_UCSC:BEDTOOLS_GENOMECOV' {
156+
> ext.args = '-bg'
157+
> }
158+
> }
159+
> ```
160+
150161
### ChIP-seq QC metrics
151162
152163
<details markdown="1">

modules.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
"https://github.com/nf-core/modules.git": {
66
"modules": {
77
"nf-core": {
8+
"bedtools/genomecov": {
9+
"branch": "master",
10+
"git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46",
11+
"installed_by": ["modules"]
12+
},
813
"bowtie2/align": {
914
"branch": "master",
1015
"git_sha": "9bfc81874554e87740bcb3e5e07acf0a153c9ecb",
@@ -123,8 +128,9 @@
123128
},
124129
"samtools/flagstat": {
125130
"branch": "master",
126-
"git_sha": "46eca555142d6e597729fcb682adcc791796f514",
127-
"installed_by": ["bam_stats_samtools", "modules"]
131+
"git_sha": "e334e12a1e985adc5ffc3fc78a68be1de711de45",
132+
"installed_by": ["bam_stats_samtools", "modules"],
133+
"patch": "modules/nf-core/samtools/flagstat/samtools-flagstat.diff"
128134
},
129135
"samtools/idxstats": {
130136
"branch": "master",

modules/local/bedtools_genomecov.nf

Lines changed: 0 additions & 55 deletions
This file was deleted.

modules/nf-core/bedtools/genomecov/environment.yml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/bedtools/genomecov/main.nf

Lines changed: 77 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/bedtools/genomecov/meta.yml

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)