[e26484]: / OmicsFold / nextflow_pipeline / multiomics_nextflow.nf.groovy

Download this file

92 lines (69 with data), 1.8 kB

 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
#!/usr/bin/env nextflow_multiomics
nextflow.enable.dsl=2
//nextflow script to run OmicsFold multi-omics integration pipeline
//tuning #1: tune optimal number of components
process findncomp {
//use OmicsFold conda environment
conda "~/.conda/envs/OmicsFold"
//set output directory
publishDir "omicsfold_output"
input:
path data
path data_labels
output:
path data
path data_labels
path "1_find_ncomp_output.txt"
path "1_find_ncomp_plots.pdf"
path "1_find_ncomp_perf_result.rds"
"""
Rscript 1_find_ncomp.R $data $data_labels
"""
}
//tuning #2: tune optimal number of features per component
process findkeepX {
//use OmicsFold conda environment
conda "~/.conda/envs/OmicsFold"
//set output directory
publishDir "omicsfold_output"
input:
path data
path data_labels
path perf_untrained
output:
path data
path data_labels
path "2_find_keepX_output.txt"
path "2_find_keepX_plots.pdf"
path "2_find_keepX_tune_result.rds"
"""
Rscript 2_find_keepx.R $data $data_labels $perf_untrained
"""
}
//final performance check
process perf_check {
//use OmicsFold conda environment
conda "~/.conda/envs/OmicsFold"
//set output directory
publishDir "omicsfold_output"
input:
path data
path data_labels
path tune_diablo
output:
path "3_loadings_stability_all.csv"
path "3_perf_check_output.txt"
path "3_perf_check_plots.pdf"
path "3_perf_result_object.rds"
path "3_trained_model_object.rds"
path "3_blockrank.pdf"
"""
Rscript 3_perf_check.R $data $data_labels $tune_diablo
"""
}
//define workflow
workflow {
findncomp(params.data, params.data_labels)
findkeepX(findncomp.out[0], findncomp.out[1], findncomp.out[4])
perf_check(findkeepX.out[0], findkeepX.out[1], findkeepX.out[4])
}