7
7
//
8
8
// MODULE: Loaded from modules/local/
9
9
//
10
- include { FRIP_SCORE } from ' ../modules/local/frip_score'
11
- include { PLOT_MACS2_QC } from ' ../modules/local/plot_macs2_qc'
12
- include { PLOT_HOMER_ANNOTATEPEAKS } from ' ../modules/local/plot_homer_annotatepeaks'
13
10
include { MACS2_CONSENSUS } from ' ../modules/local/macs2_consensus'
14
11
include { ANNOTATE_BOOLEAN_PEAKS } from ' ../modules/local/annotate_boolean_peaks'
15
12
include { DESEQ2_QC } from ' ../modules/local/deseq2_qc'
16
13
include { IGV } from ' ../modules/local/igv'
17
14
include { MULTIQC } from ' ../modules/local/multiqc'
18
15
include { MULTIQC_CUSTOM_PHANTOMPEAKQUALTOOLS } from ' ../modules/local/multiqc_custom_phantompeakqualtools'
19
- include { MULTIQC_CUSTOM_PEAKS } from ' ../modules/local/multiqc_custom_peaks'
20
16
21
17
//
22
18
// SUBWORKFLOW: Consisting of a mix of local and nf-core/modules
@@ -29,6 +25,7 @@ include { INPUT_CHECK } from '../subworkflows/local/i
29
25
include { ALIGN_STAR } from ' ../subworkflows/local/align_star'
30
26
include { BAM_FILTER_BAMTOOLS } from ' ../subworkflows/local/bam_filter_bamtools'
31
27
include { BAM_BEDGRAPH_BIGWIG_BEDTOOLS_UCSC } from ' ../subworkflows/local/bam_bedgraph_bigwig_bedtools_ucsc'
28
+ include { BAM_PEAKS_CALL_QC_ANNOTATE_MACS2_HOMER } from ' ../subworkflows/local/bam_peaks_call_qc_annotate_macs2_homer.nf'
32
29
33
30
/*
34
31
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -49,10 +46,8 @@ include { DEEPTOOLS_PLOTPROFILE } from '../modules/nf-core/deeptools/plo
49
46
include { DEEPTOOLS_PLOTHEATMAP } from ' ../modules/nf-core/deeptools/plotheatmap/main'
50
47
include { DEEPTOOLS_PLOTFINGERPRINT } from ' ../modules/nf-core/deeptools/plotfingerprint/main'
51
48
include { KHMER_UNIQUEKMERS } from ' ../modules/nf-core/khmer/uniquekmers/main'
52
- include { MACS2_CALLPEAK } from ' ../modules/nf-core/macs2/callpeak/main'
53
49
include { SUBREAD_FEATURECOUNTS } from ' ../modules/nf-core/subread/featurecounts/main'
54
50
55
- include { HOMER_ANNOTATEPEAKS as HOMER_ANNOTATEPEAKS_MACS2 } from ' ../modules/nf-core/homer/annotatepeaks/main'
56
51
include { HOMER_ANNOTATEPEAKS as HOMER_ANNOTATEPEAKS_CONSENSUS } from ' ../modules/nf-core/homer/annotatepeaks/main'
57
52
58
53
//
@@ -437,9 +432,6 @@ workflow CHIPSEQ {
437
432
//
438
433
// TODO move to prepare genome
439
434
ch_macs_gsize = Channel . empty()
440
- ch_custompeaks_frip_multiqc = Channel . empty()
441
- ch_custompeaks_count_multiqc = Channel . empty()
442
- ch_plothomerannotatepeaks_multiqc = Channel . empty()
443
435
ch_subreadfeaturecounts_multiqc = Channel . empty()
444
436
ch_macs_gsize = params. macs_gsize
445
437
if (! params. macs_gsize) {
@@ -459,96 +451,22 @@ workflow CHIPSEQ {
459
451
.set { ch_ip_control_bam }
460
452
461
453
//
462
- // MODULE : Call peaks with MACS2
454
+ // SUBWORKFLOW : Call peaks with MACS2, annotate with HOMER and perform downstream QC
463
455
//
464
- MACS2_CALLPEAK (
456
+ BAM_PEAKS_CALL_QC_ANNOTATE_MACS2_HOMER (
465
457
ch_ip_control_bam,
466
- ch_macs_gsize
467
- )
468
- ch_versions = ch_versions. mix(MACS2_CALLPEAK . out. versions. first())
469
-
470
- //
471
- // Filter out samples with 0 MACS2 peaks called
472
- //
473
- MACS2_CALLPEAK
474
- .out
475
- .peak
476
- .filter {
477
- meta, peaks ->
478
- peaks. size() > 0
479
- }
480
- .set { ch_macs2_peaks }
481
-
482
- // Create channels: [ meta, ip_bam, peaks ]
483
- ch_ip_control_bam
484
- .join(ch_macs2_peaks, by : [0 ])
485
- .map {
486
- it ->
487
- [ it[0 ], it[1 ], it[3 ] ]
488
- }
489
- .set { ch_ip_bam_peaks }
490
-
491
- //
492
- // MODULE: Calculate FRiP score
493
- //
494
- FRIP_SCORE (
495
- ch_ip_bam_peaks
496
- )
497
- ch_versions = ch_versions. mix(FRIP_SCORE . out. versions. first())
498
-
499
- // Create channels: [ meta, peaks, frip ]
500
- ch_ip_bam_peaks
501
- .join(FRIP_SCORE . out. txt, by : [0 ])
502
- .map {
503
- it ->
504
- [ it[0 ], it[2 ], it[3 ] ]
505
- }
506
- .set { ch_ip_peaks_frip }
507
-
508
- //
509
- // MODULE: FRiP score custom content for MultiQC
510
- //
511
- MULTIQC_CUSTOM_PEAKS (
512
- ch_ip_peaks_frip,
458
+ ch_fasta,
459
+ ch_gtf,
460
+ ch_macs_gsize,
461
+ " _peaks.annotatePeaks.txt" ,
513
462
ch_peak_count_header,
514
- ch_frip_score_header
463
+ ch_frip_score_header,
464
+ ch_peak_annotation_header,
465
+ params. narrow_peak,
466
+ params. skip_peak_annotation,
467
+ params. skip_peak_qc
515
468
)
516
- ch_custompeaks_frip_multiqc = MULTIQC_CUSTOM_PEAKS . out. frip
517
- ch_custompeaks_count_multiqc = MULTIQC_CUSTOM_PEAKS . out. count
518
-
519
- if (! params. skip_peak_annotation) {
520
- //
521
- // MODULE: Annotate peaks with MACS2
522
- //
523
- HOMER_ANNOTATEPEAKS_MACS2 (
524
- ch_macs2_peaks,
525
- ch_fasta,
526
- ch_gtf
527
- )
528
- ch_versions = ch_versions. mix(HOMER_ANNOTATEPEAKS_MACS2 . out. versions. first())
529
-
530
- if (! params. skip_peak_qc) {
531
- //
532
- // MODULE: MACS2 QC plots with R
533
- //
534
- PLOT_MACS2_QC (
535
- ch_macs2_peaks. collect{it[1 ]},
536
- params. narrow_peak
537
- )
538
- ch_versions = ch_versions. mix(PLOT_MACS2_QC . out. versions)
539
-
540
- //
541
- // MODULE: Peak annotation QC plots with R
542
- //
543
- PLOT_HOMER_ANNOTATEPEAKS (
544
- HOMER_ANNOTATEPEAKS_MACS2 . out. txt. collect{it[1 ]},
545
- ch_peak_annotation_header,
546
- " _peaks.annotatePeaks.txt"
547
- )
548
- ch_plothomerannotatepeaks_multiqc = PLOT_HOMER_ANNOTATEPEAKS . out. tsv
549
- ch_versions = ch_versions. mix(PLOT_HOMER_ANNOTATEPEAKS . out. versions)
550
- }
551
- }
469
+ ch_versions = ch_versions. mix(MERGED_LIBRARY_CALL_ANNOTATE_PEAKS . out. versions)
552
470
553
471
//
554
472
// Consensus peaks analysis
@@ -560,7 +478,7 @@ workflow CHIPSEQ {
560
478
if (! params. skip_consensus_peaks) {
561
479
// Create channels: [ meta , [ peaks ] ]
562
480
// Where meta = [ id:antibody, multiple_groups:true/false, replicates_exist:true/false ]
563
- ch_macs2_peaks
481
+ BAM_PEAKS_CALL_QC_ANNOTATE_MACS2_HOMER . out . peaks
564
482
.map {
565
483
meta, peak ->
566
484
[ meta. antibody, meta. id. split(' _' )[0 .. -2 ]. join(' _' ), peak ]
@@ -671,7 +589,7 @@ workflow CHIPSEQ {
671
589
params. narrow_peak ? ' narrow_peak' : ' broad_peak' ,
672
590
ch_fasta,
673
591
BAM_BEDGRAPH_BIGWIG_BEDTOOLS_UCSC . out. bigwig. collect{it[1 ]}. ifEmpty([]),
674
- ch_macs2_peaks . collect{it[1 ]}. ifEmpty([]),
592
+ BAM_PEAKS_CALL_QC_ANNOTATE_MACS2_HOMER . out . peaks . collect{it[1 ]}. ifEmpty([]),
675
593
ch_macs2_consensus_bed_lib. collect{it[1 ]}. ifEmpty([]),
676
594
ch_macs2_consensus_txt_lib. collect{it[1 ]}. ifEmpty([])
677
595
)
@@ -731,9 +649,9 @@ workflow CHIPSEQ {
731
649
ch_multiqc_phantompeakqualtools_rsc_multiqc. collect{it[1 ]}. ifEmpty([]),
732
650
ch_multiqc_phantompeakqualtools_correlation_multiqc. collect{it[1 ]}. ifEmpty([]),
733
651
734
- ch_custompeaks_frip_multiqc . collect{it[1 ]}. ifEmpty([]),
735
- ch_custompeaks_count_multiqc . collect{it[1 ]}. ifEmpty([]),
736
- ch_plothomerannotatepeaks_multiqc . collect(). ifEmpty([]),
652
+ BAM_PEAKS_CALL_QC_ANNOTATE_MACS2_HOMER . out . frip_multiqc . collect{it[1 ]}. ifEmpty([]),
653
+ BAM_PEAKS_CALL_QC_ANNOTATE_MACS2_HOMER . out . peak_count_multiqc . collect{it[1 ]}. ifEmpty([]),
654
+ BAM_PEAKS_CALL_QC_ANNOTATE_MACS2_HOMER . out . plot_homer_annotatepeaks_tsv . collect(). ifEmpty([]),
737
655
ch_subreadfeaturecounts_multiqc. collect{it[1 ]}. ifEmpty([]),
738
656
739
657
ch_deseq2_pca_multiqc. collect(). ifEmpty([]),
0 commit comments