-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaqs.cwl
More file actions
170 lines (158 loc) · 4.13 KB
/
aqs.cwl
File metadata and controls
170 lines (158 loc) · 4.13 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
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
#!/usr/bin/env cwl-runner
### Full Medicaid Processing Pipeline
# Copyright (c) 2021. Harvard University
#
# Developed by Research Software Engineering,
# Faculty of Arts and Sciences, Research Computing (FAS RC)
# Author: Michael A Bouzinier
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
cwlVersion: v1.2
class: Workflow
requirements:
SubworkflowFeatureRequirement: {}
StepInputExpressionRequirement: {}
InlineJavascriptRequirement: {}
ScatterFeatureRequirement: {}
doc: |
This workflow downloads AQS data from the government
servers, introspects it to infer the database schema
and ingests the data into the database
inputs:
proxy:
type: string?
default: ""
doc: HTTP/HTTPS Proxy if required
database:
type: File
doc: Path to database connection file, usually database.ini
connection_name:
type: string
doc: The name of the section in the database.ini file
aggregation:
type: string
parameter_code:
type: string
doc: |
Parameter code. Either a numeric code (e.g. 88101, 44201)
or symbolic name (e.g. PM25, NO2).
See more: [AQS Code List](https://www.epa.gov/aqs/aqs-code-list)
table:
doc: Name of the table to be created in the database
type: string
years:
type: string[]
doc: Years to download
steps:
states:
run: ensure_resource.cwl
doc: |
Ensures the presence of `us_states` table in the database.
The table contains mapping between state names, ids
(two letter abbreviations), FIPS codes and
[ISO-3166-2 codes](https://en.wikipedia.org/wiki/ISO_3166-2)
in:
database: database
connection_name: connection_name
table:
valueFrom: "us_states"
out: [log]
iso:
run: ensure_resource.cwl
doc: |
Ensures the presence of `us_iso` table in the database.
The table provides a mapping between states, counties and zip
codes. It contains FIPS and
[ISO-3166-2 codes](https://en.wikipedia.org/wiki/ISO_3166-2)
in:
database: database
connection_name: connection_name
table:
valueFrom: "us_iso"
out: [log]
download:
run: download_aqs.cwl
scatter: year
in:
year: years
aggregation: aggregation
parameter_code: parameter_code
out: [data]
expand:
run: expand_aqs.cwl
in:
parameter_code: parameter_code
input: download/data
out: [log, data]
introspect:
run: introspect.cwl
in:
depends_on: expand/log
input: expand/data
table: table
output:
valueFrom: epa.yaml
out: [log, model, errors]
ingest:
run: ingest.cwl
doc: Uploads data into the database
in:
registry: introspect/model
table: table
input: expand/data
database: database
connection_name: connection_name
out: [log, errors]
index:
run: index.cwl
in:
depends_on: ingest/log
registry: introspect/model
domain:
valueFrom: "epa"
table: table
database: database
connection_name: connection_name
out: [log]
outputs:
resource1_log:
type: File
outputSource: states/log
resource2_log:
type: File
outputSource: iso/log
expand_log:
type: File
outputSource: expand/log
introspect_log:
type: File
outputSource: introspect/log
ingest_log:
type: File
outputSource: ingest/log
index_log:
type: File
outputSource: index/log
data:
type: File
outputSource: expand/data
model:
type: File
outputSource: introspect/model
introspect_err:
type: File
outputSource: introspect/errors
ingest_err:
type: File
outputSource: ingest/errors