Skip to content

Commit 3b94a84

Browse files
authored
Merge pull request #339 from JoseEspinosa/fixes
Some fixes
2 parents 8f4d262 + aece0fb commit 3b94a84

40 files changed

Lines changed: 1304 additions & 460 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- Updated pipeline template to [nf-core/tools 2.7.2](https://github.com/nf-core/tools/releases/tag/2.7.2)
1111
- [[#317](https://github.com/nf-core/chipseq/issues/317)] Added metro map
1212
- [[#288](https://github.com/nf-core/chipseq/issues/291)] Bump `chromap` version 2 and enable all the steps below chromap again when paired-end data is processed.
13+
- [[#311](https://github.com/nf-core/chipseq/issues/311)] Add back `--skip_spp` parameter which was unintentionally removed from the code.
14+
- Install available nf-core subworkflows and refactor code accordingly
15+
- [[#318](https://github.com/nf-core/chipseq/issues/318)] Update `bowtie2/align` module to fix issue when downloading its singularity image.
1316

1417
## [[2.0.0](https://github.com/nf-core/chipseq/releases/tag/2.0.0)] - 2022-10-03
1518

conf/modules.config

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ process {
122122

123123
if (!(params.skip_fastqc || params.skip_qc)) {
124124
process {
125-
withName: '.*:FASTQC_TRIMGALORE:FASTQC' {
125+
withName: 'FASTQC' {
126126
ext.args = '--quiet'
127127
publishDir = [
128128
[
@@ -142,11 +142,17 @@ if (!(params.skip_fastqc || params.skip_qc)) {
142142

143143
if (!params.skip_trimming) {
144144
process {
145-
withName: '.*:FASTQC_TRIMGALORE:TRIMGALORE' {
146-
ext.args = [
147-
'--fastqc',
148-
params.trim_nextseq > 0 ? "--nextseq ${params.trim_nextseq}" : ''
149-
].join(' ').trim()
145+
withName: 'TRIMGALORE' {
146+
ext.args = {
147+
[
148+
'--fastqc',
149+
params.trim_nextseq > 0 ? "--nextseq ${params.trim_nextseq}" : '',
150+
params.clip_r1 > 0 ? "--clip_r1 ${params.clip_r1}" : '',
151+
params.clip_r2 > 0 ? "--clip_r2 ${params.clip_r2}" : '',
152+
params.three_prime_clip_r1 > 0 ? "--three_prime_clip_r1 ${params.three_prime_clip_r1}" : '',
153+
params.three_prime_clip_r2 > 0 ? "--three_prime_clip_r2 ${params.three_prime_clip_r2}" : ''
154+
].join(' ').trim()
155+
}
150156
publishDir = [
151157
[
152158
path: { "${params.outdir}/trimgalore/fastqc" },
@@ -175,7 +181,7 @@ if (!params.skip_trimming) {
175181
}
176182

177183
process {
178-
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:ALIGN_.*:BAM_SORT_SAMTOOLS:SAMTOOLS_SORT' {
184+
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:.*:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT' {
179185
ext.prefix = { "${meta.id}.Lb.sorted" }
180186
publishDir = [
181187
path: { "${params.outdir}/${params.aligner}/library" },
@@ -185,7 +191,7 @@ process {
185191
]
186192
}
187193

188-
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:ALIGN_.*:BAM_SORT_SAMTOOLS:SAMTOOLS_INDEX' {
194+
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:.*:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_INDEX' {
189195
publishDir = [
190196
path: { "${params.outdir}/${params.aligner}/library" },
191197
mode: params.publish_dir_mode,
@@ -194,7 +200,7 @@ process {
194200
]
195201
}
196202

197-
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:ALIGN_.*:BAM_SORT_SAMTOOLS:BAM_STATS_SAMTOOLS:SAMTOOLS_.*' {
203+
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:.*:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:SAMTOOLS_.*' {
198204
ext.prefix = { "${meta.id}.Lb.sorted.bam" }
199205
publishDir = [
200206
path: { "${params.outdir}/${params.aligner}/library/samtools_stats/" },
@@ -208,11 +214,13 @@ process {
208214
if (params.aligner == 'bwa') {
209215
process {
210216
withName: 'BWA_MEM' {
211-
ext.args = { [
212-
'-M',
213-
params.bwa_min_score ? " -T ${params.bwa_min_score}" : '',
214-
meta.read_group ? "-R ${meta.read_group}": ''
215-
].join(' ').trim() }
217+
ext.args = {
218+
[
219+
'-M',
220+
params.bwa_min_score ? " -T ${params.bwa_min_score}" : '',
221+
meta.read_group ? "-R ${meta.read_group}": ''
222+
].join(' ').trim()
223+
}
216224
ext.args2 = '-bhS -F 0x0100 -O BAM'
217225
ext.prefix = { "${meta.id}.Lb" }
218226
publishDir = [
@@ -351,8 +359,15 @@ process {
351359
}
352360

353361
// Should only be published when paired end data is used and save_align_intermeds is true
354-
withName: 'BAM_FILTER' {
355-
ext.prefix = { meta.single_end ? "${meta.id}.mLb.noPublish" : "${meta.id}.mLb.flT.sorted" }
362+
withName: 'BAMTOOLS_FILTER' {
363+
ext.args = {
364+
[
365+
meta.single_end ? '-F 0x004' : '-F 0x004 -F 0x0008 -f 0x001',
366+
params.keep_dups ? '' : '-F 0x0400',
367+
params.keep_multi_map ? '' : '-q 1'
368+
].join(' ').trim()
369+
}
370+
ext.prefix = { meta.single_end ? "${meta.id}.mLb.noPublish" : "${meta.id}.mLb.flT.sorted" } //TODO check with atacseq
356371
publishDir = [
357372
path: { "${params.outdir}/${params.aligner}/mergedLibrary" },
358373
mode: params.publish_dir_mode,
@@ -367,7 +382,7 @@ process {
367382
publishDir = [ enabled: false ]
368383
}
369384

370-
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:FILTER_BAM_BAMTOOLS:BAM_SORT_SAMTOOLS:SAMTOOLS_SORT' {
385+
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:BAM_FILTER_BAMTOOLS:SAMTOOLS_SORT' {
371386
ext.prefix = { "${meta.id}.mLb.clN.sorted" }
372387
publishDir = [
373388
path: { "${params.outdir}/${params.aligner}/mergedLibrary" },
@@ -376,7 +391,7 @@ process {
376391
]
377392
}
378393

379-
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:FILTER_BAM_BAMTOOLS:BAM_SORT_SAMTOOLS:SAMTOOLS_INDEX' {
394+
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:BAM_FILTER_BAMTOOLS:SAMTOOLS_INDEX' {
380395
ext.prefix = { "${meta.id}.mLb.clN.sorted" }
381396
publishDir = [
382397
path: { "${params.outdir}/${params.aligner}/mergedLibrary" },
@@ -385,7 +400,7 @@ process {
385400
]
386401
}
387402

388-
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:FILTER_BAM_BAMTOOLS:BAM_SORT_SAMTOOLS:BAM_STATS_SAMTOOLS:.*' {
403+
withName: 'NFCORE_CHIPSEQ:CHIPSEQ:BAM_FILTER_BAMTOOLS:BAM_STATS_SAMTOOLS:.*' {
389404
ext.prefix = { "${meta.id}.mLb.clN.sorted.bam" }
390405
publishDir = [
391406
path: { "${params.outdir}/${params.aligner}/mergedLibrary/samtools_stats" },

modules.json

Lines changed: 55 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
"nf-core": {
88
"bowtie2/align": {
99
"branch": "master",
10-
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
11-
"installed_by": ["modules"]
10+
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
11+
"installed_by": ["fastq_align_bowtie2", "modules"]
1212
},
1313
"bowtie2/build": {
1414
"branch": "master",
15-
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
15+
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
1616
"installed_by": ["modules"]
1717
},
1818
"bwa/index": {
@@ -23,12 +23,12 @@
2323
"bwa/mem": {
2424
"branch": "master",
2525
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
26-
"installed_by": ["modules"]
26+
"installed_by": ["fastq_align_bwa", "modules"]
2727
},
2828
"chromap/chromap": {
2929
"branch": "master",
30-
"git_sha": "d6b7b1f108dab88b0269a4331767c36a1a8da960",
31-
"installed_by": ["modules"]
30+
"git_sha": "b7f0dbc07af00c0ccdc7c2df06efee8786e976ac",
31+
"installed_by": ["fastq_align_chromap", "modules"]
3232
},
3333
"chromap/index": {
3434
"branch": "master",
@@ -42,9 +42,8 @@
4242
},
4343
"custom/getchromsizes": {
4444
"branch": "master",
45-
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
46-
"installed_by": ["modules"],
47-
"patch": "modules/nf-core/custom/getchromsizes/custom-getchromsizes.diff"
45+
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
46+
"installed_by": ["modules"]
4847
},
4948
"deeptools/computematrix": {
5049
"branch": "master",
@@ -69,7 +68,7 @@
6968
"fastqc": {
7069
"branch": "master",
7170
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
72-
"installed_by": ["modules"]
71+
"installed_by": ["modules", "fastq_fastqc_umitools_trimgalore"]
7372
},
7473
"gffread": {
7574
"branch": "master",
@@ -108,7 +107,7 @@
108107
},
109108
"picard/collectmultiplemetrics": {
110109
"branch": "master",
111-
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
110+
"git_sha": "75027bf77472b1f4fd2cdd7e46f83119dfb0f2c6",
112111
"installed_by": ["modules"]
113112
},
114113
"picard/markduplicates": {
@@ -129,27 +128,27 @@
129128
"samtools/flagstat": {
130129
"branch": "master",
131130
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
132-
"installed_by": ["modules"]
131+
"installed_by": ["bam_stats_samtools", "modules"]
133132
},
134133
"samtools/idxstats": {
135134
"branch": "master",
136135
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
137-
"installed_by": ["modules"]
136+
"installed_by": ["bam_stats_samtools", "modules"]
138137
},
139138
"samtools/index": {
140139
"branch": "master",
141140
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
142-
"installed_by": ["modules"]
141+
"installed_by": ["bam_sort_stats_samtools", "modules"]
143142
},
144143
"samtools/sort": {
145144
"branch": "master",
146145
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
147-
"installed_by": ["modules"]
146+
"installed_by": ["bam_sort_stats_samtools", "modules"]
148147
},
149148
"samtools/stats": {
150149
"branch": "master",
151150
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
152-
"installed_by": ["modules"]
151+
"installed_by": ["bam_stats_samtools", "modules"]
153152
},
154153
"subread/featurecounts": {
155154
"branch": "master",
@@ -159,19 +158,58 @@
159158
"trimgalore": {
160159
"branch": "master",
161160
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
162-
"installed_by": ["modules"]
161+
"installed_by": ["modules", "fastq_fastqc_umitools_trimgalore"]
163162
},
164163
"ucsc/bedgraphtobigwig": {
165164
"branch": "master",
166165
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
167166
"installed_by": ["modules"]
168167
},
168+
"umitools/extract": {
169+
"branch": "master",
170+
"git_sha": "ffe2f5865f608848e440a52b73c304ea79aaf818",
171+
"installed_by": ["fastq_fastqc_umitools_trimgalore"]
172+
},
169173
"untar": {
170174
"branch": "master",
171175
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
172176
"installed_by": ["modules"]
173177
}
174178
}
179+
},
180+
"subworkflows": {
181+
"nf-core": {
182+
"bam_sort_stats_samtools": {
183+
"branch": "master",
184+
"git_sha": "3911652a6b24249358f79e8b8466338d63efb2a2",
185+
"installed_by": ["fastq_align_bowtie2", "fastq_align_chromap", "fastq_align_bwa"]
186+
},
187+
"bam_stats_samtools": {
188+
"branch": "master",
189+
"git_sha": "b4b7f89e7fd6d2293f0c176213f710e0bcdaf19e",
190+
"installed_by": ["bam_sort_stats_samtools"]
191+
},
192+
"fastq_align_bowtie2": {
193+
"branch": "master",
194+
"git_sha": "ac75f79157ecc64283a2b3a559f1ba90bc0f2259",
195+
"installed_by": ["subworkflows"]
196+
},
197+
"fastq_align_bwa": {
198+
"branch": "master",
199+
"git_sha": "901fab507683647b43e7032f3ae9e4c234eb68eb",
200+
"installed_by": ["subworkflows"]
201+
},
202+
"fastq_align_chromap": {
203+
"branch": "master",
204+
"git_sha": "ac75f79157ecc64283a2b3a559f1ba90bc0f2259",
205+
"installed_by": ["subworkflows"]
206+
},
207+
"fastq_fastqc_umitools_trimgalore": {
208+
"branch": "master",
209+
"git_sha": "100caf3506850ffcc04953f724a97f422940c377",
210+
"installed_by": ["subworkflows"]
211+
}
212+
}
175213
}
176214
}
177215
}
Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
/*
2-
* Filter BAM file
3-
*/
4-
process BAM_FILTER {
1+
process BAMTOOLS_FILTER {
52
tag "$meta.id"
63
label 'process_medium'
74

@@ -20,19 +17,18 @@ process BAM_FILTER {
2017
tuple val(meta), path("*.bam"), emit: bam
2118
path "versions.yml" , emit: versions
2219

20+
when:
21+
task.ext.when == null || task.ext.when
22+
2323
script:
24-
def prefix = task.ext.prefix ?: "${meta.id}"
25-
def filter_params = meta.single_end ? '-F 0x004' : '-F 0x004 -F 0x0008 -f 0x001'
26-
def dup_params = params.keep_dups ? '' : '-F 0x0400'
27-
def multimap_params = params.keep_multi_map ? '' : '-q 1'
28-
def blacklist_params = params.blacklist ? "-L $bed" : ''
29-
def config = meta.single_end ? bamtools_filter_se_config : bamtools_filter_pe_config
24+
def args = task.ext.args ?: ''
25+
def prefix = task.ext.prefix ?: "${meta.id}"
26+
def blacklist = bed ? "-L $bed" : ''
27+
def config = meta.single_end ? bamtools_filter_se_config : bamtools_filter_pe_config
3028
"""
3129
samtools view \\
32-
$filter_params \\
33-
$dup_params \\
34-
$multimap_params \\
35-
$blacklist_params \\
30+
$args \\
31+
$blacklist \\
3632
-b $bam \\
3733
| bamtools filter \\
3834
-out ${prefix}.bam \\

modules/local/star_align.nf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ process STAR_ALIGN {
1111
input:
1212
tuple val(meta), path(reads)
1313
path index
14+
val seq_center
1415

1516
output:
1617
tuple val(meta), path('*d.out.bam') , emit: bam
@@ -25,10 +26,13 @@ process STAR_ALIGN {
2526
tuple val(meta), path('*fastq.gz') , optional:true, emit: fastq
2627
tuple val(meta), path('*.tab') , optional:true, emit: tab
2728

29+
when:
30+
task.ext.when == null || task.ext.when
31+
2832
script:
2933
def args = task.ext.args ?: ''
3034
def prefix = task.ext.prefix ?: "${meta.id}"
31-
def seq_center = params.seq_center ? "--outSAMattrRGline ID:$prefix 'CN:$params.seq_center' 'SM:$prefix'" : "--outSAMattrRGline ID:$prefix 'SM:$prefix'"
35+
def seq_center_tag = seq_center ? "--outSAMattrRGline ID:$prefix 'CN:$seq_center' 'SM:$prefix'" : "--outSAMattrRGline ID:$prefix 'SM:$prefix'"
3236
def out_sam_type = (args.contains('--outSAMtype')) ? '' : '--outSAMtype BAM Unsorted'
3337
def mv_unsorted_bam = (args.contains('--outSAMtype BAM Unsorted SortedByCoordinate')) ? "mv ${prefix}.Aligned.out.bam ${prefix}.Aligned.unsort.out.bam" : ''
3438
"""
@@ -38,7 +42,7 @@ process STAR_ALIGN {
3842
--runThreadN $task.cpus \\
3943
--outFileNamePrefix $prefix. \\
4044
$out_sam_type \\
41-
$seq_center \\
45+
$seq_center_tag \\
4246
$args
4347
$mv_unsorted_bam
4448
if [ -f ${prefix}.Unmapped.out.mate1 ]; then

modules/nf-core/bowtie2/align/main.nf

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

0 commit comments

Comments
 (0)