-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.pancancer_atlas.TCGA_Clinical_Data_Resource_Extra`
(
  `Row` INT64 OPTIONS(description="Data row number from the original file"),
  bcr_patient_barcode STRING OPTIONS(description="TCGA barcode identifier for the study participant, eg TCGA-02-0001"),
  type STRING OPTIONS(description="TCGA study abbreviation, eg LAML. Full list available at https://gdc.cancer.gov/resources-tcga-users/tcga-code-tables/tcga-study-abbreviations"),
  PFI_1 INT64 OPTIONS(description="Progression-free interval event, 1 for patient having new tumor event whether it was a progression of disease, local recurrence, distant metastasis, new primary tumor of the cancer, or died with the cancer without new tumor event, including cases with a new tumor event whose type is N/A. 0 for censored otherwise. New primary tumor in other organ was censored."),
  PFI_time_1 INT64 OPTIONS(description="Progression-free interval time in days, for events, either new_tumor_event_dx_days_to or death_days_to,  whichever is applicable; or for censored cases, either last_contact_days_to or death_days_to, whichever is applicable. 0 for censored otherwise. New primary tumor in other organ was censored."),
  PFI_2 INT64 OPTIONS(description="Progression-free interval event, 1 for patient having new tumor event whether it was a progression of disease, local recurrence, distant metastasis, new primary tumor of the cancer, or died with the cancer without new tumor event, including cases with a new tumor event whose type is N/A. 0 for censored otherwise."),
  PFI_time_2 INT64 OPTIONS(description="Progression-free interval time in days, for events, either new_tumor_event_dx_days_to or death_days_to,  whichever is applicable; or for censored cases, either last_contact_days_to or death_days_to, whichever is applicable. 0 for censored otherwise."),
  PFS INT64 OPTIONS(description="Progression-free interval event, 1 for patient having new tumor event whether it was a progression of disease, local recurrence, distant metastasis, new primary tumor of the cancer, or died with the cancer without new tumor event, including cases with a new tumor event whose type is N/A. 0 for censored otherwise."),
  PFS_time INT64 OPTIONS(description="Progression-free interval time in days, for events, either new_tumor_event_dx_days_to or death_days_to,  whichever is applicable; or for censored cases, either last_contact_days_to or death_days_to, whichever is applicable. 0 for censored otherwise."),
  DSS_cr INT64 OPTIONS(description="Disease-specific survival with competing risk events, 0 for censored, 1 for DSS event of interest, 2 for competing risk death."),
  DSS_time_cr INT64 OPTIONS(description="Disease-specific survival time in days, whose values are the same as DSS_time in isb-project-zero:pancancer_atlas.TCGA_CDR."),
  DFI_cr INT64 OPTIONS(description="Disease-free interval with competing risk events, 0 for censored, 1 for DFI event of interest, 2 for competing risk death."),
  DFI_time_cr INT64 OPTIONS(description="Disease-specific survival time in days, whose values are the same as DSS_time in isb-project-zero:pancancer_atlas.TCGA_CDR."),
  PFI_cr INT64 OPTIONS(description="Progression-free interval with competing risk events, 0 for censored, 1 for PFI event of interest, 2 for competing risk death."),
  PFI_time_cr INT64 OPTIONS(description="progression-free interval time in days, whose values are the same as PFI_time in Tab TCGA-CDR."),
  PFI_1_cr INT64 OPTIONS(description="progression-free interval (PFI_1) with competing risk events, 0 for censored, 1 for PFI_1 event of interest, 2 for competing risk death."),
  PFI_time_1_cr INT64 OPTIONS(description="progression-free interval time in days, whose values are the same as PFI_time_1"),
  PFI_2_cr INT64 OPTIONS(description="progression-free interval (PFI_1) with competing risk events, 0 for censored, 1 for PFI_2 event of interest, 2 for competing risk death."),
  PFI_time_2_cr INT64 OPTIONS(description="progression-free interval time in days, whose values are the same as PFI_time_2")
)
OPTIONS(
  friendly_name="PanCancer Clinical Data Resource (CDR) Outcome and Survival - Extra",
  description="Data loaded from the article 'An Integrated TCGA Pan-Cancer Clinical Data Resource to Drive High-Quality Survival Outcome Analytics' by  Liu J, et al. Contains a curated resource of extra clinical annotations and survival data for TCGA data.\nMore details:\nhttps://gdc.cancer.gov/about-data/publications/PanCan-Clinical-2018\nand\nhttps://gdc.cancer.gov/about-data/publications/pancanatlas",
  labels=[("access", "open"), ("reference_genome", "hg19"), ("program", "pancancer_atlas"), ("source", "gdc"), ("category", "clinical_biospecimen_data"), ("data_type_1", "survival"), ("data_type_0", "clinical_supplement"), ("status", "current")]
);

INSERT INTO `isb-cgc-bq.pancancer_atlas.TCGA_Clinical_Data_Resource_Extra` (Row, bcr_patient_barcode, type, PFI_1, PFI_time_1, PFI_2, PFI_time_2, PFS, PFS_time, DSS_cr, DSS_time_cr, DFI_cr, DFI_time_cr, PFI_cr, PFI_time_cr, PFI_1_cr, PFI_time_1_cr, PFI_2_cr, PFI_time_2_cr) VALUES (403, 'TCGA-UY-A78L', 'BLCA', 1, 355, NULL, NULL, 1, 355, 0, 1127, NULL, NULL, 1, 355, 1, 355, NULL, NULL), (573, 'TCGA-A2-A0SW', 'BRCA', 1, 653, NULL, NULL, 1, 653, 1, 1365, NULL, NULL, 1, 653, 1, 653, NULL, NULL), (714, 'TCGA-A8-A08O', 'BRCA', 1, 762, NULL, NULL, 1, 762, 0, 943, NULL, NULL, 1, 762, 1, 762, NULL, NULL), (718, 'TCGA-A8-A08T', 'BRCA', 1, 2557, NULL, NULL, 1, 2557, 1, 3409, NULL, NULL, 1, 2557, 1, 2557, NULL, NULL), (1958, 'TCGA-5M-AAT6', 'COAD', 1, 219, NULL, NULL, 1, 219, 1, 290, NULL, NULL, 1, 219, 1, 219, NULL, NULL);