-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyfile.nf
72 lines (62 loc) · 1.41 KB
/
myfile.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
// Define the process for simulation and association
process simulateAssoc {
memory '4 GB'
cpus 1
script:
"""
./plink --simulate sim${params.i} --make-bed --out sim${params.i} --simulate-ncases 500 --simulate-ncontrols 500 --noweb
./plink --bfile sim${params.i} --assoc --out sim${params.i} --noweb
awk '{print \$2,\$4,\$10}' sim${params.i}.assoc > prs${params.i}
"""
}
// Define the process for PRS processing in R
process processPRS {
memory '4 GB'
cpus 1
script:
"""
Rscript log_trans.r
"""
}
// Define the process for generating weights
process generateWeights {
memory '4 GB'
cpus 1
script:
"""
Rscript prs_svm_rf_dl.r
"""
}
// Define the process for training models and extracting features
process trainModelAndExtractFeatures {
memory '16 GB'
cpus 4
script:
"""
python weights.py
"""
}
// Define the process for combining PRS data
process combinePRS {
memory '4 GB'
cpus 1
script:
"""
Rscript combine_prs.r
"""
}
// Define the workflow
workflow {
// Define the range of simulation
simulations = [1..n]
// Simulate and associate
simulateAssoc(simulationIndex) from simulations
// Process PRS in R
processPRS()
// Generate weights
generateWeights()
// Train models and extract features
trainModelAndExtractFeatures()
// Combine PRS data
combinePRS()
}