Skip to content

Commit 9e39ea2

Browse files
authored
Merge pull request #290 from JoseEspinosa/morefixes
Change chromap arguments and more fixes
2 parents 9582d07 + b87af07 commit 9e39ea2

File tree

9 files changed

+174
-72
lines changed

9 files changed

+174
-72
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
matrix:
7777
aligner:
7878
- "bowtie2"
79-
# - "chromap"
79+
- "chromap"
8080
- "star"
8181
steps:
8282
- name: Check out pipeline code

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6-
## [Unpublished Version / DEV]
6+
## [1.2.2] - 2022-08-22
77

88
### Enhancements & fixes
99

10+
- Pipeline has been re-implemented in [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html)
11+
- All software containers are now exclusively obtained from [Biocontainers](https://biocontainers.pro/#/registry)
1012
- Updated pipeline template to [nf-core/tools 2.4.1](https://github.com/nf-core/tools/releases/tag/2.4.1)
1113
- [[#128](https://github.com/nf-core/chipseq/issues/128)] - Filter files with no peaks to avoid errors in downstream processes
1214
- [[#220](https://github.com/nf-core/chipseq/issues/220)] - Fix `phantompeakqualtools` protection stack overflow error
@@ -20,9 +22,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2022
- [[228](https://github.com/nf-core/chipseq/issues/228)] - Update blacklist bed files.
2123
- [nf-core/tools#1415](https://github.com/nf-core/tools/issues/1415) - Make `--outdir` a mandatory parameter
2224
- [[282](https://github.com/nf-core/chipseq/issues/282)] - Fix `genome.fa` publication for IGV.
23-
- [[280](https://github.com/nf-core/chipseq/issues/280)] - Update `macs_gsize` in `igenomes.config`, create a new `--read_length` parameter and implement the logic to calculate `--macs_gsize` when the parameter is missing.
24-
- Eliminate `if`s conditions from `deseq2_qc` and `macs2_consensus` {local module and use `ext.when` instead.
25+
- [[280](https://github.com/nf-core/chipseq/issues/280)] - Update `macs_gsize` in `igenomes.config`, create a new `--read_length` parameter and implement the logic to calculate `--macs_gsize` when the parameter is missing
26+
- Eliminate `if`s conditions from `deseq2_qc` and `macs2_consensus` (local module and use `ext.when` instead)
2527
- Remove `deseq2` differential binding analysis of consensus peaks.
28+
- Filter paired-end files produced by `chromap` due to [this](https://github.com/nf-core/chipseq/issues/291) issue
29+
- Remove <ANTIBODY> from the macs2 consensus publish directory since it can not be referred as input from the IGV process (meta.id not resolved at execution time)
30+
- Add bytesize link to readme.
2631

2732
### Parameters
2833

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,28 @@ On release, automated continuous integration tests run the pipeline on a [full-s
2323

2424
The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. The [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies. Where possible, these processes have been submitted to and installed from [nf-core/modules](https://github.com/nf-core/modules) in order to make them available to all nf-core pipelines, and to everyone within the Nextflow community!
2525

26+
## Online videos
27+
28+
A short talk about the history, current status and functionality on offer in this pipeline was given by Jose Espinosa-Carrasco ([@joseespinosa](https://github.com/joseespinosa)) on [26th July 2022](https://nf-co.re/events/2022/bytesize-chipseq) as part of the nf-core/bytesize series.
29+
30+
You can find numerous talks on the [nf-core events page](https://nf-co.re/events) from various topics including writing pipelines/modules in Nextflow DSL2, using nf-core tooling, running nf-core pipelines as well as more generic content like contributing to Github. Please check them out!
31+
2632
## Pipeline summary
2733

2834
1. Raw read QC ([`FastQC`](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/))
2935
2. Adapter trimming ([`Trim Galore!`](https://www.bioinformatics.babraham.ac.uk/projects/trim_galore/))
30-
3. Alignment ([`BWA`](https://sourceforge.net/projects/bio-bwa/files/))
36+
3. Choice of multiple aligners
37+
1.([`BWA`](https://sourceforge.net/projects/bio-bwa/files/))
38+
2.([`Chromap`](https://github.com/haowenz/chromap)). **For paired-end reads only working until mapping steps, see [here](https://github.com/nf-core/chipseq/issues/291)**
39+
3.([`Bowtie2`](http://bowtie-bio.sourceforge.net/bowtie2/index.shtml))
40+
4.([`STAR`](https://github.com/alexdobin/STAR))
3141
4. Mark duplicates ([`picard`](https://broadinstitute.github.io/picard/))
3242
5. Merge alignments from multiple libraries of the same sample ([`picard`](https://broadinstitute.github.io/picard/))
3343
1. Re-mark duplicates ([`picard`](https://broadinstitute.github.io/picard/))
3444
2. Filtering to remove:
3545
- reads mapping to blacklisted regions ([`SAMtools`](https://sourceforge.net/projects/samtools/files/samtools/), [`BEDTools`](https://github.com/arq5x/bedtools2/))
3646
- reads that are marked as duplicates ([`SAMtools`](https://sourceforge.net/projects/samtools/files/samtools/))
37-
- reads that arent marked as primary alignments ([`SAMtools`](https://sourceforge.net/projects/samtools/files/samtools/))
47+
- reads that are not marked as primary alignments ([`SAMtools`](https://sourceforge.net/projects/samtools/files/samtools/))
3848
- reads that are unmapped ([`SAMtools`](https://sourceforge.net/projects/samtools/files/samtools/))
3949
- reads that map to multiple locations ([`SAMtools`](https://sourceforge.net/projects/samtools/files/samtools/))
4050
- reads containing > 4 mismatches ([`BAMTools`](https://github.com/pezmaster31/bamtools))
@@ -47,11 +57,11 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool
4757
5. Generate gene-body meta-profile from bigWig files ([`deepTools`](https://deeptools.readthedocs.io/en/develop/content/tools/plotProfile.html))
4858
6. Calculate genome-wide IP enrichment relative to control ([`deepTools`](https://deeptools.readthedocs.io/en/develop/content/tools/plotFingerprint.html))
4959
7. Calculate strand cross-correlation peak and ChIP-seq quality measures including NSC and RSC ([`phantompeakqualtools`](https://github.com/kundajelab/phantompeakqualtools))
50-
8. Call broad/narrow peaks ([`MACS2`](https://github.com/taoliu/MACS))
60+
8. Call broad/narrow peaks ([`MACS2`](https://github.com/macs3-project/MACS))
5161
9. Annotate peaks relative to gene features ([`HOMER`](http://homer.ucsd.edu/homer/download.html))
5262
10. Create consensus peakset across all samples and create tabular file to aid in the filtering of the data ([`BEDTools`](https://github.com/arq5x/bedtools2/))
5363
11. Count reads in consensus peaks ([`featureCounts`](http://bioinf.wehi.edu.au/featureCounts/))
54-
12. Differential binding analysis, PCA and clustering ([`R`](https://www.r-project.org/), [`DESeq2`](https://bioconductor.org/packages/release/bioc/html/DESeq2.html))
64+
12. PCA and clustering ([`R`](https://www.r-project.org/), [`DESeq2`](https://bioconductor.org/packages/release/bioc/html/DESeq2.html))
5565
6. Create IGV session file containing bigWig tracks, peaks and differential sites for data visualisation ([`IGV`](https://software.broadinstitute.org/software/igv/)).
5666
7. Present QC for raw read, alignment, peak-calling and differential binding results ([`MultiQC`](http://multiqc.info/), [`R`](https://www.r-project.org/))
5767

@@ -63,7 +73,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool
6373

6474
3. Download the pipeline and test it on a minimal dataset with a single command:
6575

66-
```console
76+
```bash
6777
nextflow run nf-core/chipseq -profile test,YOURPROFILE --outdir <OUTDIR>
6878
```
6979

@@ -76,9 +86,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool
7686
7787
4. Start running your own analysis!
7888

79-
<!-- TODO nf-core: Update the example "typical command" below used to run the pipeline -->
80-
81-
```console
89+
```bash
8290
nextflow run nf-core/chipseq --input samplesheet.csv --outdir <OUTDIR> --genome GRCh37 -profile <docker/singularity/podman/shifter/charliecloud/conda/institute>
8391
```
8492

conf/modules.config

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,15 @@ process {
5454

5555
withName: 'UNTAR_.*' {
5656
ext.args2 = '--no-same-owner'
57+
publishDir = [
58+
path: { "${params.outdir}/genome/index" },
59+
mode: params.publish_dir_mode,
60+
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
61+
enabled: params.save_reference
62+
]
5763
}
5864

59-
withName: 'UNTAR_.*|BWA_INDEX|BOWTIE2_BUILD|STAR_GENOMEGENERATE' {
65+
withName: 'BWA_INDEX|BOWTIE2_BUILD|STAR_GENOMEGENERATE' {
6066
publishDir = [
6167
path: { "${params.outdir}/genome/index" },
6268
mode: params.publish_dir_mode,
@@ -253,7 +259,7 @@ if (params.aligner == 'chromap') {
253259
]
254260
}
255261
withName: CHROMAP_CHROMAP {
256-
ext.args = '--preset chip --SAM'
262+
ext.args = '-l 2000 --low-mem --SAM'
257263
ext.prefix = { "${meta.id}.Lb" }
258264
publishDir = [
259265
path: { "${params.outdir}/${params.aligner}/library" },
@@ -466,7 +472,7 @@ if (!params.skip_plot_profile) {
466472
ext.args = 'scale-regions --regionBodyLength 1000 --beforeRegionStartLength 3000 --afterRegionStartLength 3000 --skipZeros --smartLabels'
467473
ext.prefix = { "${meta.id}.mLb.clN" }
468474
publishDir = [
469-
path: { "${params.outdir}/${params.aligner}/mergedLibrary/deeptools/plotProfile" },
475+
path: { "${params.outdir}/${params.aligner}/mergedLibrary/deepTools/plotProfile" },
470476
mode: params.publish_dir_mode,
471477
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
472478
]
@@ -475,7 +481,7 @@ if (!params.skip_plot_profile) {
475481
withName: 'DEEPTOOLS_PLOTPROFILE' {
476482
ext.prefix = { "${meta.id}.mLb.clN" }
477483
publishDir = [
478-
path: { "${params.outdir}/${params.aligner}/mergedLibrary/deeptools/plotProfile" },
484+
path: { "${params.outdir}/${params.aligner}/mergedLibrary/deepTools/plotProfile" },
479485
mode: params.publish_dir_mode,
480486
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
481487
]
@@ -484,7 +490,7 @@ if (!params.skip_plot_profile) {
484490
withName: 'DEEPTOOLS_PLOTHEATMAP' {
485491
ext.prefix = { "${meta.id}.mLb.clN" }
486492
publishDir = [
487-
path: { "${params.outdir}/${params.aligner}/mergedLibrary/deeptools/plotProfile" },
493+
path: { "${params.outdir}/${params.aligner}/mergedLibrary/deepTools/plotProfile" },
488494
mode: params.publish_dir_mode,
489495
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
490496
]
@@ -508,7 +514,7 @@ if (!params.skip_plot_fingerprint) {
508514
].join(' ').trim() }
509515
ext.prefix = { "${meta.id}.mLb.clN" }
510516
publishDir = [
511-
path: { "${params.outdir}/${params.aligner}/mergedLibrary/deeptools/plotFingerprint" },
517+
path: { "${params.outdir}/${params.aligner}/mergedLibrary/deepTools/plotFingerprint" },
512518
mode: params.publish_dir_mode,
513519
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
514520
]
@@ -520,16 +526,17 @@ process {
520526
withName: 'MACS2_CALLPEAK' {
521527
ext.args = [
522528
'--keep-dup all',
523-
params.narrow_peak ? '' : "--broad --broad-cutoff ${params.broad_cutoff}",
524-
params.save_macs_pileup ? '--bdg --SPMR' : '',
525-
params.macs_fdr ? "--qvalue ${params.macs_fdr}" : '',
526-
params.macs_pvalue ? "--pvalue ${params.macs_pvalue}" : ''
529+
params.narrow_peak ? '' : "--broad --broad-cutoff ${params.broad_cutoff}",
530+
params.save_macs_pileup ? '--bdg --SPMR' : '',
531+
params.macs_fdr ? "--qvalue ${params.macs_fdr}" : '',
532+
params.macs_pvalue ? "--pvalue ${params.macs_pvalue}" : '',
533+
params.aligner == "chromap" ? "--format BAM" : ''
527534
].join(' ').trim()
528535
publishDir = [
529536
path: { [
530537
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
531538
params.narrow_peak? '/narrowPeak' : '/broadPeak'
532-
].join('') },
539+
].join('') },
533540
mode: params.publish_dir_mode,
534541
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
535542
]
@@ -542,7 +549,7 @@ process {
542549
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
543550
params.narrow_peak? '/narrowPeak' : '/broadPeak',
544551
'/qc'
545-
].join('') },
552+
].join('') },
546553
enabled: false
547554
]
548555
}
@@ -569,11 +576,25 @@ if (!params.skip_peak_annotation) {
569576
path: { [
570577
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
571578
params.narrow_peak? '/narrowPeak' : '/broadPeak'
572-
].join('') },
579+
].join('') },
573580
mode: params.publish_dir_mode,
574581
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
575582
]
576583
}
584+
585+
withName: 'ANNOTATE_BOOLEAN_PEAKS' {
586+
ext.prefix = { "${meta.id}_peaks" }
587+
publishDir = [
588+
path: { [
589+
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
590+
params.narrow_peak? '/narrowPeak' : '/broadPeak',
591+
'/consensus'
592+
].join('') },
593+
mode: params.publish_dir_mode,
594+
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
595+
]
596+
597+
}
577598
}
578599

579600
if (!params.skip_peak_qc) {
@@ -598,7 +619,7 @@ if (!params.skip_peak_annotation) {
598619
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
599620
params.narrow_peak? '/narrowPeak' : '/broadPeak',
600621
'/qc'
601-
].join('') },
622+
].join('') },
602623
mode: params.publish_dir_mode,
603624
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
604625
]
@@ -616,9 +637,8 @@ if (!params.skip_consensus_peaks) {
616637
path: { [
617638
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
618639
params.narrow_peak? '/narrowPeak' : '/broadPeak',
619-
'/consensus',
620-
"/${meta.id}"
621-
].join('') },
640+
'/consensus'
641+
].join('') },
622642
mode: params.publish_dir_mode,
623643
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
624644
]
@@ -630,9 +650,8 @@ if (!params.skip_consensus_peaks) {
630650
path: { [
631651
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
632652
params.narrow_peak? '/narrowPeak' : '/broadPeak',
633-
'/consensus',
634-
"/${meta.id}"
635-
].join('') },
653+
'/consensus'
654+
].join('') },
636655
mode: params.publish_dir_mode,
637656
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
638657
]
@@ -648,9 +667,8 @@ if (!params.skip_consensus_peaks) {
648667
path: { [
649668
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
650669
params.narrow_peak? '/narrowPeak' : '/broadPeak',
651-
'/consensus',
652-
"/${meta.id}"
653-
].join('') },
670+
'/consensus'
671+
].join('') },
654672
mode: params.publish_dir_mode,
655673
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
656674
]
@@ -673,9 +691,8 @@ if (!params.skip_consensus_peaks) {
673691
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
674692
params.narrow_peak? '/narrowPeak' : '/broadPeak',
675693
'/consensus',
676-
"/${meta.id}",
677694
'/deseq2'
678-
].join('') },
695+
].join('') },
679696
mode: params.publish_dir_mode,
680697
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
681698
]
@@ -691,7 +708,7 @@ if (!params.skip_igv) {
691708
path: { [
692709
"${params.outdir}/igv",
693710
params.narrow_peak? '/narrowPeak' : '/broadPeak'
694-
].join('') },
711+
].join('') },
695712
mode: params.publish_dir_mode,
696713
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
697714
]
@@ -705,9 +722,9 @@ if (!params.skip_multiqc) {
705722
ext.args = params.multiqc_title ? "--title \"$params.multiqc_title\"" : ''
706723
publishDir = [
707724
path: { [
708-
"${params.outdir}/multiqc",
709-
params.narrow_peak? '/narrowPeak' : '/broadPeak'
710-
].join('') },
725+
"${params.outdir}/multiqc",
726+
params.narrow_peak? '/narrowPeak' : '/broadPeak'
727+
].join('') },
711728
mode: params.publish_dir_mode,
712729
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
713730
]

0 commit comments

Comments
 (0)