Skip to content

Job request: 14960

Organisation:
DataLab
Workspace:
covid-vaccine-effectiveness-sequential-vs-single-main
ID:
2zl5nwqxcpesdzay

This page shows the technical details of what happened when authorised researcher Elsie Horne requested one or more actions to be run against real patient data in the project, within a secure environment.

By cross-referencing the indicated Requested Actions with the Pipeline section below, you can infer what security level various outputs were written to. Outputs marked as highly_sensitive can never be viewed directly by a researcher; they can only request that code runs against them. Outputs marked as moderately_sensitive can be viewed by an approved researcher by logging into a highly secure environment. Only outputs marked as moderately_sensitive can be requested for release to the public, via a controlled output review service.

Jobs

  • Action:
    process_single
    Status:
    Status: Succeeded
    Job identifier:
    h3ncgrevsva2pcna

Pipeline

Show project.yaml
version: '3.0'

expectations:

  population_size: 100000

actions:

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## DO NOT EDIT project.yaml DIRECTLY 
  ## This file is created by create-project.R 
  ## Edit and run create-project.R to update the project.yaml 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ##   
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## PRELIIMINARIES 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ##  
  ## `design` defines study metadata: 

  design:
    run: r:latest analysis/design.R
    outputs:
      moderately_sensitive:
        lib: lib/design/study-dates.json

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## SEQUENTIAL TRIAL APPROACH 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ##  
  ## `extract_treated` extracts data from individuals who received a 
  ## vaccine dose during the study recruitment period: 

  extract_treated:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_treated
      --output-file output/sequential/treated/extract/input_treated.feather
    needs:
    - design
    - process_single
    outputs:
      highly_sensitive:
        extract: output/sequential/treated/extract/input_treated.feather

  ## `process_treated` processes data and apply eligibility criteria: 

  process_treated:
    run: r:latest analysis/process/process_data.R treated
    needs:
    - extract_treated
    outputs:
      highly_sensitive:
        eligible: output/sequential/treated/eligible/*.rds
        pfizer: output/sequential/pfizer/treated/*.rds
        az: output/sequential/az/treated/*.rds
      moderately_sensitive:
        eligiblecsv: output/sequential/treated/eligible/*.csv
        input_treated_skim: output/sequential/treated/extract/*.txt
        data_processed_skim: output/sequential/treated/process/*.txt
        data_eligible_skim: output/sequential/treated/eligible/*.txt

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Extract control data, match and model for the pfizer trials 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ##  
  ## Due to constraints in the way that data are extracted using the 
  ## opensafely cohort extractor (i.e. one-row-per-patient), we 
  ## conduct the matching over 4 rounds. Each round (denoted  
  ## {matching_round}) implements the following actions: 
  ##  
  ## - `extract_controlpotential_pfizer_{matching_round}` extracts data 
  ##   from individuals who are potential controls for matching in  
  ##   matching round {matching_round} 
  ##  
  ## - `process_controlpotential_pfizer_{matching_round}` processes the 
  ##   extracted data and applies the eligibility criteria 
  ##  
  ## - `match_potential_pfizer_{matching_round}` matches the potential 
  ##   controls the the treated individuals 
  ##  
  ## - `extract_controlactual_pfizer_{matching_round}` re-extracts data 
  ##   from the individuals who were matched as controls in 
  ##   `match_potential_pfizer_{matching_round}`, with data re-defined 
  ##   on `trial_date` (the start date fo the sequential trial to which 
  ##   they were assigned) 
  ##  
  ## - `process_controlactual_pfizer_{matching_round}` processes the 
  ##   data extracted in `extract_controlactual_pfizer_{matching_round}` 
  ##   and checks that the matches made in 
  ##   `match_potential_pfizer_{matching_round}` still match bases on 
  ##   the re-extracted data 
  ##  
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ##  
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Matching round 1: 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  extract_controlpotential_pfizer_1:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlpotential
      --output-file output/sequential/pfizer/matchround1/extract/input_controlpotential.feather
      --param brand=pfizer --param matching_round=1 --param index_date=2020-12-08
    needs:
    - design
    outputs:
      highly_sensitive:
        cohort: output/sequential/pfizer/matchround1/extract/input_controlpotential.feather

  process_controlpotential_pfizer_1:
    run: r:latest analysis/process/process_data.R potential pfizer 1
    needs:
    - extract_controlpotential_pfizer_1
    outputs:
      highly_sensitive:
        rds: output/sequential/pfizer/matchround1/process/*.rds
        csv: output/sequential/pfizer/matchround1/process/*.csv.gz
      moderately_sensitive:
        input_controlpotential_skim: output/sequential/pfizer/matchround1/extract/potential/*.txt
        data_processed_skim: output/sequential/pfizer/matchround1/potential/*.txt
        data_controlpotential_skim: output/sequential/pfizer/matchround1/process/*.txt

  match_potential_pfizer_1:
    run: r:latest analysis/sequential/matching/match_potential.R pfizer 1
    needs:
    - process_treated
    - process_controlpotential_pfizer_1
    outputs:
      highly_sensitive:
        rds: output/sequential/pfizer/matchround1/potential/*.rds
        csv: output/sequential/pfizer/matchround1/potential/*.csv.gz

  extract_controlactual_pfizer_1:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlactual
      --output-file output/sequential/pfizer/matchround1/extract/input_controlactual.feather
      --param brand=pfizer --param matching_round=1
    needs:
    - design
    - match_potential_pfizer_1
    outputs:
      highly_sensitive:
        cohort: output/sequential/pfizer/matchround1/extract/input_controlactual.feather

  process_controlactual_pfizer_1:
    run: r:latest analysis/process/process_data.R actual pfizer 1
    needs:
    - process_treated
    - match_potential_pfizer_1
    - extract_controlpotential_pfizer_1
    - process_controlpotential_pfizer_1
    - extract_controlactual_pfizer_1
    outputs:
      highly_sensitive:
        rds: output/sequential/pfizer/matchround1/actual/*.rds
        csv: output/sequential/pfizer/matchround1/actual/*.csv.gz
      moderately_sensitive:
        input_controlactual_skim: output/sequential/pfizer/matchround1/extract/actual/*.txt
        data_actual_skim: output/sequential/pfizer/matchround1/actual/*.txt

  ##  
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Matching round 2: 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  extract_controlpotential_pfizer_2:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlpotential
      --output-file output/sequential/pfizer/matchround2/extract/input_controlpotential.feather
      --param brand=pfizer --param matching_round=2 --param index_date=2020-12-22
    needs:
    - design
    - process_single
    - process_controlactual_pfizer_1
    outputs:
      highly_sensitive:
        cohort: output/sequential/pfizer/matchround2/extract/input_controlpotential.feather

  process_controlpotential_pfizer_2:
    run: r:latest analysis/process/process_data.R potential pfizer 2
    needs:
    - extract_controlpotential_pfizer_2
    outputs:
      highly_sensitive:
        rds: output/sequential/pfizer/matchround2/process/*.rds
      moderately_sensitive:
        input_controlpotential_skim: output/sequential/pfizer/matchround2/extract/potential/*.txt
        data_processed_skim: output/sequential/pfizer/matchround2/potential/*.txt
        data_controlpotential_skim: output/sequential/pfizer/matchround2/process/*.txt

  match_potential_pfizer_2:
    run: r:latest analysis/sequential/matching/match_potential.R pfizer 2
    needs:
    - process_treated
    - process_controlpotential_pfizer_2
    - process_controlactual_pfizer_1
    outputs:
      highly_sensitive:
        rds: output/sequential/pfizer/matchround2/potential/*.rds
        csv: output/sequential/pfizer/matchround2/potential/*.csv.gz

  extract_controlactual_pfizer_2:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlactual
      --output-file output/sequential/pfizer/matchround2/extract/input_controlactual.feather
      --param brand=pfizer --param matching_round=2
    needs:
    - design
    - match_potential_pfizer_2
    outputs:
      highly_sensitive:
        cohort: output/sequential/pfizer/matchround2/extract/input_controlactual.feather

  process_controlactual_pfizer_2:
    run: r:latest analysis/process/process_data.R actual pfizer 2
    needs:
    - process_treated
    - match_potential_pfizer_2
    - extract_controlpotential_pfizer_2
    - process_controlpotential_pfizer_2
    - extract_controlactual_pfizer_2
    - process_controlactual_pfizer_1
    outputs:
      highly_sensitive:
        rds: output/sequential/pfizer/matchround2/actual/*.rds
        csv: output/sequential/pfizer/matchround2/actual/*.csv.gz
      moderately_sensitive:
        input_controlactual_skim: output/sequential/pfizer/matchround2/extract/actual/*.txt
        data_actual_skim: output/sequential/pfizer/matchround2/actual/*.txt

  ##  
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Matching round 3: 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  extract_controlpotential_pfizer_3:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlpotential
      --output-file output/sequential/pfizer/matchround3/extract/input_controlpotential.feather
      --param brand=pfizer --param matching_round=3 --param index_date=2021-01-05
    needs:
    - design
    - process_single
    - process_controlactual_pfizer_2
    outputs:
      highly_sensitive:
        cohort: output/sequential/pfizer/matchround3/extract/input_controlpotential.feather

  process_controlpotential_pfizer_3:
    run: r:latest analysis/process/process_data.R potential pfizer 3
    needs:
    - extract_controlpotential_pfizer_3
    outputs:
      highly_sensitive:
        rds: output/sequential/pfizer/matchround3/process/*.rds
      moderately_sensitive:
        input_controlpotential_skim: output/sequential/pfizer/matchround3/extract/potential/*.txt
        data_processed_skim: output/sequential/pfizer/matchround3/potential/*.txt
        data_controlpotential_skim: output/sequential/pfizer/matchround3/process/*.txt

  match_potential_pfizer_3:
    run: r:latest analysis/sequential/matching/match_potential.R pfizer 3
    needs:
    - process_treated
    - process_controlpotential_pfizer_3
    - process_controlactual_pfizer_2
    outputs:
      highly_sensitive:
        rds: output/sequential/pfizer/matchround3/potential/*.rds
        csv: output/sequential/pfizer/matchround3/potential/*.csv.gz

  extract_controlactual_pfizer_3:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlactual
      --output-file output/sequential/pfizer/matchround3/extract/input_controlactual.feather
      --param brand=pfizer --param matching_round=3
    needs:
    - design
    - match_potential_pfizer_3
    outputs:
      highly_sensitive:
        cohort: output/sequential/pfizer/matchround3/extract/input_controlactual.feather

  process_controlactual_pfizer_3:
    run: r:latest analysis/process/process_data.R actual pfizer 3
    needs:
    - process_treated
    - match_potential_pfizer_3
    - extract_controlpotential_pfizer_3
    - process_controlpotential_pfizer_3
    - extract_controlactual_pfizer_3
    - process_controlactual_pfizer_2
    outputs:
      highly_sensitive:
        rds: output/sequential/pfizer/matchround3/actual/*.rds
        csv: output/sequential/pfizer/matchround3/actual/*.csv.gz
      moderately_sensitive:
        input_controlactual_skim: output/sequential/pfizer/matchround3/extract/actual/*.txt
        data_actual_skim: output/sequential/pfizer/matchround3/actual/*.txt

  ##  
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Matching round 4: 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  extract_controlpotential_pfizer_4:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlpotential
      --output-file output/sequential/pfizer/matchround4/extract/input_controlpotential.feather
      --param brand=pfizer --param matching_round=4 --param index_date=2021-01-19
    needs:
    - design
    - process_single
    - process_controlactual_pfizer_3
    outputs:
      highly_sensitive:
        cohort: output/sequential/pfizer/matchround4/extract/input_controlpotential.feather

  process_controlpotential_pfizer_4:
    run: r:latest analysis/process/process_data.R potential pfizer 4
    needs:
    - extract_controlpotential_pfizer_4
    outputs:
      highly_sensitive:
        rds: output/sequential/pfizer/matchround4/process/*.rds
      moderately_sensitive:
        input_controlpotential_skim: output/sequential/pfizer/matchround4/extract/potential/*.txt
        data_processed_skim: output/sequential/pfizer/matchround4/potential/*.txt
        data_controlpotential_skim: output/sequential/pfizer/matchround4/process/*.txt

  match_potential_pfizer_4:
    run: r:latest analysis/sequential/matching/match_potential.R pfizer 4
    needs:
    - process_treated
    - process_controlpotential_pfizer_4
    - process_controlactual_pfizer_3
    outputs:
      highly_sensitive:
        rds: output/sequential/pfizer/matchround4/potential/*.rds
        csv: output/sequential/pfizer/matchround4/potential/*.csv.gz

  extract_controlactual_pfizer_4:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlactual
      --output-file output/sequential/pfizer/matchround4/extract/input_controlactual.feather
      --param brand=pfizer --param matching_round=4
    needs:
    - design
    - match_potential_pfizer_4
    outputs:
      highly_sensitive:
        cohort: output/sequential/pfizer/matchround4/extract/input_controlactual.feather

  process_controlactual_pfizer_4:
    run: r:latest analysis/process/process_data.R actual pfizer 4
    needs:
    - process_treated
    - match_potential_pfizer_4
    - extract_controlpotential_pfizer_4
    - process_controlpotential_pfizer_4
    - extract_controlactual_pfizer_4
    - process_controlactual_pfizer_3
    outputs:
      highly_sensitive:
        rds: output/sequential/pfizer/matchround4/actual/*.rds
        csv: output/sequential/pfizer/matchround4/actual/*.csv.gz
      moderately_sensitive:
        input_controlactual_skim: output/sequential/pfizer/matchround4/extract/actual/*.txt
        data_actual_skim: output/sequential/pfizer/matchround4/actual/*.txt

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Extract and process data from final controls in the pfizer trials 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## `extract_controlfinal_pfizer` extracts data from successful matches 
  ## across all matching rounds: 

  extract_controlfinal_pfizer:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlfinal
      --output-file output/sequential/pfizer/extract/input_controlfinal.feather --param
      brand=pfizer --param n_matching_rounds=4
    needs:
    - design
    - process_controlactual_pfizer_4
    outputs:
      highly_sensitive:
        extract: output/sequential/pfizer/extract/input_controlfinal.feather

  ## `dummydata_controlfinal_pfizer` creates dummy data to represent 
  ## the dummy data extraced in `extract_controlfinal_pfizer`(for  
  ## testing only): 

  dummydata_controlfinal_pfizer:
    run: r:latest analysis/dummy/dummydata_controlfinal.R pfizer
    needs:
    - process_controlactual_pfizer_1
    - process_controlactual_pfizer_2
    - process_controlactual_pfizer_3
    - process_controlactual_pfizer_4
    outputs:
      highly_sensitive:
        dummydata_controlfinal: output/sequential/pfizer/dummydata/dummy_control_final.feather

  ## `process_controlfinal_pfizer` processes the data extracted in 
  ## extract_controlfinal_pfizer: 

  process_controlfinal_pfizer:
    run: r:latest analysis/process/process_data.R final pfizer
    needs:
    - process_controlactual_pfizer_1
    - process_controlactual_pfizer_2
    - process_controlactual_pfizer_3
    - process_controlactual_pfizer_4
    - extract_controlfinal_pfizer
    - process_treated
    - dummydata_controlfinal_pfizer
    outputs:
      highly_sensitive:
        extract: output/sequential/pfizer/match/*.rds
      moderately_sensitive:
        input_controlfinal_skim: output/sequential/pfizer/extract/*.txt
        data_matched_skim: output/sequential/pfizer/match/*.txt

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## pfizer trial summary 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## `coverage_pfizer` summarises the matching coverage on each day of 
  ## the recruitment period: 

  coverage_pfizer:
    run: r:latest analysis/sequential/matching/coverage.R pfizer
    needs:
    - process_treated
    - process_controlfinal_pfizer
    outputs:
      moderately_sensitive:
        coverage: output/report/coverage/coverage_pfizer.csv

  ## `table1_sequential_pfizer` summarises matching variables and 
  ## baseline covariates for individuals included in the pfizer trials: 

  table1_sequential_pfizer:
    run: r:latest analysis/report/table1.R sequential pfizer
    needs:
    - process_treated
    - process_controlfinal_pfizer
    outputs:
      moderately_sensitive:
        table1: output/report/table1/table1_sequential_pfizer_rounded.csv

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Fit models to the sequential trials data 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ##  
  ## `kmcox_pfizer_{subgroup}_{outcome}` actions fit models to the 
  ## pfizer trial data for a given {subgroup} and {outcome}: 

  kmcox_pfizer_all_postest:
    run: r:latest analysis/sequential/model/kmcox.R pfizer all postest
    needs:
    - process_controlfinal_pfizer
    outputs:
      moderately_sensitive:
        rds: output/sequential/pfizer/model/all/postest/*.rds
        png: output/sequential/pfizer/model/all/postest/*.png

  kmcox_pfizer_all_covidadmitted:
    run: r:latest analysis/sequential/model/kmcox.R pfizer all covidadmitted
    needs:
    - process_controlfinal_pfizer
    outputs:
      moderately_sensitive:
        rds: output/sequential/pfizer/model/all/covidadmitted/*.rds
        png: output/sequential/pfizer/model/all/covidadmitted/*.png

  kmcox_pfizer_all_death:
    run: r:latest analysis/sequential/model/kmcox.R pfizer all death
    needs:
    - process_controlfinal_pfizer
    outputs:
      moderately_sensitive:
        rds: output/sequential/pfizer/model/all/death/*.rds
        png: output/sequential/pfizer/model/all/death/*.png

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Extract control data, match and model for the az trials 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ##  
  ## See comment at the start of the pfizer matching round for a 
  ## description of the actions in the matching round section. 
  ##  
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Matching round 1: 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  extract_controlpotential_az_1:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlpotential
      --output-file output/sequential/az/matchround1/extract/input_controlpotential.feather
      --param brand=az --param matching_round=1 --param index_date=2021-01-04
    needs:
    - design
    - process_single
    outputs:
      highly_sensitive:
        cohort: output/sequential/az/matchround1/extract/input_controlpotential.feather

  process_controlpotential_az_1:
    run: r:latest analysis/process/process_data.R potential az 1
    needs:
    - extract_controlpotential_az_1
    outputs:
      highly_sensitive:
        rds: output/sequential/az/matchround1/process/*.rds
        csv: output/sequential/az/matchround1/process/*.csv.gz
      moderately_sensitive:
        input_controlpotential_skim: output/sequential/az/matchround1/extract/potential/*.txt
        data_processed_skim: output/sequential/az/matchround1/potential/*.txt
        data_controlpotential_skim: output/sequential/az/matchround1/process/*.txt

  match_potential_az_1:
    run: r:latest analysis/sequential/matching/match_potential.R az 1
    needs:
    - process_treated
    - process_controlpotential_az_1
    outputs:
      highly_sensitive:
        rds: output/sequential/az/matchround1/potential/*.rds
        csv: output/sequential/az/matchround1/potential/*.csv.gz

  extract_controlactual_az_1:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlactual
      --output-file output/sequential/az/matchround1/extract/input_controlactual.feather
      --param brand=az --param matching_round=1
    needs:
    - design
    - match_potential_az_1
    outputs:
      highly_sensitive:
        cohort: output/sequential/az/matchround1/extract/input_controlactual.feather

  process_controlactual_az_1:
    run: r:latest analysis/process/process_data.R actual az 1
    needs:
    - process_treated
    - match_potential_az_1
    - extract_controlpotential_az_1
    - process_controlpotential_az_1
    - extract_controlactual_az_1
    outputs:
      highly_sensitive:
        rds: output/sequential/az/matchround1/actual/*.rds
        csv: output/sequential/az/matchround1/actual/*.csv.gz
      moderately_sensitive:
        input_controlactual_skim: output/sequential/az/matchround1/extract/actual/*.txt
        data_actual_skim: output/sequential/az/matchround1/actual/*.txt

  ##  
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Matching round 2: 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  extract_controlpotential_az_2:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlpotential
      --output-file output/sequential/az/matchround2/extract/input_controlpotential.feather
      --param brand=az --param matching_round=2 --param index_date=2021-01-18
    needs:
    - design
    - process_single
    - process_controlactual_az_1
    outputs:
      highly_sensitive:
        cohort: output/sequential/az/matchround2/extract/input_controlpotential.feather

  process_controlpotential_az_2:
    run: r:latest analysis/process/process_data.R potential az 2
    needs:
    - extract_controlpotential_az_2
    outputs:
      highly_sensitive:
        rds: output/sequential/az/matchround2/process/*.rds
      moderately_sensitive:
        input_controlpotential_skim: output/sequential/az/matchround2/extract/potential/*.txt
        data_processed_skim: output/sequential/az/matchround2/potential/*.txt
        data_controlpotential_skim: output/sequential/az/matchround2/process/*.txt

  match_potential_az_2:
    run: r:latest analysis/sequential/matching/match_potential.R az 2
    needs:
    - process_treated
    - process_controlpotential_az_2
    - process_controlactual_az_1
    outputs:
      highly_sensitive:
        rds: output/sequential/az/matchround2/potential/*.rds
        csv: output/sequential/az/matchround2/potential/*.csv.gz

  extract_controlactual_az_2:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlactual
      --output-file output/sequential/az/matchround2/extract/input_controlactual.feather
      --param brand=az --param matching_round=2
    needs:
    - design
    - match_potential_az_2
    outputs:
      highly_sensitive:
        cohort: output/sequential/az/matchround2/extract/input_controlactual.feather

  process_controlactual_az_2:
    run: r:latest analysis/process/process_data.R actual az 2
    needs:
    - process_treated
    - match_potential_az_2
    - extract_controlpotential_az_2
    - process_controlpotential_az_2
    - extract_controlactual_az_2
    - process_controlactual_az_1
    outputs:
      highly_sensitive:
        rds: output/sequential/az/matchround2/actual/*.rds
        csv: output/sequential/az/matchround2/actual/*.csv.gz
      moderately_sensitive:
        input_controlactual_skim: output/sequential/az/matchround2/extract/actual/*.txt
        data_actual_skim: output/sequential/az/matchround2/actual/*.txt

  ##  
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Matching round 3: 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  extract_controlpotential_az_3:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlpotential
      --output-file output/sequential/az/matchround3/extract/input_controlpotential.feather
      --param brand=az --param matching_round=3 --param index_date=2021-02-01
    needs:
    - design
    - process_single
    - process_controlactual_az_2
    outputs:
      highly_sensitive:
        cohort: output/sequential/az/matchround3/extract/input_controlpotential.feather

  process_controlpotential_az_3:
    run: r:latest analysis/process/process_data.R potential az 3
    needs:
    - extract_controlpotential_az_3
    outputs:
      highly_sensitive:
        rds: output/sequential/az/matchround3/process/*.rds
      moderately_sensitive:
        input_controlpotential_skim: output/sequential/az/matchround3/extract/potential/*.txt
        data_processed_skim: output/sequential/az/matchround3/potential/*.txt
        data_controlpotential_skim: output/sequential/az/matchround3/process/*.txt

  match_potential_az_3:
    run: r:latest analysis/sequential/matching/match_potential.R az 3
    needs:
    - process_treated
    - process_controlpotential_az_3
    - process_controlactual_az_2
    outputs:
      highly_sensitive:
        rds: output/sequential/az/matchround3/potential/*.rds
        csv: output/sequential/az/matchround3/potential/*.csv.gz

  extract_controlactual_az_3:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlactual
      --output-file output/sequential/az/matchround3/extract/input_controlactual.feather
      --param brand=az --param matching_round=3
    needs:
    - design
    - match_potential_az_3
    outputs:
      highly_sensitive:
        cohort: output/sequential/az/matchround3/extract/input_controlactual.feather

  process_controlactual_az_3:
    run: r:latest analysis/process/process_data.R actual az 3
    needs:
    - process_treated
    - match_potential_az_3
    - extract_controlpotential_az_3
    - process_controlpotential_az_3
    - extract_controlactual_az_3
    - process_controlactual_az_2
    outputs:
      highly_sensitive:
        rds: output/sequential/az/matchround3/actual/*.rds
        csv: output/sequential/az/matchround3/actual/*.csv.gz
      moderately_sensitive:
        input_controlactual_skim: output/sequential/az/matchround3/extract/actual/*.txt
        data_actual_skim: output/sequential/az/matchround3/actual/*.txt

  ##  
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Matching round 4: 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  extract_controlpotential_az_4:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlpotential
      --output-file output/sequential/az/matchround4/extract/input_controlpotential.feather
      --param brand=az --param matching_round=4 --param index_date=2021-02-15
    needs:
    - design
    - process_single
    - process_controlactual_az_3
    outputs:
      highly_sensitive:
        cohort: output/sequential/az/matchround4/extract/input_controlpotential.feather

  process_controlpotential_az_4:
    run: r:latest analysis/process/process_data.R potential az 4
    needs:
    - extract_controlpotential_az_4
    outputs:
      highly_sensitive:
        rds: output/sequential/az/matchround4/process/*.rds
      moderately_sensitive:
        input_controlpotential_skim: output/sequential/az/matchround4/extract/potential/*.txt
        data_processed_skim: output/sequential/az/matchround4/potential/*.txt
        data_controlpotential_skim: output/sequential/az/matchround4/process/*.txt

  match_potential_az_4:
    run: r:latest analysis/sequential/matching/match_potential.R az 4
    needs:
    - process_treated
    - process_controlpotential_az_4
    - process_controlactual_az_3
    outputs:
      highly_sensitive:
        rds: output/sequential/az/matchround4/potential/*.rds
        csv: output/sequential/az/matchround4/potential/*.csv.gz

  extract_controlactual_az_4:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlactual
      --output-file output/sequential/az/matchround4/extract/input_controlactual.feather
      --param brand=az --param matching_round=4
    needs:
    - design
    - match_potential_az_4
    outputs:
      highly_sensitive:
        cohort: output/sequential/az/matchround4/extract/input_controlactual.feather

  process_controlactual_az_4:
    run: r:latest analysis/process/process_data.R actual az 4
    needs:
    - process_treated
    - match_potential_az_4
    - extract_controlpotential_az_4
    - process_controlpotential_az_4
    - extract_controlactual_az_4
    - process_controlactual_az_3
    outputs:
      highly_sensitive:
        rds: output/sequential/az/matchround4/actual/*.rds
        csv: output/sequential/az/matchround4/actual/*.csv.gz
      moderately_sensitive:
        input_controlactual_skim: output/sequential/az/matchround4/extract/actual/*.txt
        data_actual_skim: output/sequential/az/matchround4/actual/*.txt

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Extract and process data from final controls in the az trials 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## `extract_controlfinal_az` extracts data from successful matches 
  ## across all matching rounds: 

  extract_controlfinal_az:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_controlfinal
      --output-file output/sequential/az/extract/input_controlfinal.feather --param
      brand=az --param n_matching_rounds=4
    needs:
    - design
    - process_controlactual_az_4
    outputs:
      highly_sensitive:
        extract: output/sequential/az/extract/input_controlfinal.feather

  ## `dummydata_controlfinal_az` creates dummy data to represent 
  ## the dummy data extraced in `extract_controlfinal_az`(for  
  ## testing only): 

  dummydata_controlfinal_az:
    run: r:latest analysis/dummy/dummydata_controlfinal.R az
    needs:
    - process_controlactual_az_1
    - process_controlactual_az_2
    - process_controlactual_az_3
    - process_controlactual_az_4
    outputs:
      highly_sensitive:
        dummydata_controlfinal: output/sequential/az/dummydata/dummy_control_final.feather

  ## `process_controlfinal_az` processes the data extracted in 
  ## extract_controlfinal_az: 

  process_controlfinal_az:
    run: r:latest analysis/process/process_data.R final az
    needs:
    - process_controlactual_az_1
    - process_controlactual_az_2
    - process_controlactual_az_3
    - process_controlactual_az_4
    - extract_controlfinal_az
    - process_treated
    - dummydata_controlfinal_az
    outputs:
      highly_sensitive:
        extract: output/sequential/az/match/*.rds
      moderately_sensitive:
        input_controlfinal_skim: output/sequential/az/extract/*.txt
        data_matched_skim: output/sequential/az/match/*.txt

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## az trial summary 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## `coverage_az` summarises the matching coverage on each day of 
  ## the recruitment period: 

  coverage_az:
    run: r:latest analysis/sequential/matching/coverage.R az
    needs:
    - process_treated
    - process_controlfinal_az
    outputs:
      moderately_sensitive:
        coverage: output/report/coverage/coverage_az.csv

  ## `table1_sequential_az` summarises matching variables and 
  ## baseline covariates for individuals included in the az trials: 

  table1_sequential_az:
    run: r:latest analysis/report/table1.R sequential az
    needs:
    - process_treated
    - process_controlfinal_az
    outputs:
      moderately_sensitive:
        table1: output/report/table1/table1_sequential_az_rounded.csv

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Fit models to the sequential trials data 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ##  
  ## `kmcox_pfizer_{subgroup}_{outcome}` actions fit models to the 
  ## az trial data for a given {subgroup} and {outcome}: 

  kmcox_az_all_postest:
    run: r:latest analysis/sequential/model/kmcox.R az all postest
    needs:
    - process_controlfinal_az
    outputs:
      moderately_sensitive:
        rds: output/sequential/az/model/all/postest/*.rds
        png: output/sequential/az/model/all/postest/*.png

  kmcox_az_all_covidadmitted:
    run: r:latest analysis/sequential/model/kmcox.R az all covidadmitted
    needs:
    - process_controlfinal_az
    outputs:
      moderately_sensitive:
        rds: output/sequential/az/model/all/covidadmitted/*.rds
        png: output/sequential/az/model/all/covidadmitted/*.png

  kmcox_az_all_death:
    run: r:latest analysis/sequential/model/kmcox.R az all death
    needs:
    - process_controlfinal_az
    outputs:
      moderately_sensitive:
        rds: output/sequential/az/model/all/death/*.rds
        png: output/sequential/az/model/all/death/*.png

  ## `combine_kmcox` combines output from all actions that run `kmcox.R`: 

  combine_kmcox:
    run: r:latest analysis/sequential/model/kmcox_combine.R
    needs:
    - kmcox_pfizer_all_postest
    - kmcox_pfizer_all_covidadmitted
    - kmcox_pfizer_all_death
    - kmcox_az_all_postest
    - kmcox_az_all_covidadmitted
    - kmcox_az_all_death
    outputs:
      moderately_sensitive:
        rds: output/sequential/combine/*.csv
        png: output/sequential/combine/*.png

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## SINGLE TRIAL APPROACH 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Extract and process data 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ##  
  ## `process_single` processes data extracted in the  
  ## `extract_controlpotential_pfizer_1` action for the 
  ## single trial approach: 

  process_single:
    run: r:latest analysis/process/process_data.R single
    needs:
    - extract_controlpotential_pfizer_1
    outputs:
      highly_sensitive:
        eligible: output/single/eligible/*.rds
      moderately_sensitive:
        eligiblecsv: output/single/eligible/*.csv
        eligiblecsvgz: output/single/eligible/*.csv.gz
        data_processed_skim: output/single/process/*.txt
        data_eligible_skim: output/single/eligible/*.txt

  ## `table1_single_any` calculates summary statistics for the single 
  ## trial cohort: 

  table1_single_any:
    run: r:latest analysis/report/table1.R single any
    needs:
    - process_single
    outputs:
      moderately_sensitive:
        table1: output/report/table1/table1_single_any_rounded.csv

  ## `extract_timevarying` extracts the data needed to derive 
  ## time-varying covariates and outcome variables for the single trial 
  ## approach: 

  extract_timevarying:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_timevarying
      --output-file output/single/extract/input_timevarying.feather
    needs:
    - design
    - process_single
    outputs:
      highly_sensitive:
        extract: output/single/extract/input_timevarying.feather

  ## `dummydata_timevarying` creates dummy data represent the data 
  ## extracted in `extract_timevarying` (for testing only): 

  dummydata_timevarying:
    run: r:latest analysis/dummy/dummydata_timevarying.R
    needs:
    - process_single
    - extract_timevarying
    outputs:
      highly_sensitive:
        dummydata: output/single/dummydata/*.feather

  ## `process_timevarying` processes the data extracted in  
  ## `extract_timevarying` to create time-varying covariates and outcome 
  ## variables: 

  process_timevarying:
    run: r:latest analysis/single/process/process_timevarying.R
    needs:
    - process_single
    - extract_timevarying
    - dummydata_timevarying
    outputs:
      highly_sensitive:
        processed: output/single/process/*.rds

  ## `process_stset` creates time-to-event datasets necessary to derive 
  ## data_days (one-row-per-patient-per-day): 

  process_stset:
    run: r:latest analysis/single/process/process_stset.R
    needs:
    - process_single
    - process_timevarying
    outputs:
      highly_sensitive:
        processed: output/single/stset/*.rds

  ## `process_data_days` creates a one-row-per-patient-per-day dataset; 
  ## this is split across `process_data_days_n` defined in 
  ## due to memory constraints: 

  process_data_days:
    run: r:latest analysis/single/process/process_data_days.R
    needs:
    - process_stset
    outputs:
      highly_sensitive:
        processed: output/single/stset/data_days_*.rds

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Fit models to the single trials data 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ##  
  ## The actions in this section do the following: 
  ##  
  ## - `preflight_{brand}_{subgroup}_{outcome}_{stage} 
  ##   checks for separation between covariates and outcomes 
  ##  
  ## - `ipw_{brand}_{subgroup}_{outcome} fits models to calculate the 
  ##   probability of vaccination models 
  ##  
  ## - `msm_{brand}_{subgroup}_{outcome} fits marginal structural models 
  ##    to predict the odds of outcome events 
  ##  
  ## - `postprocess_{brand}_{subgroup}_{outcome}` processes the 
  ##   output from the `ipw_preflight_{brand}_{subgroup}_{outcome}` 
  ##   and `msm_preflight_{brand}_{subgroup}_{outcome}` actions 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ##  
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Model: brand = pfizer; subgroup = all; outcome = postest 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  preflight_pfizer_all_postest_vaccine:
    run: r:latest analysis/single/model/preflight.R pfizer all postest vaccine
    needs:
    - process_stset
    - process_data_days
    outputs:
      moderately_sensitive:
        csv: output/single/pfizer/all/postest/preflight/vaccine/*.csv
        html: output/single/pfizer/all/postest/preflight/vaccine/*.html

  preflight_pfizer_all_postest_outcome:
    run: r:latest analysis/single/model/preflight.R pfizer all postest outcome
    needs:
    - process_stset
    - process_data_days
    outputs:
      moderately_sensitive:
        csv: output/single/pfizer/all/postest/preflight/outcome/*.csv
        html: output/single/pfizer/all/postest/preflight/outcome/*.html

  ipw_pfizer_all_postest:
    run: r:latest analysis/single/model/ipw.R pfizer all postest
    needs:
    - process_stset
    - process_data_days
    outputs:
      highly_sensitive:
        rds: output/single/pfizer/all/postest/ipw/*.rds
      moderately_sensitive:
        svg: output/single/pfizer/all/postest/ipw/*.svg
        txt: output/single/pfizer/all/postest/ipw/*.txt

  msm_pfizer_all_postest:
    run: r:latest analysis/single/model/msm.R pfizer all postest
    needs:
    - ipw_pfizer_all_postest
    outputs:
      highly_sensitive:
        rds: output/single/pfizer/all/postest/msm/*.rds
      moderately_sensitive:
        csv: output/single/pfizer/all/postest/msm/*.csv

  postprocess_pfizer_all_postest:
    run: r:latest analysis/single/model/postprocess.R pfizer all postest
    needs:
    - ipw_pfizer_all_postest
    - msm_pfizer_all_postest
    outputs:
      highly_sensitive:
        rds: output/single/pfizer/all/postest/postprocess/*.rds
      moderately_sensitive:
        csv: output/single/pfizer/all/postest/postprocess/*.csv
        svg: output/single/pfizer/all/postest/postprocess/*.svg

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Model: brand = pfizer; subgroup = all; outcome = covidadmitted 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  preflight_pfizer_all_covidadmitted_vaccine:
    run: r:latest analysis/single/model/preflight.R pfizer all covidadmitted vaccine
    needs:
    - process_stset
    - process_data_days
    outputs:
      moderately_sensitive:
        csv: output/single/pfizer/all/covidadmitted/preflight/vaccine/*.csv
        html: output/single/pfizer/all/covidadmitted/preflight/vaccine/*.html

  preflight_pfizer_all_covidadmitted_outcome:
    run: r:latest analysis/single/model/preflight.R pfizer all covidadmitted outcome
    needs:
    - process_stset
    - process_data_days
    outputs:
      moderately_sensitive:
        csv: output/single/pfizer/all/covidadmitted/preflight/outcome/*.csv
        html: output/single/pfizer/all/covidadmitted/preflight/outcome/*.html

  ipw_pfizer_all_covidadmitted:
    run: r:latest analysis/single/model/ipw.R pfizer all covidadmitted
    needs:
    - process_stset
    - process_data_days
    outputs:
      highly_sensitive:
        rds: output/single/pfizer/all/covidadmitted/ipw/*.rds
      moderately_sensitive:
        svg: output/single/pfizer/all/covidadmitted/ipw/*.svg
        txt: output/single/pfizer/all/covidadmitted/ipw/*.txt

  msm_pfizer_all_covidadmitted:
    run: r:latest analysis/single/model/msm.R pfizer all covidadmitted
    needs:
    - ipw_pfizer_all_covidadmitted
    outputs:
      highly_sensitive:
        rds: output/single/pfizer/all/covidadmitted/msm/*.rds
      moderately_sensitive:
        csv: output/single/pfizer/all/covidadmitted/msm/*.csv

  postprocess_pfizer_all_covidadmitted:
    run: r:latest analysis/single/model/postprocess.R pfizer all covidadmitted
    needs:
    - ipw_pfizer_all_covidadmitted
    - msm_pfizer_all_covidadmitted
    outputs:
      highly_sensitive:
        rds: output/single/pfizer/all/covidadmitted/postprocess/*.rds
      moderately_sensitive:
        csv: output/single/pfizer/all/covidadmitted/postprocess/*.csv
        svg: output/single/pfizer/all/covidadmitted/postprocess/*.svg

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Model: brand = pfizer; subgroup = all; outcome = death 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  preflight_pfizer_all_death_vaccine:
    run: r:latest analysis/single/model/preflight.R pfizer all death vaccine
    needs:
    - process_stset
    - process_data_days
    outputs:
      moderately_sensitive:
        csv: output/single/pfizer/all/death/preflight/vaccine/*.csv
        html: output/single/pfizer/all/death/preflight/vaccine/*.html

  preflight_pfizer_all_death_outcome:
    run: r:latest analysis/single/model/preflight.R pfizer all death outcome
    needs:
    - process_stset
    - process_data_days
    outputs:
      moderately_sensitive:
        csv: output/single/pfizer/all/death/preflight/outcome/*.csv
        html: output/single/pfizer/all/death/preflight/outcome/*.html

  ipw_pfizer_all_death:
    run: r:latest analysis/single/model/ipw.R pfizer all death
    needs:
    - process_stset
    - process_data_days
    outputs:
      highly_sensitive:
        rds: output/single/pfizer/all/death/ipw/*.rds
      moderately_sensitive:
        svg: output/single/pfizer/all/death/ipw/*.svg
        txt: output/single/pfizer/all/death/ipw/*.txt

  msm_pfizer_all_death:
    run: r:latest analysis/single/model/msm.R pfizer all death
    needs:
    - ipw_pfizer_all_death
    outputs:
      highly_sensitive:
        rds: output/single/pfizer/all/death/msm/*.rds
      moderately_sensitive:
        csv: output/single/pfizer/all/death/msm/*.csv

  postprocess_pfizer_all_death:
    run: r:latest analysis/single/model/postprocess.R pfizer all death
    needs:
    - ipw_pfizer_all_death
    - msm_pfizer_all_death
    outputs:
      highly_sensitive:
        rds: output/single/pfizer/all/death/postprocess/*.rds
      moderately_sensitive:
        csv: output/single/pfizer/all/death/postprocess/*.csv
        svg: output/single/pfizer/all/death/postprocess/*.svg

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Model: brand = az; subgroup = all; outcome = postest 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  preflight_az_all_postest_vaccine:
    run: r:latest analysis/single/model/preflight.R az all postest vaccine
    needs:
    - process_stset
    - process_data_days
    outputs:
      moderately_sensitive:
        csv: output/single/az/all/postest/preflight/vaccine/*.csv
        html: output/single/az/all/postest/preflight/vaccine/*.html

  preflight_az_all_postest_outcome:
    run: r:latest analysis/single/model/preflight.R az all postest outcome
    needs:
    - process_stset
    - process_data_days
    outputs:
      moderately_sensitive:
        csv: output/single/az/all/postest/preflight/outcome/*.csv
        html: output/single/az/all/postest/preflight/outcome/*.html

  ipw_az_all_postest:
    run: r:latest analysis/single/model/ipw.R az all postest
    needs:
    - process_stset
    - process_data_days
    outputs:
      highly_sensitive:
        rds: output/single/az/all/postest/ipw/*.rds
      moderately_sensitive:
        svg: output/single/az/all/postest/ipw/*.svg
        txt: output/single/az/all/postest/ipw/*.txt

  msm_az_all_postest:
    run: r:latest analysis/single/model/msm.R az all postest
    needs:
    - ipw_az_all_postest
    outputs:
      highly_sensitive:
        rds: output/single/az/all/postest/msm/*.rds
      moderately_sensitive:
        csv: output/single/az/all/postest/msm/*.csv

  postprocess_az_all_postest:
    run: r:latest analysis/single/model/postprocess.R az all postest
    needs:
    - ipw_az_all_postest
    - msm_az_all_postest
    outputs:
      highly_sensitive:
        rds: output/single/az/all/postest/postprocess/*.rds
      moderately_sensitive:
        csv: output/single/az/all/postest/postprocess/*.csv
        svg: output/single/az/all/postest/postprocess/*.svg

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Model: brand = az; subgroup = all; outcome = covidadmitted 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  preflight_az_all_covidadmitted_vaccine:
    run: r:latest analysis/single/model/preflight.R az all covidadmitted vaccine
    needs:
    - process_stset
    - process_data_days
    outputs:
      moderately_sensitive:
        csv: output/single/az/all/covidadmitted/preflight/vaccine/*.csv
        html: output/single/az/all/covidadmitted/preflight/vaccine/*.html

  preflight_az_all_covidadmitted_outcome:
    run: r:latest analysis/single/model/preflight.R az all covidadmitted outcome
    needs:
    - process_stset
    - process_data_days
    outputs:
      moderately_sensitive:
        csv: output/single/az/all/covidadmitted/preflight/outcome/*.csv
        html: output/single/az/all/covidadmitted/preflight/outcome/*.html

  ipw_az_all_covidadmitted:
    run: r:latest analysis/single/model/ipw.R az all covidadmitted
    needs:
    - process_stset
    - process_data_days
    outputs:
      highly_sensitive:
        rds: output/single/az/all/covidadmitted/ipw/*.rds
      moderately_sensitive:
        svg: output/single/az/all/covidadmitted/ipw/*.svg
        txt: output/single/az/all/covidadmitted/ipw/*.txt

  msm_az_all_covidadmitted:
    run: r:latest analysis/single/model/msm.R az all covidadmitted
    needs:
    - ipw_az_all_covidadmitted
    outputs:
      highly_sensitive:
        rds: output/single/az/all/covidadmitted/msm/*.rds
      moderately_sensitive:
        csv: output/single/az/all/covidadmitted/msm/*.csv

  postprocess_az_all_covidadmitted:
    run: r:latest analysis/single/model/postprocess.R az all covidadmitted
    needs:
    - ipw_az_all_covidadmitted
    - msm_az_all_covidadmitted
    outputs:
      highly_sensitive:
        rds: output/single/az/all/covidadmitted/postprocess/*.rds
      moderately_sensitive:
        csv: output/single/az/all/covidadmitted/postprocess/*.csv
        svg: output/single/az/all/covidadmitted/postprocess/*.svg

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Model: brand = az; subgroup = all; outcome = death 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

  preflight_az_all_death_vaccine:
    run: r:latest analysis/single/model/preflight.R az all death vaccine
    needs:
    - process_stset
    - process_data_days
    outputs:
      moderately_sensitive:
        csv: output/single/az/all/death/preflight/vaccine/*.csv
        html: output/single/az/all/death/preflight/vaccine/*.html

  preflight_az_all_death_outcome:
    run: r:latest analysis/single/model/preflight.R az all death outcome
    needs:
    - process_stset
    - process_data_days
    outputs:
      moderately_sensitive:
        csv: output/single/az/all/death/preflight/outcome/*.csv
        html: output/single/az/all/death/preflight/outcome/*.html

  ipw_az_all_death:
    run: r:latest analysis/single/model/ipw.R az all death
    needs:
    - process_stset
    - process_data_days
    outputs:
      highly_sensitive:
        rds: output/single/az/all/death/ipw/*.rds
      moderately_sensitive:
        svg: output/single/az/all/death/ipw/*.svg
        txt: output/single/az/all/death/ipw/*.txt

  msm_az_all_death:
    run: r:latest analysis/single/model/msm.R az all death
    needs:
    - ipw_az_all_death
    outputs:
      highly_sensitive:
        rds: output/single/az/all/death/msm/*.rds
      moderately_sensitive:
        csv: output/single/az/all/death/msm/*.csv

  postprocess_az_all_death:
    run: r:latest analysis/single/model/postprocess.R az all death
    needs:
    - ipw_az_all_death
    - msm_az_all_death
    outputs:
      highly_sensitive:
        rds: output/single/az/all/death/postprocess/*.rds
      moderately_sensitive:
        csv: output/single/az/all/death/postprocess/*.csv
        svg: output/single/az/all/death/postprocess/*.svg

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## Combine model outputs 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ##  
  ## `msm_combine` combines the output from all actions that run `msm.R`: 

  single_combine:
    run: r:latest analysis/single/model/combine.R
    needs:
    - postprocess_pfizer_all_postest
    - postprocess_pfizer_all_covidadmitted
    - postprocess_pfizer_all_death
    - postprocess_az_all_postest
    - postprocess_az_all_covidadmitted
    - postprocess_az_all_death
    outputs:
      moderately_sensitive:
        csv: output/single/combine/*.csv
        svg: output/single/combine/*.svg

  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ## REPORT 
  ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
  ##  
  ## `flowchart` prepares the data to be used in the particiant flow 
  ## diagram in the paper (Supplementary Figure xxx): 

  flowchart:
    run: r:latest analysis/report/flowchart.R
    needs:
    - process_treated
    - process_controlfinal_pfizer
    - process_controlfinal_az
    - process_single
    outputs:
      moderately_sensitive:
        check_NAs: output/report/flowchart/*.txt
        flow_matching: output/report/flowchart/*.csv

  ## `brand12counts` plots the cumulative incidence of first and second 
  ## vaccine doses (Figure xxx): 

  brand12counts:
    run: r:latest analysis/report/brand12counts.R
    needs:
    - process_data_days
    outputs:
      moderately_sensitive:
        csv: output/report/brand12counts/*.csv
        plots: output/report/brand12counts/*.png

  output_for_release:
    run: r:latest analysis/report/output_for_release.R
    needs:
    - table1_sequential_pfizer
    - table1_sequential_az
    - table1_single_any
    - single_combine
    - combine_kmcox
    - coverage_pfizer
    - coverage_az
    - process_stset
    outputs:
      moderately_sensitive:
        csv: output/report/release/*.csv
        plots: output/report/release/*.png

  ## #### End ####

Timeline

  • Created:

  • Started:

  • Finished:

  • Runtime: 00:04:17

These timestamps are generated and stored using the UTC timezone on the TPP backend.

Job information

Status
Succeeded
Backend
TPP
Requested by
Elsie Horne
Branch
main
Force run dependencies
No
Git commit hash
eacf9b3
Requested actions
  • process_single