-- DBMS: bigquery
CREATE TABLE `isb-cgc.GDC_metadata.rel17_aliquot2caseIDmap`
(
  program_name STRING OPTIONS(description="Program name, eg TCGA or TARGET"),
  project_id STRING OPTIONS(description="ID of the Project -- e.g. TCGA-BRCA, TARGET-AML, etc."),
  case_gdc_id STRING OPTIONS(description="GDC unique identifier"),
  case_barcode STRING OPTIONS(description="Submitter identifier, eg HCC1954, TCGA-ZX-AA5X, etc"),
  sample_gdc_id STRING OPTIONS(description="Unique GDC identifier for this sample (corresponds to the sample_barcode), eg a1ec9279-c1a6-4e58-97ed-9ec1f36187c5  --  this can be used to access more information from the GDC data portal"),
  sample_barcode STRING OPTIONS(description="Original/submitter sample ID"),
  sample_type STRING OPTIONS(description="Two-digit sample_type code which forms part of the sample barcode eg. 01,11,06, etc."),
  sample_type_name STRING OPTIONS(description="The longer name of the sample type; eg. Primary Tumor, Recurrent Tumor, etc."),
  sample_is_ffpe STRING OPTIONS(description="Whether a smaple is FFPE, either  False,  None ,  True, or null"),
  sample_preservation_method STRING OPTIONS(description="Sample Preservation Method, usually null or  FFPE, also Snap Frozen or Frozen"),
  portion_gdc_id STRING OPTIONS(description="Portion GDC ID"),
  portion_barcode STRING OPTIONS(description="Original/submitter portion ID"),
  analyte_gdc_id STRING OPTIONS(description="Analyte GDC ID"),
  analyte_barcode STRING OPTIONS(description="Original/submitter analyte ID"),
  aliquot_gdc_id STRING OPTIONS(description="Unique GDC identifier for this aliquot (corresponds to the aliquot_barcode), eg 7fbfdb3e-1fd2-4206-8d2e-7f68e4a15844  --  this can be used to access more information from the GDC data portal"),
  aliquot_barcode STRING OPTIONS(description="Original TCGA aliquot barcode, eg TCGA-12-1089-01A-01D-0517-01")
)
OPTIONS(
  friendly_name="ALIQUOT IDS TO CASE IDS REL17",
  description="Data was generated from file metadata information from the GDC release 17.1, June 2019. Aliquot barcodes are mapped to case information.\nMore details: https://docs.gdc.cancer.gov/Data/Release_Notes/Data_Release_Notes/#data-release-170",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("source", "gdc"), ("status", "archived"), ("category", "metadata")]
);

INSERT INTO `isb-cgc.GDC_metadata.rel17_aliquot2caseIDmap` (program_name, project_id, case_gdc_id, case_barcode, sample_gdc_id, sample_barcode, sample_type, sample_type_name, sample_is_ffpe, sample_preservation_method, portion_gdc_id, portion_barcode, analyte_gdc_id, analyte_barcode, aliquot_gdc_id, aliquot_barcode) VALUES ('TCGA', 'TCGA-BLCA', '556fcbc8-172a-4af1-8822-ae036e8d68e8', 'TCGA-BL-A13J', 'a696305c-e8c6-40d3-aa4c-1738d0987885', 'TCGA-BL-A13J-01B', '01', 'Primary Tumor', 'True', NULL, 'c5a66d5e-2a67-43a7-8218-b97b2a7ad5ff', 'TCGA-BL-A13J-01B-04', 'a7ff83a3-f404-42c7-aacc-979a35ec297f', 'TCGA-BL-A13J-01B-04D', 'a62600bd-a186-4dde-b2a1-ebaed5173f28', 'TCGA-BL-A13J-01B-04D-A271-08'), ('TCGA', 'TCGA-BLCA', '556fcbc8-172a-4af1-8822-ae036e8d68e8', 'TCGA-BL-A13J', 'a696305c-e8c6-40d3-aa4c-1738d0987885', 'TCGA-BL-A13J-01B', '01', 'Primary Tumor', 'True', NULL, 'c5a66d5e-2a67-43a7-8218-b97b2a7ad5ff', 'TCGA-BL-A13J-01B-04', 'a7ff83a3-f404-42c7-aacc-979a35ec297f', 'TCGA-BL-A13J-01B-04D', 'a9a3c98d-6e7e-4a2c-afb1-cf9b220d78bc', 'TCGA-BL-A13J-01B-04D-A46W-08'), ('TCGA', 'TCGA-BLCA', '556fcbc8-172a-4af1-8822-ae036e8d68e8', 'TCGA-BL-A13J', 'a696305c-e8c6-40d3-aa4c-1738d0987885', 'TCGA-BL-A13J-01B', '01', 'Primary Tumor', 'True', NULL, 'c5a66d5e-2a67-43a7-8218-b97b2a7ad5ff', 'TCGA-BL-A13J-01B-04', 'a7ff83a3-f404-42c7-aacc-979a35ec297f', 'TCGA-BL-A13J-01B-04D', 'cb14ec4c-1dcb-435b-b93e-65680a2ef496', 'TCGA-BL-A13J-01B-04D-A273-01'), ('TCGA', 'TCGA-BLCA', '556fcbc8-172a-4af1-8822-ae036e8d68e8', 'TCGA-BL-A13J', 'a696305c-e8c6-40d3-aa4c-1738d0987885', 'TCGA-BL-A13J-01B', '01', 'Primary Tumor', 'True', NULL, 'c5a66d5e-2a67-43a7-8218-b97b2a7ad5ff', 'TCGA-BL-A13J-01B-04', 'a7ff83a3-f404-42c7-aacc-979a35ec297f', 'TCGA-BL-A13J-01B-04D', 'ea128964-6084-44d3-b744-25070caf09e8', 'TCGA-BL-A13J-01B-04D-A276-05'), ('TCGA', 'TCGA-BLCA', '556fcbc8-172a-4af1-8822-ae036e8d68e8', 'TCGA-BL-A13J', 'a696305c-e8c6-40d3-aa4c-1738d0987885', 'TCGA-BL-A13J-01B', '01', 'Primary Tumor', 'True', NULL, 'c5a66d5e-2a67-43a7-8218-b97b2a7ad5ff', 'TCGA-BL-A13J-01B-04', 'ec3dc318-0c0a-4ff4-9a45-fbe47bac546a', 'TCGA-BL-A13J-01B-04R', '54bc6778-9c1c-4db6-8764-79ccd841f566', 'TCGA-BL-A13J-01B-04R-A46X-36');