@@ -11,21 +11,14 @@ include { STAR_ALIGN } from '../modules/local/star/align/main'
11
11
include { MERGE_DUP as MERG_DUP_S } from ' ../subworkflows/icgc-argo-workflows/merge_dup/main'
12
12
include { MERGE_DUP as MERG_DUP_ST } from ' ../subworkflows/icgc-argo-workflows/merge_dup/main'
13
13
include { MERGE_DUP as MERG_DUP_H } from ' ../subworkflows/icgc-argo-workflows/merge_dup/main'
14
- // include { PAYLOAD_ALIGNMENT as PAYLOAD_ALIGNMENT_S } from '../modules/local/payload/rnaseqalignment/main'
15
- // include { PAYLOAD_ALIGNMENT as PAYLOAD_ALIGNMENT_ST } from '../modules/local/payload/rnaseqalignment/main'
16
- // include { PAYLOAD_ALIGNMENT as PAYLOAD_ALIGNMENT_H } from '../modules/local/payload/rnaseqalignment/main'
17
-
18
14
include { PAYLOAD_ALIGNMENT as PAYLOAD_ALIGNMENT_S } from ' ../modules/icgc-argo-workflows/payload/alignment/main'
19
15
include { PAYLOAD_ALIGNMENT as PAYLOAD_ALIGNMENT_ST } from ' ../modules/icgc-argo-workflows/payload/alignment/main'
20
16
include { PAYLOAD_ALIGNMENT as PAYLOAD_ALIGNMENT_H } from ' ../modules/icgc-argo-workflows/payload/alignment/main'
21
-
22
17
include { SONG_SCORE_UPLOAD as UPLOAD_ALIGNMENT_S } from ' ../subworkflows/icgc-argo-workflows/song_score_upload/main'
23
18
include { SONG_SCORE_UPLOAD as UPLOAD_ALIGNMENT_ST } from ' ../subworkflows/icgc-argo-workflows/song_score_upload/main'
24
19
include { SONG_SCORE_UPLOAD as UPLOAD_ALIGNMENT_H } from ' ../subworkflows/icgc-argo-workflows/song_score_upload/main'
25
20
include { MERGE_SPLICE_JUNCTION as MERGE_SPLICE_JUNCTION_S } from ' ../modules/local/merge_splice_junction/main.nf'
26
21
include { MERGE_SPLICE_JUNCTION as MERGE_SPLICE_JUNCTION_H } from ' ../modules/local/merge_splice_junction/main.nf'
27
- // include { PAYLOAD_SPLICE_JUNCTION as PAYLOAD_SPLICE_JUNCTION_S } from '../modules/local/payload/novel_splice/main'
28
- // include { PAYLOAD_SPLICE_JUNCTION as PAYLOAD_SPLICE_JUNCTION_H } from '../modules/local/payload/novel_splice/main'
29
22
include { PAYLOAD_SPLICE_JUNCTION as PAYLOAD_SPLICE_JUNCTION_S } from ' ../modules/icgc-argo-workflows/payload/splicejunction/main'
30
23
include { PAYLOAD_SPLICE_JUNCTION as PAYLOAD_SPLICE_JUNCTION_H } from ' ../modules/icgc-argo-workflows/payload/splicejunction/main'
31
24
include { SONG_SCORE_UPLOAD as UPLOAD_NOVEL_SPLICE_S } from ' ../subworkflows/icgc-argo-workflows/song_score_upload/main'
@@ -36,8 +29,6 @@ include { SAMTOOLS_STATS as SAMTOOLS_STATS_S } from '../modules/nf-core/samtools
36
29
include { SAMTOOLS_STATS as SAMTOOLS_STATS_H } from ' ../modules/nf-core/samtools/stats/main'
37
30
include { MULTIQC as MULTIQC_S } from ' ../modules/nf-core/multiqc/main'
38
31
include { MULTIQC as MULTIQC_H } from ' ../modules/nf-core/multiqc/main'
39
- // include { PREP_METRICS as PREP_METRICS_S } from '../modules/local/prep/rnametrics/main'
40
- // include { PREP_METRICS as PREP_METRICS_H } from '../modules/local/prep/rnametrics/main'
41
32
include { PREP_METRICS as PREP_METRICS_S } from ' ../modules/icgc-argo-workflows/prep/metrics/main'
42
33
include { PREP_METRICS as PREP_METRICS_H } from ' ../modules/icgc-argo-workflows/prep/metrics/main'
43
34
include { PAYLOAD_QCMETRICS as PAYLOAD_QCMETRICS_S } from ' ../modules/icgc-argo-workflows/payload/qcmetrics/main'
@@ -69,18 +60,17 @@ workflow RNAALN {
69
60
)
70
61
71
62
ch_versions = ch_versions. mix(STAGE_INPUT . out. versions)
72
- // STAGE_INPUT.out.meta_files.subscribe { println("Meta Files Output: ${it}") }
73
63
74
64
// Prepare reference file [meta fasta] [meta, fai]
75
65
ch_ref = Channel . fromPath(params. reference_fasta)
76
66
.map{ path -> [ [id : ' fasta' ], path ] }
77
67
.mix( Channel . fromPath(params. reference_fai)
78
68
.map{ path -> [ [id : ' fai' ], path ] } )
79
69
80
- // ch_ref_trans = Channel.fromPath(params.reference_trans_fasta)
81
- // .map{ path -> [ [id: 'fasta'], path ] }
82
- // .mix( Channel.fromPath(params.reference_trans_fai)
83
- // .map{ path -> [ [id: 'fai'], path ] } )
70
+ ch_ref_trans = Channel . fromPath(params. reference_trans_fasta)
71
+ .map{ path -> [ [id : ' fasta' ], path ] }
72
+ .mix( Channel . fromPath(params. reference_trans_fai)
73
+ .map{ path -> [ [id : ' fai' ], path ] } )
84
74
85
75
// HISAT2 //
86
76
if (params. tools. split(' ,' ). contains(' hisat2_aln' )){
@@ -107,8 +97,6 @@ workflow RNAALN {
107
97
)
108
98
ch_versions = ch_versions. mix(MERG_DUP_H . out. versions)
109
99
110
- // MERG_DUP_H.out.cram_alignment_index.map { meta, cram, crai -> [meta, cram] }.subscribe{ println("MERGE dup no crai: ${it}") }
111
-
112
100
// Combine channels to determine upload status and payload creation
113
101
MERG_DUP_H . out. cram_alignment_index
114
102
.combine(STAGE_INPUT . out. upRdpc)
@@ -145,8 +133,6 @@ workflow RNAALN {
145
133
.mix(HISAT2_ALIGN . out. versions)
146
134
.mix(MERG_DUP_H . out. versions)
147
135
.collectFile(name : ' collated_versions.yml' )
148
- // params.genome_build,
149
- // params.genome_annotation
150
136
)
151
137
ch_versions = ch_versions. mix(PAYLOAD_ALIGNMENT_H . out. versions)
152
138
@@ -253,6 +239,7 @@ workflow RNAALN {
253
239
Channel . fromPath(params. reference_fasta). map{ it -> [ [ id :' fasta' ], it ] }
254
240
)
255
241
ch_versions = ch_versions. mix(SAMTOOLS_STATS_H . out. versions)
242
+
256
243
// Picard
257
244
PICARD_COLLECTRNASEQMETRICS_H (
258
245
MERG_DUP_H . out. cram_alignment_index,
@@ -262,16 +249,8 @@ workflow RNAALN {
262
249
Channel . fromPath(params. rrna_intervals)
263
250
)
264
251
265
- // PICARD_COLLECTRNASEQMETRICS_H(
266
- // MERG_DUP_H.out.cram_alignment_index.map { meta, cram, crai -> [meta, cram] },
267
- // Channel.fromPath(params.ref_flat),
268
- // Channel.fromPath(params.reference_fasta),
269
- // Channel.fromPath(params.rrna_intervals)
270
- // )
271
252
ch_versions = ch_versions. mix(PICARD_COLLECTRNASEQMETRICS_H . out. versions)
272
253
273
- // PICARD_COLLECTRNASEQMETRICS_H.out.metrics.subscribe { println("Picard metrics - HISAT2: ${it}") }
274
-
275
254
// MultiQC
276
255
ch_reports = (
277
256
Channel . empty()
@@ -296,17 +275,6 @@ workflow RNAALN {
296
275
)
297
276
ch_versions = ch_versions. mix(MULTIQC_H . out. versions)
298
277
299
- // MULTIQC_H.out.report.subscribe { println("MultiQC report - HISAT2: ${it}") }
300
- // MULTIQC_H.out.data.subscribe { println("MultiQC data - HISAT2: ${it}") }
301
-
302
- // PICARD_COLLECTRNASEQMETRICS_H.out.metrics (meta, path)
303
- // MULTIQC_H.out.picard_multi
304
- // MULTIQC_H.out.hisat2_multi
305
-
306
- // PICARD_COLLECTRNASEQMETRICS_H.out.metrics.subscribe { println("Picard output: ${it}") }
307
- // MULTIQC_H.out.picard_multi.subscribe { println("MultiQC picard output: ${it}") }
308
- // MULTIQC_H.out.hisat2_multi.subscribe { println("MultiQC hisat2 output: ${it}") }
309
-
310
278
// metrics preparation
311
279
PICARD_COLLECTRNASEQMETRICS_H . out. metrics
312
280
.combine(MULTIQC_H . out. data)
@@ -329,24 +297,11 @@ workflow RNAALN {
329
297
}
330
298
.set{ch_h_prep_metrics}
331
299
332
- // ch_h_prep_metrics.subscribe { println("prep metrics input: ${it}") }
333
- // ch_h_prep_metrics.subscribe { println("Multiqc_FILES input: ${it}") }
334
-
335
300
PREP_METRICS_H (
336
301
ch_h_prep_metrics,
337
302
[]
338
303
)
339
304
340
- // PREP_METRICS_H.out.metrics_json.subscribe { println("prep metrics output: ${it}") }
341
-
342
- // ch_h_prep_metrics.subscribe { println("prep metrics: ${it}") }
343
- // PREP_METRICS_H.out.metrics_json.subscribe { println("prep metrics out json: ${it}") }
344
- // MULTIQC_H.out.data.subscribe { println("multiQC: ${it}") }
345
-
346
- // TAR(ch_h_prep_metrics)
347
-
348
- // TAR.out.stats.subscribe { println("TAR: ${it}") }
349
-
350
305
PICARD_COLLECTRNASEQMETRICS_H . out. metrics
351
306
.combine(MULTIQC_H . out. picard_multi)
352
307
.combine(MULTIQC_H . out. hisat2_multi)
@@ -408,8 +363,6 @@ workflow RNAALN {
408
363
.collect()
409
364
.set{hisat2_qc_cleanup}
410
365
411
- // ch_h_qcmetrics_payload.subscribe { println("prep payload input: ${it}") }
412
-
413
366
PAYLOAD_QCMETRICS_H ( // [val(meta) path(json), [path(picard_multiQC), path(hisat2_multiQC)], path(multiQC)]
414
367
ch_h_qcmetrics_payload,
415
368
Channel . empty()
@@ -422,11 +375,11 @@ workflow RNAALN {
422
375
)
423
376
ch_versions = ch_versions. mix(PAYLOAD_QCMETRICS_H . out. versions)
424
377
425
- // PAYLOAD_QCMETRICS_H.out.payload_files.subscribe { println("Generated Payload: ${it}") }
426
-
427
378
// upload - qc metrics
428
379
UPLOAD_QC_H (PAYLOAD_QCMETRICS_H . out. payload_files) // [val(meta), path("*.payload.json"), [path(CRAM),path(CRAI)]
429
380
ch_versions = ch_versions. mix(UPLOAD_QC_H . out. versions)
381
+
382
+ hisat2OutFlag_ch = UPLOAD_ALIGNMENT_H . out. analysis_id. concat(UPLOAD_NOVEL_SPLICE_H . out. analysis_id, UPLOAD_QC_H . out. analysis_id). collect()
430
383
}
431
384
432
385
// STAR //
@@ -496,7 +449,6 @@ workflow RNAALN {
496
449
// Upload files - alignment
497
450
UPLOAD_ALIGNMENT_S (PAYLOAD_ALIGNMENT_S . out. payload_files) // [val(meta), path("*.payload.json"), [path(CRAM),path(CRAI)]
498
451
ch_versions = ch_versions. mix(UPLOAD_ALIGNMENT_S . out. versions)
499
- // UPLOAD_ALIGNMENT_S.out.analysis_id.subscribe { println("Upload Analysis Id: ${it}") }
500
452
501
453
if (! binding. hasVariable(' ch_ref_trans' ) || ! ch_ref_trans) {
502
454
// Prepare transcript fasta and fai
@@ -556,8 +508,6 @@ workflow RNAALN {
556
508
// Upload files - alignment
557
509
UPLOAD_ALIGNMENT_ST (PAYLOAD_ALIGNMENT_ST . out. payload_files) // [val(meta), path("*.payload.json"), [path(CRAM),path(CRAI)]
558
510
ch_versions = ch_versions. mix(UPLOAD_ALIGNMENT_ST . out. versions)
559
- // UPLOAD_ALIGNMENT_ST.out.analysis_id.subscribe { println("Upload Analysis Id STAR ST: ${it}") }
560
-
561
511
562
512
// Collect Splice Junctions
563
513
STAR_ALIGN . out. spl_junc_tab. flatten(). buffer( size : 2 )
@@ -657,13 +607,7 @@ workflow RNAALN {
657
607
Channel . fromPath(params. reference_fasta). map{ it -> [ [ id :' fasta' ], it ] }
658
608
)
659
609
ch_versions = ch_versions. mix(SAMTOOLS_STATS_S . out. versions)
660
- // Picard
661
- // PICARD_COLLECTRNASEQMETRICS_S(
662
- // MERG_DUP_S.out.bam_post_dup,
663
- // Channel.fromPath(params.ref_flat),
664
- // Channel.fromPath(params.reference_fasta),
665
- // Channel.fromPath(params.rrna_intervals)
666
- // )
610
+
667
611
PICARD_COLLECTRNASEQMETRICS_S (
668
612
MERG_DUP_S . out. cram_alignment_index,
669
613
Channel . fromPath(params. ref_flat),
@@ -673,9 +617,6 @@ workflow RNAALN {
673
617
)
674
618
ch_versions = ch_versions. mix(PICARD_COLLECTRNASEQMETRICS_S . out. versions)
675
619
676
- // PICARD_COLLECTRNASEQMETRICS_S.out.metrics.subscribe { println("Picard output - STAR: ${it}") }
677
-
678
-
679
620
// MultiQC
680
621
ch_reports_s = (
681
622
Channel . empty()
@@ -704,9 +645,6 @@ workflow RNAALN {
704
645
)
705
646
ch_versions = ch_versions. mix(MULTIQC_S . out. versions)
706
647
707
- // MULTIQC_S.out.report.subscribe { println("MultiQC report - STAR: ${it}") }
708
- // MULTIQC_S.out.data.subscribe { println("MultiQC data - STAR: ${it}") }
709
-
710
648
// Prepare Metrics
711
649
PICARD_COLLECTRNASEQMETRICS_S . out. metrics
712
650
.combine(MULTIQC_S . out. data)
@@ -729,15 +667,11 @@ workflow RNAALN {
729
667
}
730
668
.set{ch_s_prep_metrics}
731
669
732
- // ch_s_prep_metrics.subscribe { println("prep metrics input: ${it}") }
733
-
734
670
PREP_METRICS_S (
735
671
ch_s_prep_metrics,
736
672
[]
737
673
)
738
674
739
- // PREP_METRICS_S.out.metrics_json.subscribe { println("prep metrics output: ${it}") }
740
-
741
675
PICARD_COLLECTRNASEQMETRICS_S . out. metrics
742
676
.combine(MULTIQC_S . out. picard_multi)
743
677
.combine(MULTIQC_S . out. star_multi)
@@ -791,14 +725,6 @@ workflow RNAALN {
791
725
}
792
726
.set{ch_s_qcmetrics_payload}
793
727
794
- // Channel.empty()
795
- // .mix(SAMTOOLS_STATS_S.out.stats.map{meta,files -> files}.collect())
796
- // .mix(PICARD_COLLECTRNASEQMETRICS_S.out.metrics.map{meta,file -> file}.collect())
797
- // .mix(MULTIQC_S.out.data.collect())
798
- // .mix(PREP_METRICS_S.out.metrics_json.map{meta,file -> file}.collect())
799
- // .collect()
800
- // .set{star_qc_cleanup}
801
-
802
728
Channel . empty()
803
729
.mix(SAMTOOLS_STATS_S . out. stats. map{meta ,files -> files}. collect())
804
730
.mix(PICARD_COLLECTRNASEQMETRICS_S . out. metrics. map{meta ,file -> file}. collect())
@@ -807,8 +733,6 @@ workflow RNAALN {
807
733
.collect()
808
734
.set{star_qc_cleanup}
809
735
810
- // ch_s_qcmetrics_payload.subscribe { println("prep payload input: ${it}") }
811
-
812
736
PAYLOAD_QCMETRICS_S ( // [val(meta) path(json), [path(picard_multiQC), path(hisat2_multiQC)], path(multiQC)]
813
737
ch_s_qcmetrics_payload,
814
738
Channel . empty()
@@ -821,35 +745,10 @@ workflow RNAALN {
821
745
)
822
746
ch_versions = ch_versions. mix(PAYLOAD_QCMETRICS_S . out. versions)
823
747
824
- // PAYLOAD_QCMETRICS_S.out.payload_files.subscribe { println("Generated Payload: ${it}") }
825
-
826
748
// upload - qc metrics
827
749
UPLOAD_QC_S (PAYLOAD_QCMETRICS_S . out. payload_files) // [val(meta), path("*.payload.json"), [path(CRAM),path(CRAI)]
828
750
ch_versions = ch_versions. mix(UPLOAD_QC_S . out. versions)
829
751
}
830
- // cleanup
831
- // CLEAN_ALN_H(
832
- // hisat2_qc_cleanup.unique().collect(),
833
- // UPLOAD_QC_H.out.analysis_id // what is it
834
- // )
835
-
836
- // CLEAN_ALN_S(
837
- // star_qc_cleanup.unique().collect(),
838
- // UPLOAD_QC_S.out.analysis_id
839
- // )
840
- // hisat2 trouble shoot
841
- // STAGE_INPUT.out.meta_analysis.subscribe { println("STAGE_INPUT meta_analysis: ${it}") }
842
- // STAGE_INPUT.out.meta_files.subscribe{ println("STAGE_INPUT meta_files: ${it}") }
843
- // HISAT2_ALIGN.out.bam.subscribe{ println("HISAT2_ALIGN bam: ${it}") }
844
- // MERG_DUP_H.out.tmp_files.subscribe{ println("MERG_DUP_H tmp_files: ${it}") }
845
- // MERG_DUP_H.out.cram_alignment_index.subscribe{ println("MERG_DUP_H cram_alignment_index: ${it}") }
846
- // MERGE_SPLICE_JUNCTION_H.out.all_novel_splice.subscribe{ println("MERGE_SPLICE_JUNCTION_H all_novel_splice: ${it}") }
847
- // hisat2_qc_cleanup.subscribe{ println("hisat2_qc_cleanup: ${it}") }
848
- // PAYLOAD_ALIGNMENT_H.out.payload_files.subscribe{ println("PAYLOAD_ALIGNMENT_H payload_files: ${it}") }
849
- // PAYLOAD_SPLICE_JUNCTION_H.out.payload_files.subscribe{ println("PAYLOAD_SPLICE_JUNCTION_H payload_files: ${it}") }
850
- // PAYLOAD_QCMETRICS_H.out.payload_files.subscribe{ println("PAYLOAD_QCMETRICS_H payload_files: ${it}") }
851
- // MERG_DUP_S.out.tmp_files.subscribe{ println("MERG_DUP_S tmp_files: ${it}") }
852
- // MERG_DUP_ST.out.tmp_files.subscribe{ println("MERG_DUP_ST tmp_files: ${it}") }
853
752
854
753
if (params. tools. split(' ,' ). contains(' cleanup' )){
855
754
if (params. samplesheet) {
@@ -860,6 +759,7 @@ workflow RNAALN {
860
759
ch_cleanup_H= Channel . empty()
861
760
.mix(STAGE_INPUT . out. meta_analysis. map{meta ,metadata -> metadata}. collect())
862
761
.mix(STAGE_INPUT . out. meta_files. map{meta ,files -> files}. flatten(). collect())
762
+ ch_cleanup_S= Channel . empty()
863
763
} else if (params. tools. split(' ,' ). contains(' hisat2_aln' )) {
864
764
ch_cleanup_H= Channel . empty()
865
765
.mix(STAGE_INPUT . out. meta_analysis. map{meta ,metadata -> metadata}. collect())
@@ -921,7 +821,7 @@ workflow RNAALN {
921
821
922
822
CLEAN_ALN_H (
923
823
ch_cleanup_H. unique(). collect(),
924
- UPLOAD_QC_H . out . analysis_id
824
+ hisat2OutFlag_ch
925
825
)
926
826
} else {
927
827
CLEAN_ALN_H (
@@ -940,8 +840,6 @@ workflow RNAALN {
940
840
versions = ch_versions // channel: [ path(versions.yml) ]
941
841
}
942
842
943
- // .mix(HISAT2_ALIGN.out.bam.map{meta,file -> file}.flatten().collect())
944
-
945
843
/*
946
844
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
947
845
THE END
0 commit comments