-- DBMS: bigquery
CREATE TABLE `isb-cgc.GDC_metadata.rel12_fileData_current`
(
  dbName STRING OPTIONS(description="Referring to the default/main database at the GDC. In this table, this field is always current."),
  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"),
  analysis__input_files__file_id STRING OPTIONS(description="GDC archive UUID"),
  analysis__workflow_link STRING OPTIONS(description="Link to GDC workflow on github"),
  analysis__workflow_type STRING OPTIONS(description="Workflow name eg  STAR 2-Pass  "),
  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 sumbitter 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="Project ID"),
  created_datetime STRING OPTIONS(description="Timestamp of creation, eg 2016-10-27T21:58:12.297090-05:00"),
  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"),
  downstream_analyses__output_files__file_id STRING OPTIONS(description="Semicolon-separated list of GDC file UUIDs"),
  downstream_analyses__workflow_link STRING OPTIONS(description="Name of GDC workflow, eg VarScan2 Annotation (if applicable, NULL where no information is available)"),
  downstream_analyses__workflow_type STRING OPTIONS(description="Name of GDC workflow, eg VarScan2 Annotation (if applicable, NULL where no information is available)"),
  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_state STRING OPTIONS(description="File state -- either live or submitted"),
  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"),
  platform STRING OPTIONS(description="Platform used to generate this data, eg  Illumina  , or  Affymetrix SNP 6.0 "),
  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."),
  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 ACTIVE REL12 ",
  description="Data was generated from file metadata information from the GDC current archive release 12 in July 2018. More details https://docs.gdc.cancer.gov/Data/Release_Notes/Data_Release_Notes/#data-release-120",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("source", "gdc"), ("reference_genome_0", "hg38"), ("status", "archived"), ("category", "metadata")]
);

INSERT INTO `isb-cgc.GDC_metadata.rel12_fileData_current` (dbName, file_id, access, acl, analysis__input_files__file_id, analysis__workflow_link, analysis__workflow_type, 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, created_datetime, data_category, data_format, data_type, downstream_analyses__output_files__file_id, downstream_analyses__workflow_link, downstream_analyses__workflow_type, experimental_strategy, file_name, file_size, file_state, id, index_files__file_id, index_files__file_name, index_files__file_size, md5sum, platform, state, submitter_id, type, updated_datetime) VALUES ('current', '575ddfdc-2aeb-4860-bbdf-1247283152ee', 'open', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '6e22b287-5b45-4f5f-a825-b200aa6943e6', 'e7101ef3-981a-44b0-80ee-27a31d3f7500', 'TCGA-N9-A4Q8-01A-03-TS3', 'slide', '6e22b287-5b45-4f5f-a825-b200aa6943e6', NULL, 'Uterine Carcinosarcoma', 'Uterine Carcinosarcoma', 'phs000178', 'TCGA', 'TCGA-UCS', '2018-02-23T13:22:23.877785-06:00', 'Biospecimen', 'SVS', 'Slide Image', NULL, NULL, NULL, 'Tissue Slide', 'TCGA-N9-A4Q8-01A-03-TS3.E7101EF3-981A-44B0-80EE-27A31D3F7500.svs', 324929315, 'submitted', '575ddfdc-2aeb-4860-bbdf-1247283152ee', NULL, NULL, NULL, '2644e81bc1febcb8d9e00d57e44313f3', NULL, 'submitted', 'TCGA-N9-A4Q8-01A-03-TS3_slide_image', 'slide_image', '2018-05-29T16:36:35.208205-05:00'), ('current', '04e700d7-9f48-408a-8183-508ec9c1867c', 'open', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'ffedc8be-1056-4205-b9d9-99b5bdb872db', '3c35f4bf-8726-4986-a8fc-4cafb2b0baf5', 'TCGA-N9-A4Q4-01A-01-TS1', 'slide', 'ffedc8be-1056-4205-b9d9-99b5bdb872db', NULL, 'Uterine Carcinosarcoma', 'Uterine Carcinosarcoma', 'phs000178', 'TCGA', 'TCGA-UCS', '2018-02-23T13:22:23.877785-06:00', 'Biospecimen', 'SVS', 'Slide Image', NULL, NULL, NULL, 'Tissue Slide', 'TCGA-N9-A4Q4-01A-01-TS1.3C35F4BF-8726-4986-A8FC-4CAFB2B0BAF5.svs', 188301819, 'submitted', '04e700d7-9f48-408a-8183-508ec9c1867c', NULL, NULL, NULL, '690bb52f46b19340afdc464d0ec18762', NULL, 'submitted', 'TCGA-N9-A4Q4-01A-01-TS1_slide_image', 'slide_image', '2018-05-29T16:36:35.208205-05:00'), ('current', '8da4f000-6ed8-4e91-a1fd-485fcdad44aa', 'open', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'ce2b2c41-7d28-4d8b-a037-af842a8fe20f', '6365c539-7882-44d5-846e-dd4dd804fa2e', 'TCGA-NA-A4QY-01A-01-TSA', 'slide', 'ce2b2c41-7d28-4d8b-a037-af842a8fe20f', NULL, 'Uterine Carcinosarcoma', 'Uterine Carcinosarcoma', 'phs000178', 'TCGA', 'TCGA-UCS', '2018-02-23T13:22:23.877785-06:00', 'Biospecimen', 'SVS', 'Slide Image', NULL, NULL, NULL, 'Tissue Slide', 'TCGA-NA-A4QY-01A-01-TSA.6365C539-7882-44D5-846E-DD4DD804FA2E.svs', 241727729, 'submitted', '8da4f000-6ed8-4e91-a1fd-485fcdad44aa', NULL, NULL, NULL, 'a9d4a13285d5844991c9e187cfe6a2f4', NULL, 'submitted', 'TCGA-NA-A4QY-01A-01-TSA_slide_image', 'slide_image', '2018-05-29T16:36:35.208205-05:00'), ('current', '17691c3f-6294-4529-bade-9d9e8e2d9954', 'open', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '76b0106c-a4d2-4b29-bef4-fe03a25b5d21', 'dd38d43c-ce26-4739-b9c0-535b38c76172', 'TCGA-N9-A4PZ-01A-02-TS2', 'slide', '76b0106c-a4d2-4b29-bef4-fe03a25b5d21', NULL, 'Uterine Carcinosarcoma', 'Uterine Carcinosarcoma', 'phs000178', 'TCGA', 'TCGA-UCS', '2018-02-23T13:22:23.877785-06:00', 'Biospecimen', 'SVS', 'Slide Image', NULL, NULL, NULL, 'Tissue Slide', 'TCGA-N9-A4PZ-01A-02-TS2.DD38D43C-CE26-4739-B9C0-535B38C76172.svs', 170780959, 'submitted', '17691c3f-6294-4529-bade-9d9e8e2d9954', NULL, NULL, NULL, '8c65d44f25c52b9bf871d252dada2893', NULL, 'submitted', 'TCGA-N9-A4PZ-01A-02-TS2_slide_image', 'slide_image', '2018-05-29T16:36:35.208205-05:00'), ('current', '957c5d7b-bd90-43f9-a4e5-87fed44768b3', 'open', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '76b0106c-a4d2-4b29-bef4-fe03a25b5d21', 'a00fd426-c965-4068-b50d-6e16b5f91f93', 'TCGA-N9-A4PZ-11A-01-TS1', 'slide', '76b0106c-a4d2-4b29-bef4-fe03a25b5d21', NULL, 'Uterine Carcinosarcoma', 'Uterine Carcinosarcoma', 'phs000178', 'TCGA', 'TCGA-UCS', '2018-02-23T13:22:23.877785-06:00', 'Biospecimen', 'SVS', 'Slide Image', NULL, NULL, NULL, 'Tissue Slide', 'TCGA-N9-A4PZ-11A-01-TS1.A00FD426-C965-4068-B50D-6E16B5F91F93.svs', 46431155, 'submitted', '957c5d7b-bd90-43f9-a4e5-87fed44768b3', NULL, NULL, NULL, 'd9b6856e1a7fd979c1284e3328743b64', NULL, 'submitted', 'TCGA-N9-A4PZ-11A-01-TS1_slide_image', 'slide_image', '2018-05-29T16:36:35.208205-05:00');