Switch to unified view

a b/source/GenomicsAnalysisCode/quicksight_cfn.yml
1
AWSTemplateFormatVersion: '2010-09-09'
2
Description: Creates a QuickSight dashboard for browsing omics data
3
4
Parameters:
5
  Project:
6
    Type: String
7
    
8
  QuicksightServiceRoleName:
9
    Type: String
10
    Default: aws-quicksight-service-role-v0
11
    
12
  QuicksightUserId:
13
    Type: String
14
15
16
Resources:
17
  QuicksightAccessPolicy:
18
    Type: AWS::IAM::Policy
19
    Properties:
20
      Roles:
21
        - !Ref QuicksightServiceRoleName
22
      PolicyName: !Sub "${Project}-access"
23
      PolicyDocument:
24
        Version: 2012-10-17
25
        Statement:
26
          - Effect: Allow
27
            Action:
28
              - s3:ListBucket
29
              - s3:GetBucketLocation
30
              - s3:ListBucketMultipartUploads
31
            Resource: !Sub
32
              - "arn:aws:s3:::${DataLakeBucket}"
33
              - DataLakeBucket: !ImportValue
34
                  Fn::Sub: '${Project}-DataLakeBucket'
35
          - Effect: Allow
36
            Action:
37
              - s3:GetObject
38
              - s3:GetObjectVersion
39
              - s3:AbortMultipartUpload
40
              - s3:ListMultipartUploadParts
41
            Resource: !Sub
42
              - "arn:aws:s3:::${DataLakeBucket}/*"
43
              - DataLakeBucket: !ImportValue
44
                  Fn::Sub: '${Project}-DataLakeBucket'
45
          - Effect: Allow
46
            Action: s3:PutObject
47
            Resource: !Sub
48
              - "arn:aws:s3:::${DataLakeBucket}/results/*"
49
              - DataLakeBucket: !ImportValue
50
                  Fn::Sub: '${Project}-DataLakeBucket'
51
          - Effect: Allow
52
            Action:
53
              - kms:GenerateDataKey
54
              - kms:Decrypt
55
              - kms:Encrypt
56
            Resource:
57
              - !ImportValue
58
                  Fn::Sub: '${Project}-DataCatalogEncryptionKeyArn'
59
  
60
  DataSource:
61
    Type: AWS::QuickSight::DataSource
62
    DependsOn: QuicksightAccessPolicy
63
    Properties:
64
      DataSourceId: !Sub "${Project}-DataSource"
65
      Name: !Sub "${Project}-Data"
66
      AwsAccountId: !Ref AWS::AccountId
67
      Type: ATHENA
68
      DataSourceParameters:
69
        AthenaParameters:
70
          WorkGroup:
71
            !Join
72
              - '-'
73
              - - !ImportValue
74
                    Fn::Sub: '${Project}-ResourcePrefixLowercase'
75
                - !Ref "AWS::Region"
76
          
77
78
  DataSet:
79
    Type: AWS::QuickSight::DataSet
80
    Properties:
81
      DataSetId: !Sub "${Project}-DataSet"
82
      Name: !Ref Project
83
      AwsAccountId: !Ref AWS::AccountId
84
      ImportMode: SPICE
85
      PhysicalTableMap:
86
        PhysicalTable1:
87
          RelationalTable:
88
            DataSourceArn: !GetAtt DataSource.Arn
89
            Schema: !ImportValue
90
              Fn::Sub: '${Project}-ResourcePrefixLowercase'
91
            Name: clinical_patient
92
            InputColumns:
93
              - Name: bcr_patient_uuid
94
                Type: STRING
95
              - Name: bcr_patient_barcode
96
                Type: STRING
97
              - Name: form_completion_date
98
                Type: STRING
99
              - Name: histologic_diagnosis3
100
                Type: STRING
101
              - Name: race
102
                Type: STRING
103
              - Name: ethnicity
104
                Type: STRING
105
              - Name: location_lung_parenchyma
106
                Type: STRING
107
              - Name: height_cm_at_diagnosis
108
                Type: STRING
109
              - Name: prospective_collection
110
                Type: STRING
111
              - Name: weight_kg_at_diagnosis
112
                Type: STRING
113
              - Name: retrospective_collection
114
                Type: STRING
115
              - Name: gender
116
                Type: STRING
117
              - Name: birth_days_to
118
                Type: STRING
119
              - Name: history_other_malignancy
120
                Type: STRING
121
              - Name: history_neoadjuvant_treatment
122
                Type: STRING
123
              - Name: cause_of_death
124
                Type: STRING
125
              - Name: cause_of_death_other
126
                Type: STRING
127
              - Name: residual_tumor
128
                Type: STRING
129
              - Name: tumor_status
130
                Type: STRING
131
              - Name: ajcc_staging_edition
132
                Type: STRING
133
              - Name: ecog_score
134
                Type: STRING
135
              - Name: ajcc_nodes_pathologic_pn
136
                Type: STRING
137
              - Name: karnofsky_score
138
                Type: STRING
139
              - Name: ajcc_metastasis_pathologic_pm
140
                Type: STRING
141
              - Name: radiation_treatment_adjuvant
142
                Type: STRING
143
              - Name: vital_status
144
                Type: STRING
145
              - Name: pharmaceutical_tx_adjuvant
146
                Type: STRING
147
              - Name: tobacco_smoking_history_indicator
148
                Type: STRING
149
              - Name: tobacco_smoking_age_started
150
                Type: STRING
151
              - Name: last_contact_days_to
152
                Type: STRING
153
              - Name: tobacco_smoking_pack_years_smoked
154
                Type: STRING
155
              - Name: hiv_status
156
                Type: STRING
157
              - Name: death_days_to
158
                Type: STRING
159
              - Name: nadir_cd4_counts
160
                Type: STRING
161
              - Name: cd4_counts_at_diagnosis
162
                Type: STRING
163
              - Name: pulmonary_function_test_indicator
164
                Type: STRING
165
              - Name: hiv_rna_load_at_diagnosis
166
                Type: STRING
167
              - Name: fev1_percent_ref_prebroncholiator
168
                Type: STRING
169
              - Name: prior_aids_conditions
170
                Type: STRING
171
              - Name: fev1_percent_ref_postbroncholiator
172
                Type: STRING
173
              - Name: hbv_test_results
174
                Type: STRING
175
              - Name: fev1_fvc_ratio_prebroncholiator
176
                Type: STRING
177
              - Name: hcv_test_results
178
                Type: STRING
179
              - Name: fev1_fvc_ratio_postbroncholiator
180
                Type: STRING
181
              - Name: hpv_test_results
182
                Type: STRING
183
              - Name: carbon_monoxide_diffusion_dlco
184
                Type: STRING
185
              - Name: kshv_hhv8_test_results
186
                Type: STRING
187
              - Name: kras_gene_analysis_indicator
188
                Type: STRING
189
              - Name: haart_therapy_prior_to_dx
190
                Type: STRING
191
              - Name: kras_mutation_found
192
                Type: STRING
193
              - Name: haart_therapy_at_dx
194
                Type: STRING
195
              - Name: kras_mutation_identified_type
196
                Type: STRING
197
              - Name: cdc_hiv_risk_group
198
                Type: STRING
199
              - Name: egfr_mutation_status
200
                Type: STRING
201
              - Name: egfr_mutation_identified_type
202
                Type: STRING
203
              - Name: prior_mailgnancy_type
204
                Type: STRING
205
              - Name: eml4_alk_translocation_status
206
                Type: STRING
207
              - Name: history_immunological_disease
208
                Type: STRING
209
              - Name: eml4_alk_translocation_variant
210
                Type: STRING
211
              - Name: history_immunological_disease_other
212
                Type: STRING
213
              - Name: eml4_alk_analysis_type
214
                Type: STRING
215
              - Name: history_immunosuppresive_rx
216
                Type: STRING
217
              - Name: history_immunosuppressive_rx_other
218
                Type: STRING
219
              - Name: tobacco_smoking_year_started
220
                Type: STRING
221
              - Name: history_relevant_infectious_dx
222
                Type: STRING
223
              - Name: tobacco_smoking_year_stopped
224
                Type: STRING
225
              - Name: history_immunosuppresive_dx_other
226
                Type: STRING
227
              - Name: histologic_diagnosis67
228
                Type: STRING
229
              - Name: submitted_tumor_site
230
                Type: STRING
231
              - Name: performance_status_timing
232
                Type: STRING
233
              - Name: laterality
234
                Type: STRING
235
              - Name: anatomic_organ_subdivision
236
                Type: STRING
237
              - Name: site_of_primary_tumor_other
238
                Type: STRING
239
              - Name: treatment_outcome_first_course
240
                Type: STRING
241
              - Name: new_tumor_event_dx_indicator
242
                Type: STRING
243
              - Name: initial_pathologic_dx_year
244
                Type: STRING
245
              - Name: method_initial_path_dx
246
                Type: STRING
247
              - Name: method_initial_path_dx_other
248
                Type: STRING
249
              - Name: lymph_nodes_examined
250
                Type: STRING
251
              - Name: lymph_nodes_examined_count
252
                Type: STRING
253
              - Name: lymph_nodes_examined_he_count
254
                Type: STRING
255
              - Name: lymph_nodes_examined_ihc_count
256
                Type: STRING
257
              - Name: pos_lymph_node_location
258
                Type: STRING
259
              - Name: other_pos_node_location
260
                Type: STRING
261
              - Name: ajcc_tumor_clinical_ct
262
                Type: STRING
263
              - Name: ajcc_tumor_pathologic_pt
264
                Type: STRING
265
              - Name: ajcc_nodes_clinical_cn
266
                Type: STRING
267
              - Name: ajcc_metastasis_clinical_cm
268
                Type: STRING
269
              - Name: ajcc_clinical_tumor_stage
270
                Type: STRING
271
              - Name: ajcc_pathologic_tumor_stage
272
                Type: STRING
273
              - Name: followup_lost_to
274
                Type: STRING
275
              - Name: age_at_initial_pathologic_diagnosis
276
                Type: STRING
277
              - Name: cancer_diagnosis_cancer_type_icd9_text_name
278
                Type: STRING
279
              - Name: days_to_form_completion
280
                Type: STRING
281
              - Name: days_to_hiv_diagnosis
282
                Type: STRING
283
              - Name: days_to_initial_pathologic_diagnosis
284
                Type: STRING
285
              - Name: days_to_patient_progression_free
286
                Type: STRING
287
              - Name: days_to_sample_procurement
288
                Type: STRING
289
              - Name: days_to_tumor_progression
290
                Type: STRING
291
              - Name: disease_code
292
                Type: STRING
293
              - Name: egfr_mutation_identified
294
                Type: STRING
295
              - Name: eml4_alk_translocation_identified
296
                Type: STRING
297
              - Name: extranodal_involvement
298
                Type: STRING
299
              - Name: family_member_relationship_type
300
                Type: STRING
301
              - Name: icd_10
302
                Type: STRING
303
              - Name: icd_o_3_histology
304
                Type: STRING
305
              - Name: icd_o_3_site
306
                Type: STRING
307
              - Name: informed_consent_verified
308
                Type: STRING
309
              - Name: margin_status
310
                Type: STRING
311
              - Name: measure_of_response
312
                Type: STRING
313
              - Name: metastatic_site_at_diagnosis
314
                Type: STRING
315
              - Name: metastatic_site_at_diagnosis_other
316
                Type: STRING
317
              - Name: number_cycles
318
                Type: STRING
319
              - Name: patient_id
320
                Type: STRING
321
              - Name: pharm_regimen
322
                Type: STRING
323
              - Name: pharm_regimen_other
324
                Type: STRING
325
              - Name: prior_systemic_therapy_type
326
                Type: STRING
327
              - Name: project_code
328
                Type: STRING
329
              - Name: regimen_indication
330
                Type: STRING
331
              - Name: relative_family_cancer_history
332
                Type: STRING
333
              - Name: stage_other
334
                Type: STRING
335
              - Name: stem_cell_transplantation
336
                Type: STRING
337
              - Name: tissue_source_site
338
                Type: STRING
339
              - Name: histologic_diagnosis5
340
                Type: STRING
341
              - Name: histologic_diagnosis18
342
                Type: STRING
343
              - Name: age_began_smoking_in_years
344
                Type: STRING
345
              - Name: anatomic_neoplasm_subdivision_other
346
                Type: STRING
347
              - Name: death_cause_text
348
                Type: STRING
349
              - Name: hbv_test
350
                Type: STRING
351
              - Name: hcv_test
352
                Type: STRING
353
              - Name: height
354
                Type: STRING
355
              - Name: history_of_other_malignancy
356
                Type: STRING
357
              - Name: history_relevant_infectious_dx_other
358
                Type: STRING
359
              - Name: hpv_test
360
                Type: STRING
361
              - Name: kshv_hhv8_test
362
                Type: STRING
363
              - Name: lost_follow_up
364
                Type: STRING
365
              - Name: lymph_node_examined_count
366
                Type: STRING
367
              - Name: number_of_lymphnodes_positive_by_he
368
                Type: STRING
369
              - Name: number_of_lymphnodes_positive_by_ihc
370
                Type: STRING
371
              - Name: on_haart_therapy_at_cancer_diagnosis
372
                Type: STRING
373
              - Name: on_haart_therapy_prior_to_cancer_diagnosis
374
                Type: STRING
375
              - Name: patient_death_reason
376
                Type: STRING
377
              - Name: pos_lymph_node_location_other
378
                Type: STRING
379
              - Name: primary_lymph_node_presentation_assessment
380
                Type: STRING
381
              - Name: tumor_tissue_site
382
                Type: STRING
383
              - Name: weight
384
                Type: STRING
385
              - Name: partition_0
386
                Type: STRING
387
        PhysicalTable2:
388
          RelationalTable:
389
            DataSourceArn: !GetAtt DataSource.Arn
390
            Schema: !ImportValue
391
              Fn::Sub: '${Project}-ResourcePrefixLowercase'
392
            Name: tcga_summary
393
            InputColumns:
394
              - Name: patient_id
395
                Type: STRING
396
              - Name: num_images
397
                Type: DECIMAL
398
              - Name: num_image_series
399
                Type: DECIMAL
400
              - Name: num_mutation_records
401
                Type: DECIMAL
402
              - Name: num_expression_records
403
                Type: DECIMAL
404
              - Name: num_cnv_records
405
                Type: DECIMAL
406
              - Name: num_clin_drug_records
407
                Type: DECIMAL
408
              - Name: num_clin_rad_records
409
                Type: DECIMAL
410
              - Name: num_clin_fol_records
411
                Type: DECIMAL
412
              - Name: num_clin_omf_records
413
                Type: DECIMAL
414
              - Name: num_clin_nte_records
415
                Type: DECIMAL
416
      LogicalTableMap:
417
        LogicalTable1:
418
          Alias: clinical_patient
419
          DataTransforms:
420
            - RenameColumnOperation:
421
                ColumnName: patient_id
422
                NewColumnName: patient_id[clinical_patient]
423
            - RenameColumnOperation:
424
                ColumnName: partition_0
425
                NewColumnName: study_name
426
          Source:
427
            PhysicalTableId: PhysicalTable1
428
        LogicalTable2:
429
          Alias: tcga_summary
430
          DataTransforms:
431
            - CastColumnTypeOperation:
432
                ColumnName: num_images
433
                NewColumnType: INTEGER
434
            - CastColumnTypeOperation:
435
                ColumnName: num_image_series
436
                NewColumnType: INTEGER
437
            - CastColumnTypeOperation:
438
                ColumnName: num_mutation_records
439
                NewColumnType: INTEGER
440
            - CastColumnTypeOperation:
441
                ColumnName: num_expression_records
442
                NewColumnType: INTEGER
443
            - CastColumnTypeOperation:
444
                ColumnName: num_cnv_records
445
                NewColumnType: INTEGER
446
            - CastColumnTypeOperation:
447
                ColumnName: num_clin_drug_records
448
                NewColumnType: INTEGER
449
            - CastColumnTypeOperation:
450
                ColumnName: num_clin_rad_records
451
                NewColumnType: INTEGER
452
            - CastColumnTypeOperation:
453
                ColumnName: num_clin_fol_records
454
                NewColumnType: INTEGER
455
            - CastColumnTypeOperation:
456
                ColumnName: num_clin_omf_records
457
                NewColumnType: INTEGER
458
            - CastColumnTypeOperation:
459
                ColumnName: num_clin_nte_records
460
                NewColumnType: INTEGER
461
          Source:
462
            PhysicalTableId: PhysicalTable2
463
        LogicalTable3:
464
          Alias: Intermediate Table
465
          DataTransforms:
466
            - CreateColumnsOperation:
467
                Columns:
468
                  - ColumnName: age_at_dx_string
469
                    ColumnId: 93b9c54c-ddec-471f-b113-32faf869f61c
470
                    Expression: "ifelse(locate({age_at_initial_pathologic_diagnosis},\"[\") = 0,{age_at_initial_pathologic_diagnosis},\"0\")"
471
            - CreateColumnsOperation:
472
                Columns:
473
                  - ColumnName: age_at_dx_numeric
474
                    ColumnId: b38d8b30-d2dd-4c94-9d27-39e5f9fde4dc
475
                    Expression: "parseInt({age_at_dx_string})"
476
            - ProjectOperation:
477
                ProjectedColumns:
478
                  - bcr_patient_barcode
479
                  - form_completion_date
480
                  - race
481
                  - ethnicity
482
                  - location_lung_parenchyma
483
                  - prospective_collection
484
                  - retrospective_collection
485
                  - gender
486
                  - birth_days_to
487
                  - history_other_malignancy
488
                  - history_neoadjuvant_treatment
489
                  - residual_tumor
490
                  - tumor_status
491
                  - ajcc_staging_edition
492
                  - ecog_score
493
                  - ajcc_nodes_pathologic_pn
494
                  - karnofsky_score
495
                  - ajcc_metastasis_pathologic_pm
496
                  - radiation_treatment_adjuvant
497
                  - vital_status
498
                  - pharmaceutical_tx_adjuvant
499
                  - tobacco_smoking_history_indicator
500
                  - last_contact_days_to
501
                  - tobacco_smoking_pack_years_smoked
502
                  - death_days_to
503
                  - pulmonary_function_test_indicator
504
                  - fev1_percent_ref_prebroncholiator
505
                  - fev1_percent_ref_postbroncholiator
506
                  - fev1_fvc_ratio_prebroncholiator
507
                  - fev1_fvc_ratio_postbroncholiator
508
                  - carbon_monoxide_diffusion_dlco
509
                  - kras_gene_analysis_indicator
510
                  - kras_mutation_found
511
                  - kras_mutation_identified_type
512
                  - egfr_mutation_status
513
                  - egfr_mutation_identified_type
514
                  - eml4_alk_translocation_status
515
                  - eml4_alk_analysis_type
516
                  - tobacco_smoking_year_started
517
                  - tobacco_smoking_year_stopped
518
                  - histologic_diagnosis67
519
                  - performance_status_timing
520
                  - anatomic_organ_subdivision
521
                  - site_of_primary_tumor_other
522
                  - treatment_outcome_first_course
523
                  - new_tumor_event_dx_indicator
524
                  - initial_pathologic_dx_year
525
                  - ajcc_tumor_pathologic_pt
526
                  - ajcc_pathologic_tumor_stage
527
                  - age_at_initial_pathologic_diagnosis
528
                  - disease_code
529
                  - icd_10
530
                  - icd_o_3_histology
531
                  - icd_o_3_site
532
                  - patient_id[clinical_patient]
533
                  - tissue_source_site
534
                  - histologic_diagnosis18
535
                  - anatomic_neoplasm_subdivision_other
536
                  - study_name
537
                  - num_images
538
                  - num_image_series
539
                  - num_mutation_records
540
                  - num_expression_records
541
                  - num_cnv_records
542
                  - num_clin_drug_records
543
                  - num_clin_rad_records
544
                  - num_clin_fol_records
545
                  - num_clin_omf_records
546
                  - num_clin_nte_records
547
                  - age_at_dx_numeric
548
                  - age_at_dx_string
549
          Source:
550
            JoinInstruction:
551
              LeftOperand: LogicalTable1
552
              RightOperand: LogicalTable2
553
              Type: LEFT
554
              OnClause: "{bcr_patient_barcode} = {patient_id}"
555
      Permissions:
556
        - Principal: !Sub "arn:aws:quicksight:${AWS::Region}:${AWS::AccountId}:user/default/${QuicksightUserId}"
557
          Actions:
558
            - quicksight:UpdateDataSetPermissions
559
            - quicksight:DescribeDataSet
560
            - quicksight:DescribeDataSetPermissions
561
            - quicksight:PassDataSet
562
            - quicksight:DescribeIngestion
563
            - quicksight:ListIngestions
564
            - quicksight:UpdateDataSet
565
            - quicksight:DeleteDataSet
566
            - quicksight:CreateIngestion
567
            - quicksight:CancelIngestion