-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.bulkWES_level1_metadata_r4`
(
  HTAN_Data_File_ID STRING OPTIONS(description="Self-identifier for this data file - HTAN ID of this file HTAN ID SOP (eg HTANx_yyy_zzz)"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Adapter_Sequence STRING OPTIONS(description="Base sequence of the sequencing adapter. String"),
  Library_Selection_Method STRING OPTIONS(description="How RNA molecules are isolated."),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  Adapter_Name STRING OPTIONS(description="Name of the sequencing adapter. String"),
  Flow_Cell_Barcode STRING OPTIONS(description="Flow cell barcode. Wrong or missing information may affect analysis results. String"),
  Fragment_Maximum_Length STRING OPTIONS(description="Maximum length of the sequenced fragments (e.g., as predicted by Agilent Bioanalyzer). Integer"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Library_Preparation_Kit_Vendor STRING OPTIONS(description="Vendor of Library Preparation Kit. String"),
  Size_Selection_Range STRING OPTIONS(description="Range of size selection. String"),
  To_Trim_Adapter_Sequence STRING OPTIONS(description="Does the user suggest adapter trimming?"),
  Library_Preparation_Days_from_Index STRING OPTIONS(description="Number of days between sample for assay was received in lab and the libraries were prepared for sequencing [number]. If not applicable please enter 'Not Applicable'"),
  Fragment_Standard_Deviation_Length STRING OPTIONS(description="Standard deviation of the sequenced fragments length (e.g., as predicted by Agilent Bioanalyzer). Number"),
  Multiplex_Barcode STRING OPTIONS(description="The barcode/index sequence used. Wrong or missing information may affect analysis results. String"),
  HTAN_Parent_Biospecimen_ID STRING OPTIONS(description="HTAN Biospecimen Identifier (eg HTANx_yyy_zzz) indicating the biospecimen(s) from which these files were derived; multiple parent biospecimen should be comma-separated"),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  Sequencing_Batch_ID STRING OPTIONS(description="Links samples to a specific local sequencer run. Can be string or 'null'"),
  Library_Preparation_Kit_Version STRING OPTIONS(description="Version of Library Preparation Kit. String"),
  Library_Layout STRING OPTIONS(description="Sequencing read type"),
  Filename STRING OPTIONS(description="Name of a file"),
  Base_Caller_Version STRING OPTIONS(description="Version of the base caller. String"),
  Lane_Number STRING OPTIONS(description="The basic machine unit for sequencing. For Illumina machines, this reflects the physical lane number. Wrong or missing information may affect analysis results. Integer"),
  Read_Indicator STRING OPTIONS(description="Indicate if this is Read 1 (R1) or Read 2 (R2)"),
  Base_Caller_Name STRING OPTIONS(description="Name of the base caller. String"),
  Sequencing_Platform STRING OPTIONS(description="A platform is an object aggregate that is the set of instruments and software needed to perform a process [OBI_0000050]. Specific model of the sequencing instrument."),
  Fragment_Minimum_Length STRING OPTIONS(description="Minimum length of the sequenced fragments (e.g., as predicted by Agilent Bioanalyzer). Integer"),
  Fragment_Mean_Length STRING OPTIONS(description="Mean length of the sequenced fragments (e.g., as predicted by Agilent Bioanalyzer). Number"),
  Target_Capture_Kit STRING OPTIONS(description="Description that can uniquely identify a target capture kit. Suggested value is a combination of vendor, kit name, and kit version."),
  Library_Preparation_Kit_Name STRING OPTIONS(description="Name of Library Preparation Kit. String"),
  Read_Length STRING OPTIONS(description="The length of the sequencing reads. Can be integer, null"),
  Target_Depth STRING OPTIONS(description="The targeted read depth prior to sequencing. Integer"),
  HTAN_Center STRING OPTIONS(description="Name of HTAN Center e.g. HTAN HTAPP"),
  Manifest_Id STRING OPTIONS(description="Synapse ID of manifest containing file annotation"),
  Manifest_Version INT64 OPTIONS(description="Latest version of metadata manifest"),
  File_Size INT64 OPTIONS(description="Size of file (bucket object) in bytes"),
  md5 STRING OPTIONS(description="md5 hash of file"),
  Data_Release STRING OPTIONS(description="Inclusion in HTAN Data Release e.g. Release 1.0"),
  CDS_Release STRING OPTIONS(description="CDS transfer package in which file was included e.g. v22.6.1.seq")
)
OPTIONS(
  friendly_name="HTAN BULKWES LEVEL 1 METADATA R4 VERSIONED",
  description="This table contains the file metadata for first level (i.e. fastq) bulk whole exome sequencing data extracted from HTAN Synapse projects in October 2023. More details: see https://data.humantumoratlas.org/standard/sequencing",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("program", "htan"), ("source", "htan"), ("category", "metadata"), ("status", "current")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.bulkWES_level1_metadata_r4` (HTAN_Data_File_ID, Id, Adapter_Sequence, Library_Selection_Method, entityId, Adapter_Name, Flow_Cell_Barcode, Fragment_Maximum_Length, Component, Library_Preparation_Kit_Vendor, Size_Selection_Range, To_Trim_Adapter_Sequence, Library_Preparation_Days_from_Index, Fragment_Standard_Deviation_Length, Multiplex_Barcode, HTAN_Parent_Biospecimen_ID, File_Format, Sequencing_Batch_ID, Library_Preparation_Kit_Version, Library_Layout, Filename, Base_Caller_Version, Lane_Number, Read_Indicator, Base_Caller_Name, Sequencing_Platform, Fragment_Minimum_Length, Fragment_Mean_Length, Target_Capture_Kit, Library_Preparation_Kit_Name, Read_Length, Target_Depth, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('HTA9_1_1097', 'ed162cea-13c1-4baf-b50f-603494d881df', NULL, 'Hybrid Selection', 'syn23640140', NULL, NULL, NULL, 'BulkWESLevel1', 'Not Applicable', NULL, NULL, NULL, NULL, NULL, 'HTA9_1_86', 'fastq', 'Not Applicable', 'Not Applicable', 'Paired End', 'bulk_dnaseq_level_1/a7a3be30-dded-4ce1-aa04-a934b29ea0e7_R1.fq.gz', NULL, NULL, 'R1', NULL, 'unknown', NULL, NULL, 'unknown', 'Not Applicable', '126', NULL, 'HTAN OHSU', 'syn39140863', 5, 9380236289, '422674e6f02d88f0ea7b9b55eb0daded', 'Release 1.0', 'v21.9.1.seq'), ('HTA9_1_1118', '7df01bbf-f541-4f55-8532-ca69bea63ded', NULL, 'Hybrid Selection', 'syn23640186', NULL, NULL, NULL, 'BulkWESLevel1', 'Not Applicable', NULL, NULL, NULL, NULL, NULL, 'HTA9_1_86', 'fastq', 'Not Applicable', 'Not Applicable', 'Paired End', 'bulk_dnaseq_level_1/a7a3be30-dded-4ce1-aa04-a934b29ea0e7_R2.fq.gz', NULL, NULL, 'R2', NULL, 'unknown', NULL, NULL, 'unknown', 'Not Applicable', '126', NULL, 'HTAN OHSU', 'syn39140863', 5, 10761755653, 'b2f2f68f59185e8e273978ec101f0bd9', 'Release 1.0', 'v21.9.1.seq'), ('HTA9_1_19522', '8ce65e35-5f8c-4db4-abdf-7a4bffab30f3', NULL, 'Hybrid Selection', 'syn26537508', NULL, NULL, NULL, 'BulkWESLevel1', 'Not Applicable', NULL, NULL, NULL, NULL, NULL, 'HTA9_1_86', 'fastq', 'Not Applicable', 'Not Applicable', 'Paired End', 'bulk_dnaseq_level_1/0000321955_R1.fq.gz', NULL, NULL, 'R1', NULL, 'unknown', NULL, NULL, 'unknown', 'Not Applicable', '127', NULL, 'HTAN OHSU', 'syn39140863', 5, 10768293903, '9a6aaaba334668e2d22e1269682b778e', 'Release 3.0', 'v22.12.1.seq'), ('HTA9_1_19566', '0e0e1400-c03c-4571-8119-6dc9d5f2cf06', NULL, 'Hybrid Selection', 'syn26537500', NULL, NULL, NULL, 'BulkWESLevel1', 'Not Applicable', NULL, NULL, NULL, NULL, NULL, 'HTA9_1_97', 'fastq', 'Not Applicable', 'Not Applicable', 'Paired End', 'bulk_dnaseq_level_1/0000322075_R1.fastq.gz', NULL, NULL, 'R1', NULL, 'unknown', NULL, NULL, 'unknown', 'Not Applicable', '127', NULL, 'HTAN OHSU', 'syn39140863', 5, 5721951186, 'd2f835a5864a7a556f6b43c5f774e7cb', 'Release 3.0', 'v22.12.1.seq'), ('HTA9_1_19555', '4456c159-4110-4029-8eee-44a129c84d26', NULL, 'Hybrid Selection', 'syn26537503', NULL, NULL, NULL, 'BulkWESLevel1', 'Not Applicable', NULL, NULL, NULL, NULL, NULL, 'HTA9_1_109', 'fastq', 'Not Applicable', 'Not Applicable', 'Paired End', 'bulk_dnaseq_level_1/0000351169_R1.fq.gz', NULL, NULL, 'R1', NULL, 'unknown', NULL, NULL, 'unknown', 'Not Applicable', '127', NULL, 'HTAN OHSU', 'syn39140863', 5, 5428178220, 'd8aeb91d19f3b7a0222d2de8bbb45953', 'Release 3.0', 'v22.12.1.seq');