-- DBMS: bigquery
CREATE TABLE `isb-cgc.GDC_metadata.rel12_fileData_legacy`
(
  dbName STRING OPTIONS(description="Referring to the default/main database at the GDC. In this table, this field is always legacy."),
  file_id STRING OPTIONS(description="GDC file identifier. This is a duplicate of file_gdc_id field found in some tables. "),
  `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__archive_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_id STRING OPTIONS(description="Associated Case ID"),
  associated_entities__entity_id STRING OPTIONS(description="Associated entity UUID"),
  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  "),
  cases__case_id STRING OPTIONS(description="Associated entity case UUID"),
  cases__project__dbgap_accession_number STRING OPTIONS(description="DbGaP accession number for the project"),
  cases__project__disease_type STRING OPTIONS(description="Project Disease Type"),
  cases__project__name STRING OPTIONS(description="Study name of the project"),
  cases__project__program__dbgap_accession_number STRING OPTIONS(description="DbGaP accession number for the program"),
  cases__project__program__name STRING OPTIONS(description="Program Name"),
  cases__project__project_id STRING OPTIONS(description="Program Short Name with Project Short Name"),
  center__center_type STRING OPTIONS(description="Type classification of the center"),
  center__code INT64 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:01"),
  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="File format of the underlying data, eg BCR XML, BAM"),
  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"),
  id STRING OPTIONS(description="GDC file identifier. This is a duplicate of file_gdc_id field found in some tables."),
  index_files__file_id STRING OPTIONS(description="BAM or VCF index file GDC file UUID"),
  index_files__file_name STRING OPTIONS(description="BAM or VCF index file name"),
  index_files__file_size INT64 OPTIONS(description="BAM  or VCF index file size"),
  md5sum STRING OPTIONS(description="Md5sum for GDC data file"),
  metadata_files__file_id STRING OPTIONS(description="GDC file UUID for metadata (eg mage-tab) file"),
  metadata_files__file_name STRING OPTIONS(description="Name of GDC metadata file"),
  metadata_files__file_size STRING OPTIONS(description="Size of metadata file"),
  metadata_files__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.1"),
  state STRING OPTIONS(description="File state -- either submitted or released"),
  submitter_id STRING OPTIONS(description="This can be used to identify a corresponding entry in the submitter's records. The GDC requires that submitter_id be unique for each entity within a project: the tuple (combination) of [ project_id, submitter_id ] is a unique key."),
  tags STRING OPTIONS(description="Semicolon-delimited list of file tags, eg.  coverage, or  hg19; nocnv , etc."),
  type STRING OPTIONS(description="Description of the data, e.g. clinical_supplement, aligned_reads"),
  updated_datetime STRING OPTIONS(description="Timestamp of latest update, eg 2017-03-04T16:37:26.081298-06:00")
)
OPTIONS(
  friendly_name="FILE DATA LEGACY REL12",
  description="Data was generated from file metadata information from the GDC legacy archive release 12 July 2018. More details:https://docs.gdc.cancer.gov/Data/Release_Notes/Data_Release_Notes/#data-release-130",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("source", "gdc"), ("reference_genome_0", "hg19"), ("status", "archived"), ("category", "metadata")]
);

INSERT INTO `isb-cgc.GDC_metadata.rel12_fileData_legacy` (dbName, file_id, access, acl, archive__archive_id, archive__revision, archive__state, archive__submitter_id, associated_entities__case_id, associated_entities__entity_id, associated_entities__entity_submitter_id, associated_entities__entity_type, cases__case_id, cases__project__dbgap_accession_number, cases__project__disease_type, cases__project__name, cases__project__program__dbgap_accession_number, cases__project__program__name, cases__project__project_id, center__center_type, center__code, center__name, center__short_name, created_datetime, data_category, data_format, data_type, experimental_strategy, file_name, file_size, id, index_files__file_id, index_files__file_name, index_files__file_size, md5sum, metadata_files__file_id, metadata_files__file_name, metadata_files__file_size, metadata_files__type, platform, state, submitter_id, tags, type, updated_datetime) VALUES ('legacy', '1362a4c9-de44-473f-9f1f-0ba85842c645', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, '0ff6364a-e6f4-47ca-a7e7-14705bf0a8df', '4c3eda94-56f4-46d3-8c88-50d476e773f6', 'TCGA-DD-A1ED-01A-11D-A152-10', 'aliquot', '0ff6364a-e6f4-47ca-a7e7-14705bf0a8df', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-DD-A1ED-01A-11D-A152-10_IonTorrent_validation.tar.bz2', 503723, '1362a4c9-de44-473f-9f1f-0ba85842c645', NULL, NULL, NULL, 'd9221a6eb1f3e9eb185114ce1eef0761', NULL, NULL, NULL, NULL, NULL, 'live', 'dc754925-669f-4770-9c9d-36a9838a18ee', NULL, 'file', '2017-03-05T09:28:11.866514-06:00'), ('legacy', '24e9e0e1-22fa-4d9d-ae11-2462b1de203b', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, '2854ffe8-1f77-497a-bf49-11e0189fee35', '0453b101-a327-4c98-b7a9-43e75637295d', 'TCGA-DD-A1EL-01A-11D-A45C-10', 'aliquot', '2854ffe8-1f77-497a-bf49-11e0189fee35', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-DD-A1EL-01A-11D-A45C-10_IonTorrent_validation.tar.bz2', 271156, '24e9e0e1-22fa-4d9d-ae11-2462b1de203b', NULL, NULL, NULL, 'f5468741ebd0539fd43518033c769c36', '29623e4e-2c71-499e-8394-e19a01928c51;90e54f7a-ec5a-4ead-acc5-1709c4e153a5;9fca8890-3031-46f7-b955-2e6f3fe974e5', '6b037ba3-0b74-403d-9e8c-37cc5bd91eef_analysis.xml;6b037ba3-0b74-403d-9e8c-37cc5bd91eef_experiment.xml;6b037ba3-0b74-403d-9e8c-37cc5bd91eef_run.xml', '2516;33244;76031', NULL, NULL, 'live', '6b037ba3-0b74-403d-9e8c-37cc5bd91eef', NULL, 'file', '2017-03-05T18:44:48.930055-06:00'), ('legacy', '65ad419f-02f6-404e-bc44-49b3fcfa75e2', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, 'e562c60c-8e6e-481f-ad4f-28b067437ece', '2a61c3d7-f0c1-45d1-9eca-02fb72e95c13', 'TCGA-KO-8414-01A-11D-2310-10', 'aliquot', 'e562c60c-8e6e-481f-ad4f-28b067437ece', NULL, 'Kidney Chromophobe', 'Kidney Chromophobe', 'phs000178', 'TCGA', 'TCGA-KICH', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-KO-8414-01A-11D-2310-10_IonTorrent_validation.tar.bz2', 218974, '65ad419f-02f6-404e-bc44-49b3fcfa75e2', NULL, NULL, NULL, '3d0f97fc0ff48f660120d6bd6997de69', NULL, NULL, NULL, NULL, NULL, 'live', '43c7a2a0-07a4-4d2d-a168-aecb1fbe0731', NULL, 'file', '2017-03-05T10:04:50.932248-06:00'), ('legacy', '8f80cb1b-bf07-4673-8e38-473fa5e2e54b', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, 'f31ba8ec-a3dd-4dd8-8d15-f6c5975ebe44', 'ea82c301-a5be-463a-9549-b493cd5c95d8', 'TCGA-KM-8441-10A-01D-2311-10', 'aliquot', 'f31ba8ec-a3dd-4dd8-8d15-f6c5975ebe44', NULL, 'Kidney Chromophobe', 'Kidney Chromophobe', 'phs000178', 'TCGA', 'TCGA-KICH', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-KM-8441-10A-01D-2311-10_IonTorrent_validation.tar.bz2', 219004, '8f80cb1b-bf07-4673-8e38-473fa5e2e54b', NULL, NULL, NULL, 'b0800562246df46d84374efc66cce5b7', 'd4be8b8f-8f33-4f87-a5d4-61491c574215;edc89c22-9dc6-4461-986c-836499ae0fc0;f7886f99-89dc-49e4-9690-e9be36aa6780', '9c25d9fe-23a8-47ae-8faf-6442764ae3a0_analysis.xml;9c25d9fe-23a8-47ae-8faf-6442764ae3a0_experiment.xml;9c25d9fe-23a8-47ae-8faf-6442764ae3a0_run.xml', '2516;32825;73910', NULL, NULL, 'live', '9c25d9fe-23a8-47ae-8faf-6442764ae3a0', NULL, 'file', '2017-03-05T10:43:30.695910-06:00'), ('legacy', '0d428692-d4b9-4117-b7fc-7d6ff0c92824', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, 'cebdafee-8ffd-4ee2-8dd1-9225e06623c2', 'f9ce62ee-6802-40bc-8021-23159fb6d4eb', 'TCGA-ED-A5KG-10A-01D-A27I-10', 'aliquot', 'cebdafee-8ffd-4ee2-8dd1-9225e06623c2', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-ED-A5KG-10A-01D-A27I-10_IonTorrent_validation.tar.bz2', 268720, '0d428692-d4b9-4117-b7fc-7d6ff0c92824', NULL, NULL, NULL, 'c42cc7cf9df66125705b881bb9ceb6ac', '2dd1bf23-7444-473c-9204-884d6e42b233;82b039e3-ca5c-4beb-9f6c-24211822dbdb;d0e2dd5a-2583-48ec-b36e-b2706f15d9d6', '2fae156b-d29e-4263-81ae-2a8c190ba47a_analysis.xml;2fae156b-d29e-4263-81ae-2a8c190ba47a_experiment.xml;2fae156b-d29e-4263-81ae-2a8c190ba47a_run.xml', '2516;33445;76830', NULL, NULL, 'live', '2fae156b-d29e-4263-81ae-2a8c190ba47a', NULL, 'file', '2017-03-05T12:45:35.461959-06:00');