-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.bulkWES_level1_metadata_r5`
(
  Adapter_Name STRING OPTIONS(description="Name of the sequencing adapter. String"),
  Library_Layout STRING OPTIONS(description="Sequencing read type"),
  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)"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Target_Depth STRING OPTIONS(description="The targeted read depth prior to sequencing. Integer"),
  Base_Caller_Name STRING OPTIONS(description="Name of the base caller. String"),
  Read_Length STRING OPTIONS(description="The length of the sequencing reads. Can be integer, null"),
  Fragment_Maximum_Length STRING OPTIONS(description="Maximum length of the sequenced fragments (e.g., as predicted by Agilent Bioanalyzer). Integer"),
  Multiplex_Barcode STRING OPTIONS(description="The barcode/index sequence used. Wrong or missing information may affect analysis results. String"),
  Library_Preparation_Kit_Version STRING OPTIONS(description="Version of Library Preparation Kit. String"),
  Fragment_Minimum_Length STRING OPTIONS(description="Minimum length of the sequenced fragments (e.g., as predicted by Agilent Bioanalyzer). Integer"),
  Base_Caller_Version STRING OPTIONS(description="Version of the base caller. String"),
  Library_Preparation_Kit_Vendor STRING OPTIONS(description="Vendor of Library Preparation Kit. String"),
  Library_Selection_Method STRING OPTIONS(description="How RNA molecules are isolated."),
  To_Trim_Adapter_Sequence STRING OPTIONS(description="Does the user suggest adapter trimming?"),
  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."),
  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"),
  Filename STRING OPTIONS(description="Name of a file"),
  Library_Preparation_Kit_Name STRING OPTIONS(description="Name of Library Preparation Kit. String"),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  Adapter_Sequence STRING OPTIONS(description="Base sequence of the sequencing adapter. String"),
  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_Mean_Length STRING OPTIONS(description="Mean length of the sequenced fragments (e.g., as predicted by Agilent Bioanalyzer). Number"),
  Flow_Cell_Barcode STRING OPTIONS(description="Flow cell barcode. Wrong or missing information may affect analysis results. String"),
  Fragment_Standard_Deviation_Length STRING OPTIONS(description="Standard deviation of the sequenced fragments length (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."),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  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), Read 2 (R2), Index Reads (I1), or Other"),
  Size_Selection_Range STRING OPTIONS(description="Range of size selection. String"),
  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'"),
  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 R5 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 April 2024 and corresponds to HTAN Data Release 5.1. 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_r5` (Adapter_Name, Library_Layout, HTAN_Data_File_ID, Component, Target_Depth, Base_Caller_Name, Read_Length, Fragment_Maximum_Length, Multiplex_Barcode, Library_Preparation_Kit_Version, Fragment_Minimum_Length, Base_Caller_Version, Library_Preparation_Kit_Vendor, Library_Selection_Method, To_Trim_Adapter_Sequence, Sequencing_Platform, HTAN_Parent_Biospecimen_ID, Filename, Library_Preparation_Kit_Name, entityId, Adapter_Sequence, Library_Preparation_Days_from_Index, Fragment_Mean_Length, Flow_Cell_Barcode, Fragment_Standard_Deviation_Length, Target_Capture_Kit, Id, Lane_Number, Read_Indicator, Size_Selection_Range, File_Format, Sequencing_Batch_ID, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES (NULL, 'Paired End', 'HTA9_12_1020', 'BulkWESLevel1', NULL, NULL, '99', NULL, NULL, 'Not Applicable', NULL, NULL, 'Not Applicable', 'Hybrid Selection', NULL, 'unknown', 'HTA9_12_40', 'bulk_dnaseq_level_1/0000321940_R1.fq.gz', 'Not Applicable', 'syn51535587', NULL, NULL, NULL, NULL, NULL, 'unknown', 'b28c312b-f046-421c-a677-e18f7a67fde3', NULL, 'R1', NULL, 'fastq', 'Not Applicable', 'HTAN OHSU', 'syn39140863', 11, 4311537868, '4c35819ba04260f95b2db93f68f718b3', 'Release 5.0', NULL), (NULL, 'Paired End', 'HTA9_12_1022', 'BulkWESLevel1', NULL, NULL, '99', NULL, NULL, 'Not Applicable', NULL, NULL, 'Not Applicable', 'Hybrid Selection', NULL, 'unknown', 'HTA9_12_40', 'bulk_dnaseq_level_1/0000321940_R2.fq.gz', 'Not Applicable', 'syn51535636', NULL, NULL, NULL, NULL, NULL, 'unknown', '9cab84df-f3b0-4ea0-b060-a67a91235590', NULL, 'R2', NULL, 'fastq', 'Not Applicable', 'HTAN OHSU', 'syn39140863', 11, 4622960955, '1818f47252ee5f4ded40f7b119a5dd8e', 'Release 5.0', NULL), (NULL, 'Paired End', 'HTA9_1_40580', 'BulkWESLevel1', NULL, NULL, '125', NULL, NULL, 'Not Applicable', NULL, NULL, 'Not Applicable', 'Hybrid Selection', NULL, 'unknown', 'HTA9_1_144', 'bulk_dnaseq_level_1/0000382861_R1.fq.gz', 'Not Applicable', 'syn51535821', NULL, NULL, NULL, NULL, NULL, 'unknown', 'a61c76d1-3a93-4a20-870c-7ce88da46856', NULL, 'R1', NULL, 'fastq', 'Not Applicable', 'HTAN OHSU', 'syn39140863', 11, 9623281421, '3f660e33498d20197d001a6e8af0b437', 'Release 5.0', NULL), (NULL, 'Paired End', 'HTA9_1_40579', 'BulkWESLevel1', NULL, NULL, '125', NULL, NULL, 'Not Applicable', NULL, NULL, 'Not Applicable', 'Hybrid Selection', NULL, 'unknown', 'HTA9_1_144', 'bulk_dnaseq_level_1/0000382861_R2.fq.gz', 'Not Applicable', 'syn51535838', NULL, NULL, NULL, NULL, NULL, 'unknown', '0d7b5f06-ad75-4243-a9f5-455c40747384', NULL, 'R2', NULL, 'fastq', 'Not Applicable', 'HTAN OHSU', 'syn39140863', 11, 10052059009, '57d23727f612862b3e54463c023a3722', 'Release 5.0', NULL), (NULL, 'Paired End', 'HTA9_13_1014', 'BulkWESLevel1', NULL, NULL, '126', NULL, NULL, 'Not Applicable', NULL, NULL, 'Not Applicable', 'Hybrid Selection', NULL, 'unknown', 'HTA9_13_49', 'bulk_dnaseq_level_1/0000320179_R1.fq.gz', 'Not Applicable', 'syn51535473', NULL, NULL, NULL, NULL, NULL, 'unknown', '716b6020-9e55-47df-8a0a-cf1549dac9ad', NULL, 'R1', NULL, 'fastq', 'Not Applicable', 'HTAN OHSU', 'syn39140863', 11, 11457101154, 'bb5fc927b28ca13f4aa292bfdff955f2', 'Release 5.0', NULL);