-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.bulkRNAseq_level3_metadata_r3`
(
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Filename STRING OPTIONS(description="Name of a file"),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  HTAN_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  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)"),
  Pseudo_Alignment_Used STRING OPTIONS(description="Pseudo aligners such as Kallisto or Salmon do not produce aligned reads BAM files. True indicates pseudoalignment was used."),
  Data_Category STRING OPTIONS(description="Specific content type of the data file."),
  Expression_Units STRING OPTIONS(description="How quantities are corrected for gene length"),
  Matrix_Type STRING OPTIONS(description="Type of data stored in matrix."),
  Fusion_Gene_Detected STRING OPTIONS(description="Was a fusion gene identified?"),
  Fusion_Gene_Identity STRING OPTIONS(description="The gene symbols of fused genes."),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  HTAN_Center STRING OPTIONS(description="Name of HTAN Center e.g. HTAN HTAPP"),
  Data_Release STRING OPTIONS(description="Inclusion in HTAN Data Release e.g. Release 1.0"),
  Manifest_Version INT64 OPTIONS(description="Latest version of metadata manifest"),
  Uuid STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  File_Size INT64 OPTIONS(description="Size of file (bucket object) in bytes"),
  md5 STRING OPTIONS(description="md5 hash of file"),
  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 3 METADATA R3 VERSIONED",
  description="This table contains the file metadata for third level (i.e. expression quantification files) bulk RNA sequencing data extracted from HTAN Synapse projects in April 2023. More details: see https://data.humantumoratlas.org/standard/sequencing",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("program", "htan"), ("source", "htan"), ("status", "current"), ("category", "metadata")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.bulkRNAseq_level3_metadata_r3` (Component, Filename, File_Format, HTAN_Parent_Data_File_ID, HTAN_Data_File_ID, Pseudo_Alignment_Used, Data_Category, Expression_Units, Matrix_Type, Fusion_Gene_Detected, Fusion_Gene_Identity, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid, File_Size, md5, CDS_Release) VALUES ('BulkRNA-seqLevel3', 'bulk_rnaseq_level_3/0000254583_kallisto.tsv', 'tsv', 'HTA9_1_1150;HTA9_1_1147', 'HTA9_1_19618', 'No', 'Isoform Expression Quantification', 'TPM', 'Raw Counts', NULL, NULL, 'syn26535393', 'HTAN OHSU', 'Release 2.0', 3, 'e81ba590-fcb9-4b52-9716-114903229576', 27783714, '4a130d14742afee7d041d41d0b9f9733', NULL), ('BulkRNA-seqLevel3', 'bulk_rnaseq_level_3/0000264005_kallisto.tsv', 'tsv', 'HTA9_1_1148;HTA9_1_1146', 'HTA9_1_19619', 'No', 'Isoform Expression Quantification', 'TPM', 'Raw Counts', NULL, NULL, 'syn26535398', 'HTAN OHSU', 'Release 2.0', 3, '1dcba2bb-9b0f-4b1e-bcc7-340ac8430b87', 28009572, 'fcc9dd764248ea99dc1be1b377e903af', NULL), ('BulkRNA-seqLevel3', 'bulk_rnaseq_level_3/0000322075_kallisto.tsv', 'tsv', 'HTA9_1_19612;HTA9_1_19614', 'HTA9_1_19620', 'No', 'Isoform Expression Quantification', 'TPM', 'Raw Counts', NULL, NULL, 'syn26535394', 'HTAN OHSU', 'Release 2.0', 3, 'ff3db17d-7142-42f2-aa2b-9fb1a6564c9c', 27802284, 'a9266d58872d76784c86574cc1b1ac9e', NULL), ('BulkRNA-seqLevel3', 'bulk_rnaseq_level_3/0000265302_kallisto.tsv', 'tsv', 'HTA9_1_1145;HTA9_1_1149', 'HTA9_1_19621', 'No', 'Isoform Expression Quantification', 'TPM', 'Raw Counts', NULL, NULL, 'syn26535396', 'HTAN OHSU', 'Release 2.0', 3, 'ca59348a-c26d-4f22-b676-01eb91072abd', 27947186, '1020e107d42b27c6d87948d8932d9180', NULL), ('BulkRNA-seqLevel3', 'bulk_rnaseq_level_3/0000322075-counts.txt', 'tsv', 'HTA9_1_19617', 'HTA9_1_19622', 'No', 'Isoform Expression Quantification', 'TPM', 'Raw Counts', NULL, NULL, 'syn26535392', 'HTAN OHSU', 'Release 2.0', 3, '91e1c790-a34e-476e-827e-184ef43b4b85', 27819541, 'baeca7b216861296c7ee15042ac8ef5e', NULL);