-
Notifications
You must be signed in to change notification settings - Fork 1
/
intogen.nf
826 lines (630 loc) · 19.2 KB
/
intogen.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
// Set here a list of files or directories to use. E.g. Channel.fromPath(["/path/*", "/path2/file"], type: 'any')
INPUT = Channel.fromPath(params.input.tokenize())
OUTPUT = file(params.output)
STEPS_FOLDER = file(params.stepsFolder)
ANNOTATIONS = Channel.value(params.annotations)
REGIONS = Channel.value("${params.datasets}/regions/cds.regions.gz")
process ParseInput {
tag "Parse input ${input}"
label "core"
publishDir "${STEPS_FOLDER}/inputs", mode: "copy"
errorStrategy 'finish'
input:
path input from INPUT
path annotations from ANNOTATIONS
output:
path("*.parsed.tsv.gz") into COHORTS
script:
if ( input.toRealPath().toFile().isDirectory() || input.endsWith(".bginfo" )) {
"""
openvar groupby ${input} --header -g DATASET -q -s 'gzip > \${GROUP_KEY}.parsed.tsv.gz'
"""
}
else {
cohort = input.baseName.split('\\.')[0]
"""
openvar cat ${input} --header | gzip > ${cohort}.parsed.tsv.gz
"""
}
}
COHORTS
.flatten()
.map{it -> [it.baseName.split('\\.')[0], it]}
.into{ COHORTS1; COHORTS2; COHORTS3; COHORTS4; COHORTS5 }
process LoadCancer {
tag "Load cancer type ${cohort}"
label "core"
input:
tuple val(cohort), path(input) from COHORTS1
output:
tuple val(cohort), stdout into CANCERS
script:
"""
get_field.sh ${input} CANCER
"""
}
CANCERS.into { CANCERS1; CANCERS2; CANCERS3 }
process LoadPlatform {
tag "Load sequencing platform ${cohort}"
label "core"
input:
tuple val(cohort), path(input) from COHORTS2
output:
tuple val(cohort), stdout into PLATFORMS
script:
"""
get_field.sh ${input} PLATFORM
"""
}
PLATFORMS.into { PLATFORMS1; PLATFORMS2; PLATFORMS3 }
process LoadGenome {
tag "Load reference genome ${cohort}"
label "core"
input:
tuple val(cohort), path(input) from COHORTS3
output:
tuple val(cohort), stdout into GENOMES
script:
"""
get_field.sh ${input} GENOMEREF
"""
}
CUTOFFS = ['WXS': 1000, 'WGS': 10000]
process ProcessVariants {
tag "Process variants ${cohort}"
label "core"
errorStrategy 'ignore' // if a cohort does not pass the filters, do not proceed with it
publishDir "${STEPS_FOLDER}/variants", mode: "copy"
input:
tuple val(cohort), path(input), val(platform), val(genome) from COHORTS4.join(PLATFORMS1).join(GENOMES)
output:
tuple val(cohort), path(output) into VARIANTS
tuple val(cohort), path("${output}.stats.json") into STATS_VARIANTS
script:
cutoff = CUTOFFS[platform]
output = "${cohort}.tsv.gz"
if (cutoff)
"""
parse-variants --input ${input} --output ${output} \
--genome ${genome.toLowerCase()} \
--cutoff ${cutoff}
"""
else
error "Invalid cutoff. Check platform: $platform"
}
VARIANTS.into { VARIANTS1; VARIANTS2; VARIANTS3; VARIANTS4; VARIANTS5 }
process FormatSignature {
tag "Prepare for signatures ${cohort}"
label "core"
publishDir "${STEPS_FOLDER}/signature", mode: "copy"
input:
tuple val(cohort), path(input) from VARIANTS1
output:
tuple val(cohort), path(output) into VARIANTS_SIG
script:
output = "${cohort}.in.tsv.gz"
"""
format-variants --input ${input} --output ${output} \
--format signature
"""
}
REGIONS_PREFIX = ['WXS': 'cds', 'WGS': 'wg']
process ComputeProfile {
tag "ComputeProfile ${cohort}"
label "bgsignature"
publishDir "${STEPS_FOLDER}/signature", mode: "copy"
input:
tuple val(cohort), path(input), val(platform) from VARIANTS_SIG.join(PLATFORMS2)
output:
tuple val(cohort), path(output) into SIGNATURES
script:
prefix = REGIONS_PREFIX[platform]
output = "${cohort}.sig.json"
if (prefix)
"""
bgsignature normalize -m ${input} \
-r ${params.datasets}/regions/${prefix}.regions.gz \
--normalize ${params.datasets}/signature/${prefix}.counts.gz \
-s 3 -g hg38 --collapse \
--cores ${task.cpus} \
-o ${output}
"""
else
error "Invalid prefix. Check platform: $platform"
}
SIGNATURES.into{ SIGNATURES1; SIGNATURES2; SIGNATURES3; SIGNATURES4; SIGNATURES5 }
process FormatFML {
tag "Prepare for FML ${cohort}"
label "core"
publishDir "${STEPS_FOLDER}/oncodrivefml", mode: "copy"
input:
tuple val(cohort), path(input) from VARIANTS2
output:
tuple val(cohort), path(output) into VARIANTS_FML
script:
output = "${cohort}.in.tsv.gz"
"""
format-variants --input ${input} --output ${output} \
--format fml
"""
}
process OncodriveFML {
tag "OncodriveFML ${cohort}"
publishDir "${STEPS_FOLDER}/oncodrivefml", mode: "copy"
input:
tuple val(cohort), path(input), path(signature) from VARIANTS_FML.join(SIGNATURES1)
path regions from REGIONS
output:
tuple val(cohort), path("out/*.tsv.gz") into OUT_ONCODRIVEFML
script:
seedOpt = (params.seed == null)? '': "--seed ${params.seed}"
debugOpt = (params.debug)? '--debug': ''
"""
oncodrivefml -i ${input} -e ${regions} --signature ${signature} \
-c /oncodrivefml/oncodrivefml_v2.conf --cores ${task.cpus} \
-o out ${seedOpt} ${debugOpt}
"""
}
process FormatCLUSTL {
tag "Prepare for CLUSTL ${cohort}"
label "core"
publishDir "${STEPS_FOLDER}/oncodriveclustl", mode: "copy"
input:
tuple val(cohort), path(input) from VARIANTS3
output:
tuple val(cohort), path(output) into VARIANTS_CLUSTL
script:
output = "${cohort}.in.tsv.gz"
"""
format-variants --input ${input} --output ${output} \
--format clustl
"""
}
process OncodriveCLUSTL {
tag "OncodriveCLUSTL ${cohort}"
publishDir "${STEPS_FOLDER}/oncodriveclustl", mode: "copy"
input:
tuple val(cohort), path(input), path(signature), val(cancer) from VARIANTS_CLUSTL.join(SIGNATURES2).join(CANCERS1)
path regions from REGIONS
output:
tuple val(cohort), path("${cohort}.elements_results.txt") into OUT_ONCODRIVECLUSTL
tuple val(cohort), path("${cohort}.clusters_results.tsv") into OUT_ONCODRIVECLUSTL_CLUSTERS
script:
seedOpt = (params.seed == null)? '': "--seed ${params.seed}"
debugOpt = (params.debug)? '--log-level debug': ''
if (['CM', 'SBCC', 'SSCC'].contains(cancer))
"""
oncodriveclustl -i ${input} -r ${regions} \
-g hg38 -sim region_restricted -n 1000 -kmer 5 \
-sigcalc region_normalized \
--concatenate \
-c ${task.cpus} \
-o ${cohort} ${seedOpt} ${debugOpt}
mv ${cohort}/elements_results.txt ${cohort}.elements_results.txt
mv ${cohort}/clusters_results.tsv ${cohort}.clusters_results.tsv
"""
else
"""
oncodriveclustl -i ${input} -r ${regions} \
-g hg38 -sim region_restricted -n 1000 -kmer 3 \
-sig ${signature} --concatenate \
-c ${task.cpus} \
-o ${cohort} ${seedOpt} ${debugOpt}
mv ${cohort}/elements_results.txt ${cohort}.elements_results.txt
mv ${cohort}/clusters_results.tsv ${cohort}.clusters_results.tsv
"""
}
process FormatDNDSCV {
tag "Prepare for DNDSCV ${cohort}"
label "core"
publishDir "${STEPS_FOLDER}/dndscv", mode: "copy"
input:
tuple val(cohort), path(input) from VARIANTS4
output:
tuple val(cohort), path(output) into VARIANTS_DNDSCV
script:
output = "${cohort}.in.tsv.gz"
"""
format-variants --input ${input} --output ${output} \
--format dndscv
"""
}
process dNdScv {
tag "dNdScv ${cohort}"
publishDir "${STEPS_FOLDER}/dndscv", mode: "copy"
input:
tuple val(cohort), path(input) from VARIANTS_DNDSCV
output:
tuple val(cohort), path("${cohort}.dndscv.tsv.gz") into OUT_DNDSCV
tuple val(cohort), path("${cohort}.dndscv_annotmuts.tsv.gz") into OUT_DNDSCV_ANNOTMUTS
tuple val(cohort), path("${cohort}.dndscv_genemuts.tsv.gz") into OUT_DNDSCV_GENEMUTS
script:
"""
Rscript /dndscv/dndscv.R \
${input} ${cohort}.dndscv.tsv.gz \
${cohort}.dndscv_annotmuts.tsv.gz \
${cohort}.dndscv_genemuts.tsv.gz
"""
}
OUT_DNDSCV.into{ OUT_DNDSCV1; OUT_DNDSCV2 }
process FormatVEP {
tag "Prepare for VEP ${cohort}"
label "core"
publishDir "${STEPS_FOLDER}/vep", mode: "copy"
input:
tuple val(cohort), path(input) from VARIANTS5
output:
tuple val(cohort), path(output) into VARIANTS_VEP
script:
output = "${cohort}.in.tsv.gz"
"""
format-variants --input ${input} --output ${output}.tmp \
--format vep
sort -k1V -k2n -k3n ${output}.tmp |gzip > ${output}
"""
}
process VEP {
tag "VEP ${cohort}"
publishDir "${STEPS_FOLDER}/vep", mode: "copy"
input:
tuple val(cohort), path(input) from VARIANTS_VEP
output:
tuple val(cohort), path(output) into OUT_VEP
script:
output = "${cohort}.vep.tsv.gz"
"""
vep -i ${input} -o STDOUT --assembly GRCh38 \
--no_stats --cache --offline --symbol \
--protein --tab --canonical --mane \
--dir ${params.datasets}/vep \
| grep -v ^## | gzip > ${output}
"""
}
process ProcessVEPoutput {
tag "Process vep output ${cohort}"
label "core"
publishDir "${STEPS_FOLDER}/vep", mode: "copy"
input:
tuple val(cohort), path(input) from OUT_VEP
output:
tuple val(cohort), path(output) into PARSED_VEP
tuple val(cohort), path("${output}.stats.json") into STATS_VEP
script:
output = "${cohort}.tsv.gz"
"""
parse-vep --input ${input} --output ${output}
"""
}
PARSED_VEP.into { PARSED_VEP1; PARSED_VEP2; PARSED_VEP3; PARSED_VEP4; PARSED_VEP5; PARSED_VEP6; PARSED_VEP7 }
process FilterNonSynonymous {
tag "Filter non synonymus ${cohort}"
label "core"
publishDir "${STEPS_FOLDER}/nonsynonymous", mode: "copy"
input:
tuple val(cohort), path(input) from PARSED_VEP1
output:
tuple val(cohort), path(output) into PARSED_VEP_NONSYNONYMOUS
script:
output = "${cohort}.vep_nonsyn.tsv.gz"
"""
parse-nonsynonymous --input ${input} --output ${output}
"""
}
process FormatSMRegions {
tag "Prepare for SMRegions ${cohort}"
label "core"
publishDir "${STEPS_FOLDER}/smregions", mode: "copy"
input:
tuple val(cohort), path(input) from PARSED_VEP_NONSYNONYMOUS
output:
tuple val(cohort), path(output) into VARIANTS_SMREGIONS
script:
output = "${cohort}.in.tsv.gz"
"""
format-variants --input ${input} --output ${output} \
--format smregions
"""
}
process SMRegions {
tag "SMRegions ${cohort}"
publishDir "${STEPS_FOLDER}/smregions", mode: "copy"
input:
tuple val(cohort), path(input), path(signature) from VARIANTS_SMREGIONS.join(SIGNATURES3)
path regions from REGIONS
output:
tuple val(cohort), path(output) into OUT_SMREGIONS
script:
output = "${cohort}.smregions.tsv.gz"
seedOpt = (params.seed == null)? '': "--seed ${params.seed}"
debugOpt = (params.debug)? '--debug': ''
"""
smregions -m ${input} -e ${regions} \
-r ${params.datasets}/smregions/regions_pfam.tsv \
-s ${signature} --cores ${task.cpus} \
-c /smregions/smregions.conf \
-o ${output} ${seedOpt} ${debugOpt}
"""
}
OUT_SMREGIONS.into { OUT_SMREGIONS1; OUT_SMREGIONS2 }
process FormatCBaSE {
tag "Prepare for CBaSE ${cohort}"
label "core"
publishDir "${STEPS_FOLDER}/cbase", mode: "copy"
input:
tuple val(cohort), path(input) from PARSED_VEP2
output:
tuple val(cohort), path(output) into VARIANTS_CBASE
script:
output = "${cohort}.in.tsv"
"""
format-variants --input ${input} --output ${output} \
--format cbase
"""
}
process CBaSE {
tag "CBaSE ${cohort}"
publishDir "${STEPS_FOLDER}/cbase", mode: "copy"
input:
tuple val(cohort), path(input) from VARIANTS_CBASE
output:
tuple val(cohort), path(output) into OUT_CBASE
script:
output = "${cohort}.cbase.tsv.gz"
"""
mkdir -p Output/
python /cbase/cbase.py ${input} ${params.datasets}/cbase 0 output
tail -n+2 Output/q_values_output.txt | gzip > ${output}
"""
}
process FormatMutPanning {
tag "Prepare for MutPanning ${cohort}"
label "core"
publishDir "${STEPS_FOLDER}/mutpanning", mode: "copy"
input:
tuple val(cohort), path(input) from PARSED_VEP3
output:
tuple val(cohort), path(muts), path(samples) into VARIANTS_MUTPANNING
script:
muts = "${cohort}.in_muts.tsv"
samples = "${cohort}.in_samples.tsv"
"""
format-variants --input ${input} --output ${muts} \
--format mutpanning-mutations
format-variants --input ${input} --output ${samples} \
--format mutpanning-samples
"""
}
process MutPanning {
tag "MutPanning ${cohort}"
publishDir "${STEPS_FOLDER}/mutpanning", mode: "copy"
input:
tuple val(cohort), path(mutations), path(samples) from VARIANTS_MUTPANNING
output:
tuple val(cohort), path("out/SignificanceFiltered/Significance${cohort}.txt") into OUT_MUTPANNING
script:
// TODO remove the creation of the out file or move to the container
"""
mkdir -p out/SignificanceFiltered
echo "Name\tTargetSize\tTargetSizeSyn\tCount\tCountSyn\tSignificance\tFDR\n" \
> out/SignificanceFiltered/Significance${cohort}.txt
java -cp /mutpanning/MutPanning.jar MutPanning \
out ${mutations} ${samples} ${params.datasets}/mutpanning/Hg19/
"""
}
process FormatHotMAPS {
tag "Prepare for HotMAPS ${cohort}"
label "core"
publishDir "${STEPS_FOLDER}/hotmaps", mode: "copy"
input:
tuple val(cohort), path(input) from PARSED_VEP4
output:
tuple val(cohort), path(output) into VARIANTS_HOTMAPS
script:
output = "${cohort}.in.maf"
"""
format-variants --input ${input} --output ${output} \
--format hotmaps
"""
}
process HotMAPS {
tag "HotMAPS ${cohort}"
publishDir "${STEPS_FOLDER}/hotmaps", mode: "copy"
input:
tuple val(cohort), path(input), path(signatures) from VARIANTS_HOTMAPS.join(SIGNATURES4)
output:
tuple val(cohort), path("*.out.gz") into OUT_HOTMAPS
tuple val(cohort), path("*.clusters.gz") into OUT_HOTMAPS_CLUSTERS
script:
"""
/bin/sh /hotmaps/hotmaps.sh ${input} . ${signatures} \
${params.datasets}/hotmaps ${task.cpus}
"""
}
process Combination {
tag "Combination ${cohort}"
publishDir "${STEPS_FOLDER}/combination", mode: "copy"
input:
tuple val(cohort), path(fml), path(clustl), path(dndscv), path(smregions), path(cbase), path(mutpanning), path(hotmaps) from OUT_ONCODRIVEFML.join(OUT_ONCODRIVECLUSTL).join(OUT_DNDSCV1).join(OUT_SMREGIONS1).join(OUT_CBASE).join(OUT_MUTPANNING).join(OUT_HOTMAPS)
output:
tuple val(cohort), path("${cohort}.05.out.gz") into OUT_COMBINATION
script:
"""
intogen-combine -o ${cohort} \
--oncodrivefml ${fml} \
--oncodriveclustl ${clustl} \
--dndscv ${dndscv} \
--smregions ${smregions} \
--cbase ${cbase} \
--mutpanning ${mutpanning} \
--hotmaps ${hotmaps}
"""
}
process FormatdeconstructSigs {
tag "Prepare for deconstructSigs ${cohort}"
label "core"
publishDir "${STEPS_FOLDER}/deconstructSigs", mode: "copy"
input:
tuple val(cohort), path(input) from PARSED_VEP5
output:
tuple val(cohort), path(output) into VARIANTS_DECONSTRUCTSIGS
script:
output = "${cohort}.in.tsv.gz"
"""
format-variants --input ${input} --output ${output} \
--format deconstructsigs
"""
}
VARIANTS_DECONSTRUCTSIGS.into{ VARIANTS_DECONSTRUCTSIGS1; VARIANTS_DECONSTRUCTSIGS2 }
process deconstructSigs {
tag "deconstructSigs ${cohort}"
publishDir "${STEPS_FOLDER}/deconstructSigs", mode: "copy"
input:
tuple val(cohort), path(input) from VARIANTS_DECONSTRUCTSIGS1
output:
tuple val(cohort), path(output) into OUT_DECONSTRUCTSIGS
tuple val(cohort), path("*.signature_likelihood") into OUT_DECONSTRUCTSIGS_SIGLIKELIHOOD
script:
output = "${cohort}.deconstructsigs.tsv.gz"
likelihood = "${cohort}.signature_likelihood"
"""
python3 /deconstructsig/run_deconstruct.py \
--input-file ${input} --weights ${output} \
--build hg38
python3 /deconstructsig/signature_assignment.py \
--input-file ${output} \
--output-file ${likelihood}
"""
}
// TODO add a process to combine all stats
process CohortCounts {
tag "Count variants ${cohort}"
input:
tuple val(cohort), path(input), val(cancer), val(platform) from COHORTS5.join(CANCERS2).join(PLATFORMS3)
output:
tuple val(cohort), path("*.counts") into COHORT_COUNTS
script:
"""
variants=`zcat ${input} |tail -n+2 |wc -l`
samples=`zcat ${input} |tail -n+2 |cut -f1 |uniq |sort -u| wc -l`
echo "${cohort}\t${cancer}\t${platform}\t\$variants\t\$samples" > ${cohort}.counts
"""
}
COHORT_COUNTS.into{ COHORT_COUNTS1; COHORT_COUNTS2 }
COHORT_COUNTS_LIST = COHORT_COUNTS1.map{ it -> it[1] }
process CohortSummary {
tag "Count variants"
publishDir "${OUTPUT}", mode: "copy"
input:
path(input) from COHORT_COUNTS_LIST.collect()
output:
path(output) into COHORT_SUMMARY
script:
output="cohorts.tsv"
"""
echo 'COHORT\tCANCER_TYPE\tPLATFORM\tMUTATIONS\tSAMPLES' > ${output}
cat ${input} >> ${output}
"""
}
MUTATIONS_INPUTS = PARSED_VEP6.map { it -> it[1] }
process MutationsSummary {
tag "Mutations"
publishDir "${OUTPUT}", mode: "copy"
label "core"
input:
path(input) from MUTATIONS_INPUTS.collect()
output:
path(output) into MUTATIONS_SUMMARY
script:
output="mutations.tsv"
"""
mutations-summary --output ${output} \
${input}
"""
}
process DriverDiscovery {
tag "Driver discovery ${cohort}"
publishDir "${STEPS_FOLDER}/drivers", mode: "copy"
label "core"
input:
tuple val(cohort), path(combination), path(deconstruct_in), path(sig_likelihood), path(smregions), path(clustl_clusters), path(hotmaps_clusters), path(dndscv), val(cancer) from OUT_COMBINATION.join(VARIANTS_DECONSTRUCTSIGS2).join(OUT_DECONSTRUCTSIGS_SIGLIKELIHOOD).join(OUT_SMREGIONS2).join(OUT_ONCODRIVECLUSTL_CLUSTERS).join(OUT_HOTMAPS_CLUSTERS).join(OUT_DNDSCV2).join(CANCERS3)
output:
path(output_drivers) into DRIVERS
path(output_vet) into VET
script:
output_drivers = "${cohort}.drivers.tsv"
output_vet = "${cohort}.vet.tsv"
"""
drivers-discovery --output_drivers ${output_drivers} \
--output_vet ${output_vet} \
--combination ${combination} \
--mutations ${deconstruct_in} \
--sig_likelihood ${sig_likelihood} \
--smregions ${smregions} \
--clustl_clusters ${clustl_clusters} \
--hotmaps ${hotmaps_clusters} \
--dndscv ${dndscv} \
--ctype ${cancer} \
--cohort ${cohort}
"""
}
process DriverSummary {
tag "Driver summary"
publishDir "${OUTPUT}", mode: "copy"
label "core"
input:
path (input) from DRIVERS.collect()
path (input_vet) from VET.collect()
path (mutations) from MUTATIONS_SUMMARY
path (cohortsSummary) from COHORT_SUMMARY
output:
path("drivers.tsv") into DRIVERS_SUMMARY
path("unique_drivers.tsv") into UNIQUE_DRIVERS
path("unfiltered_drivers.tsv") into UNFILTER_DRIVERS
script:
"""
drivers-summary \
--mutations ${mutations} \
--cohorts ${cohortsSummary} \
${input} "${input_vet}"
"""
}
process ParseProfile {
tag "Parsing profile ${cohort}"
publishDir "${STEPS_FOLDER}/boostDM/mutrate", mode: "copy"
label "core"
input:
tuple val(cohort), path(signature) from SIGNATURES5
output:
tuple val(cohort), path("*.mutrate.json") into OUT_MUTRATE
script:
"""
parse-profile -i ${signature} -o ${cohort}
"""
}
process DriverSaturation {
tag "Driver saturation"
publishDir "${STEPS_FOLDER}/boostDM/saturation", mode: "copy"
label "core"
input:
path (drivers) from DRIVERS_SUMMARY
output:
path("*.vep.gz") into DRIVERS_SATURATION
script:
"""
drivers-saturation --drivers ${drivers}
"""
}
FILT_MNVS_INPUTS = PARSED_VEP7.map { it -> it[1] }
process FilterMNVS {
tag "MNVs filter"
publishDir "${STEPS_FOLDER}/boostDM", mode: "copy"
label "core"
input:
path(input) from FILT_MNVS_INPUTS.collect()
output:
path("mnvs.tsv.gz") into MNVS_FILTER
script:
"""
parse-mnvs ${input}
"""
}