-- DBMS: bigquery
CREATE TABLE `isb-cgc.GDC_metadata.rel18_fileData_legacy`
(
  dbName STRING OPTIONS(description="Referring to the default/main database at the GDC. In this table, this field is always legacy."),
  file_gdc_id STRING OPTIONS(description="Unique GDC identifier for this file (corresponds to the file_barcode)  --  this can be used to access more information from the GDC data portal like this: https://portal.gdc.cancer.gov/files/c21b332c-06c6-4403-9032-f91c8f407ba5"),
  `access` STRING OPTIONS(description="Data accessibility policy (open or controlled)"),
  acl STRING OPTIONS(description="Access Control List -- if access is controlled, this field contains the dbGaP accession, eg phs000179"),
  archive_gdc_id STRING OPTIONS(description="GDC archive UUID"),
  archive_revision INT64 OPTIONS(description="Archive revision number"),
  archive_state STRING OPTIONS(description="Archive state"),
  archive_submitter_id STRING OPTIONS(description="Original archive sumbitter name, eg  nationwidechildrens.org_BRCA.bio.Level_1.56"),
  associated_entities__case_gdc_id STRING OPTIONS(description="GDC case uuid for associated case(s)"),
  associated_entities__entity_gdc_id STRING OPTIONS(description="GDC entity uuid for associated entity(ies)"),
  associated_entities__entity_submitter_id STRING OPTIONS(description="Submitter id for associated entity(ies)"),
  associated_entities__entity_type STRING OPTIONS(description="Associated entity type, eg   aliquot   or   case  "),
  case_gdc_id STRING OPTIONS(description="GDC unique identifier"),
  project_dbgap_accession_number STRING OPTIONS(description="Program dbGaP accession number, eg phs000189"),
  project_disease_type STRING OPTIONS(description="The type of disease studied by the project; e.g. Sarcoma,  Breast Invasive Carcinoma,Acute Lymphoblastic Leukemia, etc"),
  project_name STRING OPTIONS(description="Project Name; frequently the same as or similar to the project disease type eg   Acute Lymphoblastic Leukemia - Phase II   or   Breast Invasive Carcinoma   etc"),
  program_dbgap_accession_number STRING OPTIONS(description="Program dbGaP accession number, eg phs000178"),
  program_name STRING OPTIONS(description="Program name, eg TCGA or TARGET"),
  project_short_name STRING OPTIONS(description="Project name abbreviation; the program name appended with a project name abbreviation; eg. TCGA-OV, etc."),
  center_type STRING OPTIONS(description="One of CGC, GSC, BCR, COM (or null)"),
  center_code STRING OPTIONS(description="TCGA codes for the Professional Organization or Group (Center) which has submitted the data, more info: https://gdc.cancer.gov/resources-TCGA-users/TCGA-code-tables/center-codes"),
  center_name STRING OPTIONS(description="Center name, eg BCM, BI, WUGSC "),
  center_short_name STRING OPTIONS(description="Center abbreviation, eg WUSM"),
  created_datetime STRING OPTIONS(description="Timestamp of creation, eg 2016-10-27T21:58:12.297090-05:11"),
  data_category STRING OPTIONS(description="Category description of the underlying data, eg Clinical, Raw Sequencing Data, Simple Nucleotide Variation, Transcriptome Profiling  , etc"),
  data_format STRING OPTIONS(description="File format of the underlying data, eg BCR XML, BAM"),
  data_type STRING OPTIONS(description="Experimental source of the data type, eg Tissue slide image, RNA-Seq"),
  experimental_strategy STRING OPTIONS(description="Experimental strategy used to generate data (where applicable) e.g. WXS, RNA-Seq"),
  file_name STRING OPTIONS(description="Name of file at the GDC"),
  file_size INT64 OPTIONS(description="The size of the file measured in bytes"),
  file_id STRING OPTIONS(description="GDC file identifier. This is a duplicate of file_gdc_id field found in some tables. "),
  index_file_gdc_id STRING OPTIONS(description="Where available, GDC file uuid for index file "),
  index_file_name STRING OPTIONS(description="Where available, GDC file name for index file "),
  index_file_size INT64 OPTIONS(description="Where available, size of the index file in bytes "),
  md5sum STRING OPTIONS(description="Md5sum for GDC data file"),
  metadata_file_id STRING OPTIONS(description="GDC file UUID for metadata (eg mage-tab) file"),
  metadata_file_name STRING OPTIONS(description="Name of GDC metadata file"),
  metadata_file_size STRING OPTIONS(description="Size of metadata file"),
  metadata_file_type STRING OPTIONS(description="Type of metadata file, eg mage-tab"),
  platform STRING OPTIONS(description="Platform used to generate this data, eg  Illumina  , or  Affymetrix SNP 6.11"),
  file_state STRING OPTIONS(description="File state -- either live or submitted"),
  file_submitter_id STRING OPTIONS(description="Original submitter file ID (eg CGHub analysis_id)"),
  file_tags STRING OPTIONS(description="Semicolon-delimited list of file tags, eg  coverage  , or  hg19;nocnv  , etc"),
  file_type STRING OPTIONS(description="File Type  -- eg aligned_reads, simple_somatic_mutation, gene_expression, etc"),
  updated_datetime STRING OPTIONS(description="Timestamp of latest update, eg 2017-03-04T16:37:26.081298-06:00")
)
OPTIONS(
  friendly_name="FILE DATA LEGACY REL18",
  description="Data corresponding to file metadata information at the time of the GDC release 18. Actual legacy endpoint download was on Oct 18, 2019. \nMore details: https://docs.gdc.cancer.gov/Data/Release_Notes/Data_Release_Notes/#data-release-180",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("source", "gdc"), ("reference_genome_0", "hg19"), ("status", "archived"), ("category", "metadata")]
);

INSERT INTO `isb-cgc.GDC_metadata.rel18_fileData_legacy` (dbName, file_gdc_id, access, acl, archive_gdc_id, archive_revision, archive_state, archive_submitter_id, associated_entities__case_gdc_id, associated_entities__entity_gdc_id, associated_entities__entity_submitter_id, associated_entities__entity_type, case_gdc_id, project_dbgap_accession_number, project_disease_type, project_name, program_dbgap_accession_number, program_name, project_short_name, center_type, center_code, center_name, center_short_name, created_datetime, data_category, data_format, data_type, experimental_strategy, file_name, file_size, file_id, index_file_gdc_id, index_file_name, index_file_size, md5sum, metadata_file_id, metadata_file_name, metadata_file_size, metadata_file_type, platform, file_state, file_submitter_id, file_tags, file_type, updated_datetime) VALUES ('legacy', '30faa56e-5c39-4d90-bc4c-1d22a5c968bd', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, '7f8e25d4-6021-4327-96ab-79b6fcc97a24', '06f66113-568b-43cd-a4f5-a6b4356cd508', 'TCGA-HP-A5N0-10A-01D-A28X-10', 'aliquot', '7f8e25d4-6021-4327-96ab-79b6fcc97a24', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-HP-A5N0-10A-01D-A28X-10_IonTorrent_validation.tar.bz2', 270843, '30faa56e-5c39-4d90-bc4c-1d22a5c968bd', NULL, NULL, NULL, '4de8fe01842928a9be7c172c7a72a1d6', '24733367-bb5a-49ef-8e29-c14144470687;708488c0-0e9e-42f6-982b-d9d7568e1bcd;b3b7bf79-689a-4375-904c-912ee574381f', '8707310b-2908-4208-a26a-6b96e71fb256_analysis.xml;8707310b-2908-4208-a26a-6b96e71fb256_experiment.xml;8707310b-2908-4208-a26a-6b96e71fb256_run.xml', '2516;33445;76830', NULL, NULL, 'live', '8707310b-2908-4208-a26a-6b96e71fb256', NULL, 'file', '2017-03-05T15:46:38.221013-06:00'), ('legacy', '716b887e-6216-48c5-a2e3-6c4aea3cf7e8', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, 'e0067280-2722-46f2-a5a8-352c77b47e38', '04c60928-59b2-44bf-9d49-57bfbdd82528', 'TCGA-DD-A4NL-11A-11D-A28X-10', 'aliquot', 'e0067280-2722-46f2-a5a8-352c77b47e38', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-DD-A4NL-11A-11D-A28X-10_IonTorrent_validation.tar.bz2', 276463, '716b887e-6216-48c5-a2e3-6c4aea3cf7e8', NULL, NULL, NULL, '1f8aaaa0ffd0d684b76ad37fc611bf42', '04c28af3-bce5-4a10-aa82-4bfb3556f9ad;07b10da0-ed3e-4694-bc0b-582351c90136;ad8b7482-721f-473a-ae6e-34d8198934c0', '7c58953b-2985-427d-ad40-62669611f198_analysis.xml;7c58953b-2985-427d-ad40-62669611f198_experiment.xml;7c58953b-2985-427d-ad40-62669611f198_run.xml', '2516;33445;76830', NULL, NULL, 'live', '7c58953b-2985-427d-ad40-62669611f198', NULL, 'file', '2017-03-05T15:48:49.485966-06:00'), ('legacy', '18a7fc62-bc57-44aa-a722-9d61cdd79c30', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, '151f07f5-1529-4fcd-912c-e55b2ff8abef', '60f94151-bbc5-4bea-a081-b0247bdbabb3', 'TCGA-KO-8407-11A-01D-2311-10', 'aliquot', '151f07f5-1529-4fcd-912c-e55b2ff8abef', NULL, 'Kidney Chromophobe', 'Kidney Chromophobe', 'phs000178', 'TCGA', 'TCGA-KICH', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-KO-8407-11A-01D-2311-10_IonTorrent_validation.tar.bz2', 219263, '18a7fc62-bc57-44aa-a722-9d61cdd79c30', NULL, NULL, NULL, 'ea23dfd7a0681eeb29f4e09998b90074', '6544ca69-57ed-4a2c-836c-fcd54227e611;7bc5f89c-37fc-419a-b3b0-30e5744b3deb;935a7928-1114-4f71-85d5-8fa1e12a76c2', '66f255d1-7c63-4bbc-8ea0-b433536d2cfb_analysis.xml;66f255d1-7c63-4bbc-8ea0-b433536d2cfb_experiment.xml;66f255d1-7c63-4bbc-8ea0-b433536d2cfb_run.xml', '2516;33043;75326', NULL, NULL, 'live', '66f255d1-7c63-4bbc-8ea0-b433536d2cfb', NULL, 'file', '2017-03-05T18:21:18.577009-06:00'), ('legacy', '7a6cde07-0e8c-491e-b308-a21f4090a3c7', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, '68015cc7-d3a1-4c90-b8fb-5d14143d9960', '90611290-e44c-438e-91aa-f3b83dae3b71', 'TCGA-DD-A1EB-01A-11D-A12Z-10', 'aliquot', '68015cc7-d3a1-4c90-b8fb-5d14143d9960', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-DD-A1EB-01A-11D-A12Z-10_IonTorrent_validation.tar.bz2', 499347, '7a6cde07-0e8c-491e-b308-a21f4090a3c7', NULL, NULL, NULL, '6463aec273d12374ff066f3d8cbf548b', '04f2395e-b508-4e2a-910b-e4c298d53460;914180d0-b0a2-448b-ab3b-dd9b262a5287;d7fca106-b5b8-4fd0-8c74-5f1d44b17581', '89a06ab3-254a-47d8-9e0d-aea393e0c36b_analysis.xml;89a06ab3-254a-47d8-9e0d-aea393e0c36b_experiment.xml;89a06ab3-254a-47d8-9e0d-aea393e0c36b_run.xml', '4771;51859;152682', NULL, NULL, 'live', '89a06ab3-254a-47d8-9e0d-aea393e0c36b', NULL, 'file', '2017-03-05T11:18:26.999142-06:00'), ('legacy', '7533e06d-b0e7-43bd-add3-72311003a08c', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, '3134f7d1-3359-497a-b8be-1f317d8ddaaa', 'a92d8653-0336-44c4-8357-057d6491916c', 'TCGA-K7-A5RF-11A-11D-A28X-10', 'aliquot', '3134f7d1-3359-497a-b8be-1f317d8ddaaa', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-K7-A5RF-11A-11D-A28X-10_IonTorrent_validation.tar.bz2', 269211, '7533e06d-b0e7-43bd-add3-72311003a08c', NULL, NULL, NULL, 'cff0c5a5099c01600e7113566b9b6522', '0406c43e-d928-4c67-943c-8c6e407148c4;590f027c-7871-4bb6-86d2-452ab3c780e4;98b1329a-4fbf-4b4b-82ff-2f53d48171e5', '68e9d68d-e892-42aa-a7e1-8a5660630f70_analysis.xml;68e9d68d-e892-42aa-a7e1-8a5660630f70_experiment.xml;68e9d68d-e892-42aa-a7e1-8a5660630f70_run.xml', '2516;33445;76830', NULL, NULL, 'live', '68e9d68d-e892-42aa-a7e1-8a5660630f70', NULL, 'file', '2017-03-05T11:22:29.164094-06:00');