-
Notifications
You must be signed in to change notification settings - Fork 0
/
inputs.nf
117 lines (103 loc) · 4.37 KB
/
inputs.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
// These two processes generate either county- or state-level data.
//
// Download repo `covidestim/covidestim-sources` and use its makefile to
// generate today's copy of either county-level or state-level data. Stage this
// data for splitting by `splitTractData`.
process combinedVaxData {
container 'covidestim/webworker:latest' // Name of singularity+docker container
// Retry once in case of HTTP errors, before giving up
errorStrategy 'retry'
maxRetries 1
time '50m'
// Currently unsure of exact memory needs. At least 300MB, but may differ
// substantially by cluster (Harvard seems to need more?).
memory '8 GB'
output:
path 'data.csv', emit: data
path 'rejects.csv', emit: rejects
path 'metadata.json', emit: metadata
// Clone the 'covidestim-sources' repository, and use it to generate
// the input data for the model
script:
if (params.inputUrl == false)
"""
git clone https://github.com/covidestim/covidestim-sources && \
cd covidestim-sources && \
git lfs checkout && \
git submodule init && \
git submodule update --recommend-shallow --depth 1 --remote && \
make -B data-products/case-death-rr-boost-hosp.csv \
data-products/jhu-counties-rejects.csv \
data-products/case-death-rr-boost-hosp-metadata.json && \
mv data-products/case-death-rr-boost-hosp.csv ../data.csv && \
mv data-products/case-death-rr-boost-hosp-metadata.json ../metadata.json && \
mv data-products/jhu-counties-rejects.csv ../rejects.csv
"""
else
"""
echo "Using inputs from url $params.inputUrl"
echo "Expecting .tar.gz archive with files data.csv, metadata.json, rejects.csv"
wget -O inputs.tar.gz "$params.inputUrl" && \
mkdir custom-inputs && \
tar -C custom-inputs -xzvf inputs.tar.gz && \
mv custom-inputs/{data.csv,metadata.json,rejects.csv} .
"""
stub:
"""
echo "Running stub method"
git clone https://github.com/covidestim/covidestim-sources && \
cd covidestim-sources && \
mv example-output/case-death-rr-boost-hosp.csv ../data.csv && \
mv example-output/case-death-rr-boost-hosp-metadata.json ../metadata.json && \
mv example-output/jhu-counties-rejects.csv ../rejects.csv
"""
}
process jhuStateVaxData {
container 'covidestim/webworker:latest' // Name of singularity+docker container
// Retry once in case of HTTP errors, before giving up
errorStrategy 'retry'
maxRetries 1
time '50m'
// Currently unsure of exact memory needs. At least 300MB, but may differ
// substantially be cluster.
memory '8 GB'
output:
path 'data.csv', emit: data
path 'rejects.csv', emit: rejects
path 'metadata.json', emit: metadata
// Clone the 'covidestim-sources' repository, and use it to generate
// the input data for the model
script:
if (params.inputUrl == false)
'''
git clone https://github.com/covidestim/covidestim-sources && \
cd covidestim-sources && \
git lfs checkout && \
git submodule init && \
git submodule update --recommend-shallow --depth 1 --remote && \
make -B data-products/case-death-rr-boost-hosp-state.csv \
data-products/jhu-states-rejects.csv \
data-products/case-death-rr-boost-hosp-state-metadata.json && \
mv data-products/case-death-rr-boost-hosp-state.csv ../data.csv && \
mv data-products/jhu-states-rejects.csv ../rejects.csv && \
mv data-products/case-death-rr-boost-hosp-state-metadata.json ../metadata.json
'''
else
"""
echo "Using inputs from url $params.inputUrl"
echo "Expecting .tar.gz archive with files data.csv, metadata.json, rejects.csv"
wget -O inputs.tar.gz "$params.inputUrl" && \
mkdir custom-inputs && \
tar -C custom-inputs -xzvf inputs.tar.gz && \
mv custom-inputs/{data.csv,metadata.json,rejects.csv} .
"""
stub:
"""
echo "Running stub method"
git clone --depth 1 https://github.com/covidestim/covidestim-sources && \
cd covidestim-sources && \
mv example-output/case-death-rr-boost-hosp-state.csv ../data.csv && \
mv example-output/case-death-rr-boost-hosp-state-metadata.json ../metadata.json && \
mv example-output/jhu-states-rejects.csv ../rejects.csv
"""
}