-- DBMS: bigquery
CREATE TABLE `isb-cgc.GDC_metadata.rel14_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-f91c8f407ba3"),
  `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 submitter 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 phs000180"),
  project_disease_type STRING OPTIONS(description="The type of disease studied by the project; eg. 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://gdccancergov/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:05"),
  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.5"),
  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 REL14",
  description="Data was generated from file metadata information from the GDC legacy archive release 14, December 2018. More details: https://docs.gdc.cancer.gov/Data/Release_Notes/Data_Release_Notes/#data-release-140",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("source", "gdc"), ("reference_genome_0", "hg19"), ("status", "archived"), ("category", "metadata")]
);

INSERT INTO `isb-cgc.GDC_metadata.rel14_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', '854cb97e-901a-4c65-ad72-2c001068619a', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, '1983fade-44f1-41e0-8983-f2ce8d649655', '5d58b984-e0b8-4237-a576-0e9d4079599e', 'TCGA-DD-A4NB-01A-12D-A25V-10', 'aliquot', '1983fade-44f1-41e0-8983-f2ce8d649655', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-DD-A4NB-01A-12D-A25V-10_IonTorrent_validation.tar.bz2', 490891, '854cb97e-901a-4c65-ad72-2c001068619a', NULL, NULL, NULL, 'ef8a806a356043fdd639aa9104a5d172', NULL, NULL, NULL, NULL, NULL, 'live', '336ddda1-9496-4f22-bc16-1da93b1997de', NULL, 'file', '2017-03-05T10:11:44.298823-06:00'), ('legacy', '389cab31-ecf6-4f57-8e36-eee6cb29ca5d', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, '1b428ada-eb3f-40c2-b4bf-1bbf6b61729d', '47e5ff56-9534-4fcf-a593-33027e877f93', 'TCGA-CC-5262-01A-01D-A21X-10', 'aliquot', '1b428ada-eb3f-40c2-b4bf-1bbf6b61729d', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-CC-5262-01A-01D-A21X-10_IonTorrent_validation.tar.bz2', 498587, '389cab31-ecf6-4f57-8e36-eee6cb29ca5d', NULL, NULL, NULL, '67ecb8c717b88d866a8447269a8ae62d', NULL, NULL, NULL, NULL, NULL, 'live', '9784ed01-3b72-4d2f-9786-35a852e5dcd5', NULL, 'file', '2017-03-05T16:39:11.232851-06:00'), ('legacy', '3dc2b0bf-cfb9-4815-b311-ff1d656775ba', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, 'b5465221-78fe-40a8-abec-bed600602dd4', '4a2e4e6a-8fef-4c74-968b-c0e269634c4f', 'TCGA-G3-A3CI-10A-01D-A20W-10', 'aliquot', 'b5465221-78fe-40a8-abec-bed600602dd4', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-G3-A3CI-10A-01D-A20W-10_IonTorrent_validation.tar.bz2', 244619, '3dc2b0bf-cfb9-4815-b311-ff1d656775ba', NULL, NULL, NULL, '8f98be7d7be3bdec44730462d56341a1', NULL, NULL, NULL, NULL, NULL, 'live', '9bf4c710-c787-4935-87ce-437934bc6764', NULL, 'file', '2017-03-05T15:48:49.485966-06:00'), ('legacy', '3cddf495-809e-4b84-8068-3da0512c8fef', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, '010d5817-9a3f-4a06-8643-653116c044ff', '08d2414c-c7d1-47bc-b387-9302d862a298', 'TCGA-MI-A75E-10A-01D-A32G-10', 'aliquot', '010d5817-9a3f-4a06-8643-653116c044ff', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-MI-A75E-10A-01D-A32G-10_IonTorrent_validation.tar.bz2', 272150, '3cddf495-809e-4b84-8068-3da0512c8fef', NULL, NULL, NULL, '2361980a2073dfaa31834e5b09e1828c', '0e8f5b08-717e-41d5-bb8c-29c6fac32d0e;3b9da9fa-743c-47d4-ab75-3923743448ce;d2383e25-cd51-4fd7-9f72-90be37002187', 'f22ad2bd-45db-43ee-b7b8-410264134bde_analysis.xml;f22ad2bd-45db-43ee-b7b8-410264134bde_experiment.xml;f22ad2bd-45db-43ee-b7b8-410264134bde_run.xml', '2516;33445;76830', NULL, NULL, 'live', 'f22ad2bd-45db-43ee-b7b8-410264134bde', NULL, 'file', '2017-03-05T11:41:19.414807-06:00'), ('legacy', '610f7fa4-21e3-4510-9f09-928e96b50d4a', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, 'e1e15226-9f8e-4035-8f08-eb1fed57080e', '24f887e1-ce82-40f3-9674-11102bd076c0', 'TCGA-KN-8434-01A-11D-2310-10', 'aliquot', 'e1e15226-9f8e-4035-8f08-eb1fed57080e', NULL, 'Kidney Chromophobe', 'Kidney Chromophobe', 'phs000178', 'TCGA', 'TCGA-KICH', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-KN-8434-01A-11D-2310-10_IonTorrent_validation.tar.bz2', 219459, '610f7fa4-21e3-4510-9f09-928e96b50d4a', NULL, NULL, NULL, 'd0d4e8c608aa5e20eaacc42fa09d01f1', NULL, NULL, NULL, NULL, NULL, 'live', '6afc970b-1022-40a0-8901-3f2045f53308', NULL, 'file', '2017-03-04T20:50:29.506652-06:00');