Skip to content

Commit 84c2299

Browse files
authored
Merge pull request #304 from drpatelh/updates
Fix missing reports in MultiQC and other publishing discrepancies with DSL1 version
2 parents 1683f39 + e7c5516 commit 84c2299

16 files changed

+209
-127
lines changed

assets/multiqc_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ module_order:
7272
anchor: "mlib_featurecounts"
7373
info: "This section of the report shows featureCounts results for the number of reads assigned to merged library consensus peaks."
7474
path_filters:
75-
- "./macs/consensus/*.summary"
75+
- "./macs2/featurecounts/*.summary"
7676

7777
report_section_order:
7878
peak_count:

conf/modules.config

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ process {
396396

397397
withName: 'PHANTOMPEAKQUALTOOLS' {
398398
ext.args2 = { "-p=$task.cpus" }
399-
ext.prefix = { "${meta.id}.mLb.clN" }
400399
publishDir = [
401400
path: { "${params.outdir}/${params.aligner}/mergedLibrary/phantompeakqualtools" },
402401
mode: params.publish_dir_mode,
@@ -599,7 +598,8 @@ if (!params.skip_peak_annotation) {
599598
}
600599

601600
withName: 'PLOT_HOMER_ANNOTATEPEAKS' {
602-
ext.args = '-o ./ -p macs2_annotatePeaks'
601+
ext.args = '-o ./'
602+
ext.prefix = 'macs2_annotatePeaks'
603603
publishDir = [
604604
path: { [
605605
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
@@ -623,7 +623,8 @@ if (!params.skip_consensus_peaks) {
623623
path: { [
624624
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
625625
params.narrow_peak? '/narrowPeak' : '/broadPeak',
626-
'/consensus'
626+
'/consensus',
627+
"/${meta.id}"
627628
].join('') },
628629
mode: params.publish_dir_mode,
629630
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
@@ -632,11 +633,13 @@ if (!params.skip_consensus_peaks) {
632633

633634
withName: 'SUBREAD_FEATURECOUNTS' {
634635
ext.args = '-F SAF -O --fracOverlap 0.2'
636+
ext.prefix = { "${meta.id}.consensus_peaks" }
635637
publishDir = [
636638
path: { [
637639
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
638640
params.narrow_peak? '/narrowPeak' : '/broadPeak',
639-
'/consensus'
641+
'/consensus',
642+
"/${meta.id}"
640643
].join('') },
641644
mode: params.publish_dir_mode,
642645
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
@@ -648,24 +651,27 @@ if (!params.skip_consensus_peaks) {
648651
process {
649652
withName: 'HOMER_ANNOTATEPEAKS_CONSENSUS' {
650653
ext.args = '-gid'
651-
ext.prefix = 'consensus_peaks'
654+
ext.prefix = { "${meta.id}.consensus_peaks" }
652655
publishDir = [
653656
path: { [
654657
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
655658
params.narrow_peak? '/narrowPeak' : '/broadPeak',
656-
'/consensus'
659+
'/consensus',
660+
"/${meta.id}"
657661
].join('') },
658662
mode: params.publish_dir_mode,
659663
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
660664
]
661665
}
666+
662667
withName: 'ANNOTATE_BOOLEAN_PEAKS' {
663-
ext.prefix = { "${meta.id}_peaks" }
668+
ext.prefix = { "${meta.id}.consensus_peaks" }
664669
publishDir = [
665670
path: { [
666671
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
667672
params.narrow_peak? '/narrowPeak' : '/broadPeak',
668-
'/consensus'
673+
'/consensus',
674+
"/${meta.id}"
669675
].join('') },
670676
mode: params.publish_dir_mode,
671677
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
@@ -684,11 +690,13 @@ if (!params.skip_consensus_peaks) {
684690
'--count_col 7',
685691
params.deseq2_vst ? '--vst TRUE' : ''
686692
].join(' ').trim()
693+
ext.prefix = { "${meta.id}.consensus_peaks" }
687694
publishDir = [
688695
path: { [
689696
"${params.outdir}/${params.aligner}/mergedLibrary/macs2",
690697
params.narrow_peak? '/narrowPeak' : '/broadPeak',
691698
'/consensus',
699+
"/${meta.id}",
692700
'/deseq2'
693701
].join('') },
694702
mode: params.publish_dir_mode,

conf/test.config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
*/
1212

1313
params {
14-
config_profile_name = 'Test profile'
14+
config_profile_name = 'Test profile'
1515
config_profile_description = 'Minimal test dataset to check pipeline function'
1616

1717
// Limit resources so that this can run on GitHub Actions
18-
max_cpus = 2
19-
max_memory = 6.GB
20-
max_time = 6.h
18+
max_cpus = 2
19+
max_memory = '6.GB'
20+
max_time = '6.h'
2121

2222
// Input data
2323
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/chipseq/samplesheet/v2.0/samplesheet_test.csv'

conf/test_full.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ params {
1717
// Input data for full size test
1818
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/chipseq/samplesheet/v2.0/samplesheet_full.csv'
1919

20-
// Used to get macs_gsize
20+
// Used to calculate --macs_gsize
2121
read_length = 50
2222

2323
// Genome references

docs/output.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ The [featureCounts](http://bioinf.wehi.edu.au/featureCounts/) tool is used to co
261261

262262
**This pipeline uses a standardised DESeq2 analysis script to get an idea of the reproducibility within the experiment, and to assess the overall differential binding. Please note that this will not suit every experimental design, and if there are other problems with the experiment then it may not work as well as expected.**
263263

264-
For larger experiments, it may be recommended to use the `vst` transformation instead of the default `rlog` option. You can do this by providing the `--deseq2_vst` parameter to the pipeline. See [DESeq2 docs](http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#data-transformations-and-visualization) for a more detailed explanation.
264+
For larger experiments, it is recommended to use the `vst` transformation instead of the `rlog` option. This is the default behaviour and can be controlled with the `--deseq2_vst` parameter. See [DESeq2 docs](http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#data-transformations-and-visualization) for a more detailed explanation.
265265

266266
![MultiQC - DESeq2 PCA plot](images/mqc_deseq2_pca_plot.png)
267267

lib/WorkflowChipseq.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class WorkflowChipseq {
1212

1313

1414
if (!params.fasta) {
15-
log.error "Genome fasta file not specified with e.g. '--fasta genome.fa' or via a detectable config file."
15+
log.error "Genome fasta file not specified with e.g. '--fasta' or via a detectable config file."
1616
System.exit(1)
1717
}
1818

@@ -98,7 +98,7 @@ class WorkflowChipseq {
9898
log.warn "=============================================================================\n" +
9999
" --macs_gsize parameter has not been provided.\n" +
100100
" It will be auto-calculated by 'khmer unique-kmers.py' using the '--read_length' parameter.\n" +
101-
" Explicitly provide '--macs_gsize macs2_genome_size' to change this behaviour.\n" +
101+
" Explicitly provide '--macs_gsize' to change this behaviour.\n" +
102102
"==================================================================================="
103103
}
104104

modules/local/annotate_boolean_peaks.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
process ANNOTATE_BOOLEAN_PEAKS {
2-
2+
tag "$meta.id"
33
label 'process_low'
44

55
conda (params.enable_conda ? "conda-forge::sed=4.7" : null)

modules/local/deseq2_qc.nf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ process DESEQ2_QC {
2727
script:
2828
def args = task.ext.args ?: ''
2929
def peak_type = params.narrow_peak ? 'narrowPeak' : 'broadPeak'
30-
def antibody = meta.antibody
31-
def prefix = "${antibody}.consensus_peaks"
30+
def prefix = task.ext.prefix ?: "${meta.id}"
3231
"""
3332
deseq2_qc.r \\
3433
--count_file $counts \\
@@ -38,11 +37,11 @@ process DESEQ2_QC {
3837
$args
3938
4039
sed 's/deseq2_pca/deseq2_pca_${task.index}/g' <$deseq2_pca_header >tmp.txt
41-
sed -i -e 's/DESeq2 /${antibody} DESeq2 /g' tmp.txt
40+
sed -i -e 's/DESeq2 /${meta.id} DESeq2 /g' tmp.txt
4241
cat tmp.txt ${prefix}.pca.vals.txt > ${prefix}.pca.vals_mqc.tsv
4342
4443
sed 's/deseq2_clustering/deseq2_clustering_${task.index}/g' <$deseq2_clustering_header >tmp.txt
45-
sed -i -e 's/DESeq2 /${antibody} DESeq2 /g' tmp.txt
44+
sed -i -e 's/DESeq2 /${meta.id} DESeq2 /g' tmp.txt
4645
cat tmp.txt ${prefix}.sample.dists.txt > ${prefix}.sample.dists_mqc.tsv
4746
4847
cat <<-END_VERSIONS > versions.yml

modules/local/frip_score.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ process FRIP_SCORE {
2020
"""
2121
READS_IN_PEAKS=\$(intersectBed -a $bam -b $peak $args | awk -F '\t' '{sum += \$NF} END {print sum}')
2222
samtools flagstat $bam > ${bam}.flagstat
23-
grep 'mapped (' ${bam}.flagstat | awk -v a="\$READS_IN_PEAKS" -v OFS='\t' '{print "${prefix}", a/\$1}' > ${prefix}.FRiP.txt
23+
grep 'mapped (' ${bam}.flagstat | grep -v "primary" | awk -v a="\$READS_IN_PEAKS" -v OFS='\t' '{print "${prefix}", a/\$1}' > ${prefix}.FRiP.txt
2424
2525
cat <<-END_VERSIONS > versions.yml
2626
"${task.process}":

modules/local/multiqc.nf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ process MULTIQC {
3131
path ('alignment/mergedLibrary/filtered/picard_metrics/*')
3232

3333
path ('preseq/*')
34+
3435
path ('deeptools/*')
3536
path ('deeptools/*')
37+
3638
path ('phantompeakqualtools/*')
3739
path ('phantompeakqualtools/*')
3840
path ('phantompeakqualtools/*')
@@ -41,8 +43,7 @@ process MULTIQC {
4143
path ('macs2/peaks/*')
4244
path ('macs2/peaks/*')
4345
path ('macs2/annotation/*')
44-
45-
path ('featurecounts/*')
46+
path ('macs2/featurecounts/*')
4647

4748
path ('deseq2/*')
4849
path ('deseq2/*')

0 commit comments

Comments
 (0)