-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.bulkRNAseq_level1_metadata_r5`
(
  Micro_region_Seq_Platform STRING OPTIONS(description="The platform used for micro-regional RNA sequencing (if applicable)"),
  Nucleic_Acid_Source STRING OPTIONS(description="The source of the input nucleic molecule"),
  Adapter_Name STRING OPTIONS(description="Name of the sequencing adapter. String"),
  Library_Layout STRING OPTIONS(description="Sequencing read type"),
  Library_Strand STRING OPTIONS(description="Library stranded-ness."),
  Adapter_Content STRING OPTIONS(description="State classification given by FASTQC for the metric. Metric specific details about the states are available on their website."),
  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)"),
  Per_Base_Sequence_Content STRING OPTIONS(description="State classification given by FASTQC for the metric. Metric specific details about the states are available on their website."),
  Basic_Statistics STRING OPTIONS(description="State classification given by FASTQC for the metric. Metric specific details about the states are available on their website."),
  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"),
  Total_Reads STRING OPTIONS(description="Total number of reads per sample. Integer"),
  Base_Caller_Name STRING OPTIONS(description="Name of the base caller. String"),
  QC_Workflow_Link STRING OPTIONS(description="Link to workflow used. String"),
  ROI_Tag STRING OPTIONS(description="The tag or grouping used to identify the ROI in micro-regional RNA sequencing (if applicable). Must match the ROI tag within the count matrix in level 3."),
  QC_Workflow_Version STRING OPTIONS(description="Major version for a workflow. 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"),
  DV200 STRING OPTIONS(description="Represents the percentage of RNA fragments that are >200 nucleotides in size. Number"),
  Size_Selection_Range STRING OPTIONS(description="Range of size selection. String"),
  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?"),
  RIN STRING OPTIONS(description="A numerical assessment of the integrity of RNA based on the entire electrophoretic trace of the RNA sample including the presence or absence of degradation products. Number"),
  Per_Sequence_GC_Content STRING OPTIONS(description="State classification given by FASTQC for the metric. Metric specific details about the states are available on their website."),
  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."),
  Overrepresented_Sequences STRING OPTIONS(description="State classification given by FASTQC for the metric. Metric specific details about the states are available on their website."),
  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"),
  Sequence_Length_Distribution STRING OPTIONS(description="State classification given by FASTQC for the metric. Metric specific details about the states are available on their website."),
  Sequence_Duplication_Levels STRING OPTIONS(description="State classification given by FASTQC for the metric. Metric specific details about the states are available on their website."),
  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"),
  Percent_GC_Content STRING OPTIONS(description="The overall %GC of all bases in all sequences. Integer"),
  Per_Tile_Sequence_Quality STRING OPTIONS(description="State classification given by FASTQC for the metric. Metric specific details about the states are available on their website."),
  Adapter_Sequence STRING OPTIONS(description="Base sequence of the sequencing adapter. String"),
  Per_Base_N_Content STRING OPTIONS(description="State classification given by FASTQC for the metric. Metric specific details about the states are available on their website."),
  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'"),
  QC_Workflow_Type STRING OPTIONS(description="Generic name for the workflow used to analyze a data set. String"),
  Kmer_Content STRING OPTIONS(description="State classification given by FASTQC for the metric. Metric specific details about the states are available on their website."),
  Per_Base_Sequence_Quality STRING OPTIONS(description="State classification given by FASTQC for the metric. Metric specific details about the states are available on their website."),
  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"),
  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"),
  Per_Sequence_Quality_Score STRING OPTIONS(description="State classification given by FASTQC for the metric. Metric specific details about the states are available on their website."),
  Encoding STRING OPTIONS(description="Version of ASCII encoding of quality values found in the file. String"),
  Read_Indicator STRING OPTIONS(description="Indicate if this is Read 1 (R1), Read 2 (R2), Index Reads (I1), or Other"),
  Spike_In_Concentration STRING OPTIONS(description="The final concentration or dilution (for commercial sets) of the spike in mix [PMID:21816910]"),
  Transcript_Integrity_Number STRING OPTIONS(description="Used to describe the quality of the starting material, esp. in regards to FFPE samples. Number"),
  Spike_In STRING OPTIONS(description="A set of known synthetic RNA molecules with known sequence that are added to the cell lysis mix"),
  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 BULKRNASEQ LEVEL 1 METADATA R5 VERSIONED",
  description="This table contains the file metadata for first level (i.e. fastq) bulk RNA 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.bulkRNAseq_level1_metadata_r5` (Micro_region_Seq_Platform, Nucleic_Acid_Source, Adapter_Name, Library_Layout, Library_Strand, Adapter_Content, HTAN_Data_File_ID, Per_Base_Sequence_Content, Basic_Statistics, Component, Target_Depth, Total_Reads, Base_Caller_Name, QC_Workflow_Link, ROI_Tag, QC_Workflow_Version, Read_Length, Fragment_Maximum_Length, DV200, Size_Selection_Range, Multiplex_Barcode, Library_Preparation_Kit_Version, Fragment_Minimum_Length, Base_Caller_Version, Library_Preparation_Kit_Vendor, Library_Selection_Method, To_Trim_Adapter_Sequence, RIN, Per_Sequence_GC_Content, Sequencing_Platform, Overrepresented_Sequences, HTAN_Parent_Biospecimen_ID, Sequence_Length_Distribution, Sequence_Duplication_Levels, Filename, Library_Preparation_Kit_Name, entityId, Percent_GC_Content, Per_Tile_Sequence_Quality, Adapter_Sequence, Per_Base_N_Content, Library_Preparation_Days_from_Index, QC_Workflow_Type, Kmer_Content, Per_Base_Sequence_Quality, Fragment_Mean_Length, Flow_Cell_Barcode, Fragment_Standard_Deviation_Length, Id, Lane_Number, Per_Sequence_Quality_Score, Encoding, Read_Indicator, Spike_In_Concentration, Transcript_Integrity_Number, Spike_In, File_Format, Sequencing_Batch_ID, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES (NULL, 'Bulk Whole Cell', NULL, 'Paired End', NULL, NULL, 'HTA3_80002_4678306659', NULL, NULL, 'BulkRNA-seqLevel1', NULL, NULL, NULL, NULL, NULL, NULL, '75', NULL, NULL, NULL, NULL, 'TruSeq RNA Exome', NULL, NULL, 'Illumina', 'other', NULL, NULL, NULL, 'Illumina Next Seq 500', NULL, 'HTA3_80002_6001003', NULL, NULL, 'Bulk_RNA_Level_1/LUAD/R_LUAD/UCLA/430R_S8_R1_001.fastq.gz', 'TruSeq RNA Exome', 'syn51597520', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1c80e28f-b3e4-4b59-b522-45e0a4b3bafc', NULL, NULL, NULL, 'R1', NULL, NULL, 'No Spike In', 'fastq', '1', 'HTAN BU', 'syn51668044', 24, 3199510845, 'f2715f233d5c40a92673994a3e23353c', 'Release 4.0', 'v23.10.1.seq'), (NULL, 'Bulk Whole Cell', NULL, 'Paired End', NULL, NULL, 'HTA3_80002_4748757909', NULL, NULL, 'BulkRNA-seqLevel1', NULL, NULL, NULL, NULL, NULL, NULL, '75', NULL, NULL, NULL, NULL, 'TruSeq RNA Exome', NULL, NULL, 'Illumina', 'other', NULL, NULL, NULL, 'Illumina Next Seq 500', NULL, 'HTA3_80002_6002002', NULL, NULL, 'Bulk_RNA_Level_1/LUAD/R_LUAD/UCLA/431R_S7_R1_001.fastq.gz', 'TruSeq RNA Exome', 'syn51597552', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'bc0bc58b-fd87-4ec2-b6ba-56b9673d5e23', NULL, NULL, NULL, 'R1', NULL, NULL, 'No Spike In', 'fastq', '1', 'HTAN BU', 'syn51668044', 24, 2755620317, '6e81c3951262e1d9c53c0d623651866a', 'Release 4.0', 'v23.10.1.seq'), (NULL, 'Bulk Whole Cell', NULL, 'Paired End', NULL, NULL, 'HTA3_80002_7967504597', NULL, NULL, 'BulkRNA-seqLevel1', NULL, NULL, NULL, NULL, NULL, NULL, '75', NULL, NULL, NULL, NULL, 'TruSeq RNA Exome', NULL, NULL, 'Illumina', 'other', NULL, NULL, NULL, 'Illumina Next Seq 500', NULL, 'HTA3_80002_6003004', NULL, NULL, 'Bulk_RNA_Level_1/LUAD/R_LUAD/UCLA/432R_S6_R1_001.fastq.gz', 'TruSeq RNA Exome', 'syn51597580', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'fe620612-7f55-4797-a575-b3e586e2da43', NULL, NULL, NULL, 'R1', NULL, NULL, 'No Spike In', 'fastq', '1', 'HTAN BU', 'syn51668044', 24, 2979155981, 'eaae986fc0c257bdd6e030f67329767d', 'Release 4.0', 'v23.10.1.seq'), (NULL, 'Bulk Whole Cell', NULL, 'Paired End', NULL, NULL, 'HTA3_80002_7956503690', NULL, NULL, 'BulkRNA-seqLevel1', NULL, NULL, NULL, NULL, NULL, NULL, '75', NULL, NULL, NULL, NULL, 'TruSeq RNA Exome', NULL, NULL, 'Illumina', 'other', NULL, NULL, NULL, 'Illumina Next Seq 500', NULL, 'HTA3_80002_6004001', NULL, NULL, 'Bulk_RNA_Level_1/LUAD/R_LUAD/UCLA/433R_S5_R1_001.fastq.gz', 'TruSeq RNA Exome', 'syn51597614', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'a6a430b5-78a8-4027-ae44-33b1433a1dbc', NULL, NULL, NULL, 'R1', NULL, NULL, 'No Spike In', 'fastq', '1', 'HTAN BU', 'syn51668044', 24, 3078583333, '970d11f970260fe72a7d8b5681a5a899', 'Release 4.0', 'v23.10.1.seq'), (NULL, 'Bulk Whole Cell', NULL, 'Paired End', NULL, NULL, 'HTA3_80005_3799610105', NULL, NULL, 'BulkRNA-seqLevel1', NULL, NULL, NULL, NULL, NULL, NULL, '75', NULL, NULL, NULL, NULL, 'TruSeq RNA Exome', NULL, NULL, 'Illumina', 'other', NULL, NULL, NULL, 'Illumina Next Seq 500', NULL, 'HTA3_80005_6001003', NULL, NULL, 'Bulk_RNA_Level_1/LUAD/R_LUAD/UCLA/434R_S4_R1_001.fastq.gz', 'TruSeq RNA Exome', 'syn51597664', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '017fcf5c-7fc0-4ef5-b692-6577c9985ffe', NULL, NULL, NULL, 'R1', NULL, NULL, 'No Spike In', 'fastq', '1', 'HTAN BU', 'syn51668044', 24, 3463006676, '388b33f9fb4cf0fa8c73fc69f9232d49', 'Release 4.0', 'v23.10.1.seq');