-- DBMS: bigquery
CREATE TABLE `isb-cgc.GDC_metadata.rel13_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 entity case UUID"),
  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 case UUID"),
  cases__project__dbgap_accession_number STRING OPTIONS(description="Project dbGaP accession number"),
  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://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:03"),
  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="One of CGC, GSC, BCR, COM (or null)"),
  metadata_files__file_name STRING OPTIONS(description="Semicolon-delimited list of file tags, eg  coverage  , or  hg19;nocnv  , etc"),
  metadata_files__file_size STRING OPTIONS(description="GDC file UUID for metadata (eg mage-tab) file"),
  metadata_files__type STRING OPTIONS(description="Name of GDC metadata file"),
  platform STRING OPTIONS(description="Platform used to generate this data, eg  Illumina  , or  Affymetrix SNP 6.3"),
  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="Size of metadata file"),
  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 REL13",
  description="Data was generated from file metadata information from the GDC legacy archive release 13, October 2018. \nMore 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.rel13_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', '2d49657d-88ce-4b24-aa4a-bb1de2e543f6', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, '869f8a17-bced-4002-bd60-99df84a03b93', '39e7b768-f7c4-48c0-9ba7-66a6ed5464ff', 'TCGA-G3-A7M5-10A-01D-A33Q-10', 'aliquot', '869f8a17-bced-4002-bd60-99df84a03b93', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-G3-A7M5-10A-01D-A33Q-10_IonTorrent_validation.tar.bz2', 267865, '2d49657d-88ce-4b24-aa4a-bb1de2e543f6', NULL, NULL, NULL, 'abbf5c54ef6217248ff68ffbb5472078', NULL, NULL, NULL, NULL, NULL, 'live', '6aa81745-4041-4825-80af-8b3d569b554a', NULL, 'file', '2017-03-05T10:52:48.449603-06:00'), ('legacy', 'efe7f924-8d9d-4999-ae6d-d188bd70d3a0', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, '20bb3855-66e2-46d4-b189-006b4b254c2e', 'a83a44f3-45ec-4725-bef7-e1656fef6932', 'TCGA-ED-A7XO-10A-01D-A34Z-10', 'aliquot', '20bb3855-66e2-46d4-b189-006b4b254c2e', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-ED-A7XO-10A-01D-A34Z-10_IonTorrent_validation.tar.bz2', 256402, 'efe7f924-8d9d-4999-ae6d-d188bd70d3a0', NULL, NULL, NULL, '4bd4a30f66efb77879f22b780be19605', '445267cc-d63c-45f6-849a-faed45c465b2;7d8d2f61-6318-49b9-b29b-464ff4268ab1;deb5c834-3ea9-43a6-b07c-dba218362d2b', '066f054c-bdb7-4205-9db9-42a3602593bc_analysis.xml;066f054c-bdb7-4205-9db9-42a3602593bc_experiment.xml;066f054c-bdb7-4205-9db9-42a3602593bc_run.xml', '2516;33445;76830', NULL, NULL, 'live', '066f054c-bdb7-4205-9db9-42a3602593bc', NULL, 'file', '2017-03-05T12:45:35.461959-06:00'), ('legacy', 'ed3a57af-5b0e-4372-8d19-a6a717cbdca9', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, '7ba3d8f1-0c26-4c49-8d6b-0f2875b58daf', '9edcdb8d-6a27-4c45-a22e-30466a7e13cd', 'TCGA-KR-A7K7-10A-01D-A33K-10', 'aliquot', '7ba3d8f1-0c26-4c49-8d6b-0f2875b58daf', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-KR-A7K7-10A-01D-A33K-10_IonTorrent_validation.tar.bz2', 270558, 'ed3a57af-5b0e-4372-8d19-a6a717cbdca9', NULL, NULL, NULL, 'd46b3cd11ad0f6142a12809fa492d98e', '4b8ade23-1b53-4bbb-84ba-ae0047d2df0f;52e49579-b55f-4653-8701-9099c6b8bde5;f0648558-9eb8-489d-9156-0ca058cb1ffd', '84e575c0-2fc4-41d0-8856-27264510777b_analysis.xml;84e575c0-2fc4-41d0-8856-27264510777b_experiment.xml;84e575c0-2fc4-41d0-8856-27264510777b_run.xml', '2516;33445;76830', NULL, NULL, 'live', '84e575c0-2fc4-41d0-8856-27264510777b', NULL, 'file', '2017-03-05T18:29:06.340845-06:00'), ('legacy', '7004ca12-4e8d-4396-9569-26ee85ada766', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, 'fb322d32-d753-41cc-a21e-e47bf063d5bb', '6ae02049-78de-46c7-af90-146bd04cb94e', 'TCGA-KO-8415-11A-01D-2311-10', 'aliquot', 'fb322d32-d753-41cc-a21e-e47bf063d5bb', NULL, 'Kidney Chromophobe', 'Kidney Chromophobe', 'phs000178', 'TCGA', 'TCGA-KICH', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-KO-8415-11A-01D-2311-10_IonTorrent_validation.tar.bz2', 217761, '7004ca12-4e8d-4396-9569-26ee85ada766', NULL, NULL, NULL, '344ca25878965f188a75d9a61ee521b7', NULL, NULL, NULL, NULL, NULL, 'live', 'c895123d-0028-4a7a-b84f-df2afb93e5cf', NULL, 'file', '2017-03-05T10:40:31.049555-06:00'), ('legacy', '6352175c-9cde-4619-9e0a-ef1a1ec3c094', 'controlled', 'phs000178', NULL, NULL, NULL, NULL, '518aa9cc-71cf-4734-9d55-b435da99d300', 'c154a63e-d2e1-4abb-83fe-62a5a5a70b33', 'TCGA-DD-A4NI-01A-11D-A27I-10', 'aliquot', '518aa9cc-71cf-4734-9d55-b435da99d300', NULL, 'Liver Hepatocellular Carcinoma', 'Liver Hepatocellular Carcinoma', 'phs000178', 'TCGA', 'TCGA-LIHC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'TCGA-DD-A4NI-01A-11D-A27I-10_IonTorrent_validation.tar.bz2', 268483, '6352175c-9cde-4619-9e0a-ef1a1ec3c094', NULL, NULL, NULL, '995c8b6ac6ed3ce726a436b7975a6053', '1fdb1d9e-a992-4599-9063-7419fde036af;b4357c58-58b1-4bdb-8ac7-2efe7f9f7c06;f46d70a6-5f3a-4db8-b7ec-8612a3d1f93a', '6f8fa308-d0bf-4898-b516-6893e05878c7_analysis.xml;6f8fa308-d0bf-4898-b516-6893e05878c7_experiment.xml;6f8fa308-d0bf-4898-b516-6893e05878c7_run.xml', '2516;33244;76031', NULL, NULL, 'live', '6f8fa308-d0bf-4898-b516-6893e05878c7', NULL, 'file', '2017-03-05T18:47:49.005683-06:00');