-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.bulkRNAseq_level3_metadata_r5`
(
  Workflow_Link STRING OPTIONS(description="Link to workflow or command. DockStore.org recommended. URL"),
  Matrix_Type STRING OPTIONS(description="Type of data stored in matrix."),
  Specify_Other_Fusion_Gene STRING OPTIONS(description="Specify fusion gene detected, if not in list"),
  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)"),
  Fusion_Gene_Identity STRING OPTIONS(description="The gene symbols of fused genes."),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  HTAN_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  Genomic_Reference_URL STRING OPTIONS(description="Link to human genome sequence (e.g. ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_34/GRCh38.primary_assembly.genome.fa.gz)"),
  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."),
  Fusion_Gene_Detected STRING OPTIONS(description="Was a fusion gene identified?"),
  Genomic_Reference STRING OPTIONS(description="Exact version of the human genome reference used in the alignment of reads (e.g. GCF_000001405.39)"),
  Data_Category STRING OPTIONS(description="Specific content type of the data file."),
  Filename STRING OPTIONS(description="Name of a file"),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  Expression_Units STRING OPTIONS(description="How quantities are corrected for gene length"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Software_and_Version STRING OPTIONS(description="Name of software used to generate expression values. String"),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  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 3 METADATA R5 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 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_level3_metadata_r5` (Workflow_Link, Matrix_Type, Specify_Other_Fusion_Gene, HTAN_Data_File_ID, Fusion_Gene_Identity, Component, HTAN_Parent_Data_File_ID, Genomic_Reference_URL, Pseudo_Alignment_Used, Fusion_Gene_Detected, Genomic_Reference, Data_Category, Filename, entityId, Expression_Units, Id, Software_and_Version, File_Format, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES (NULL, 'Raw Counts', NULL, 'HTA9_1_19618', NULL, 'BulkRNA-seqLevel3', 'HTA9_1_1150;HTA9_1_1147', NULL, 'No', NULL, NULL, 'Isoform Expression Quantification', 'bulk_rnaseq_level_3/0000254583_kallisto.tsv', 'syn26535393', 'TPM', 'e81ba590-fcb9-4b52-9716-114903229576', NULL, 'tsv', 'HTAN OHSU', 'syn39142026', 5, 27783714, '4a130d14742afee7d041d41d0b9f9733', 'Release 2.0', NULL), (NULL, 'Raw Counts', NULL, 'HTA9_1_19619', NULL, 'BulkRNA-seqLevel3', 'HTA9_1_1148;HTA9_1_1146', NULL, 'No', NULL, NULL, 'Isoform Expression Quantification', 'bulk_rnaseq_level_3/0000264005_kallisto.tsv', 'syn26535398', 'TPM', '1dcba2bb-9b0f-4b1e-bcc7-340ac8430b87', NULL, 'tsv', 'HTAN OHSU', 'syn39142026', 5, 28009572, 'fcc9dd764248ea99dc1be1b377e903af', 'Release 2.0', NULL), (NULL, 'Raw Counts', NULL, 'HTA9_1_19620', NULL, 'BulkRNA-seqLevel3', 'HTA9_1_19612;HTA9_1_19614', NULL, 'No', NULL, NULL, 'Isoform Expression Quantification', 'bulk_rnaseq_level_3/0000322075_kallisto.tsv', 'syn26535394', 'TPM', 'ff3db17d-7142-42f2-aa2b-9fb1a6564c9c', NULL, 'tsv', 'HTAN OHSU', 'syn39142026', 5, 27802284, 'a9266d58872d76784c86574cc1b1ac9e', 'Release 2.0', NULL), (NULL, 'Raw Counts', NULL, 'HTA9_1_19621', NULL, 'BulkRNA-seqLevel3', 'HTA9_1_1145;HTA9_1_1149', NULL, 'No', NULL, NULL, 'Isoform Expression Quantification', 'bulk_rnaseq_level_3/0000265302_kallisto.tsv', 'syn26535396', 'TPM', 'ca59348a-c26d-4f22-b676-01eb91072abd', NULL, 'tsv', 'HTAN OHSU', 'syn39142026', 5, 27947186, '1020e107d42b27c6d87948d8932d9180', 'Release 2.0', NULL), (NULL, 'Raw Counts', NULL, 'HTA9_1_19622', NULL, 'BulkRNA-seqLevel3', 'HTA9_1_19617', NULL, 'No', NULL, NULL, 'Isoform Expression Quantification', 'bulk_rnaseq_level_3/0000322075-counts.txt', 'syn26535392', 'TPM', '91e1c790-a34e-476e-827e-184ef43b4b85', NULL, 'tsv', 'HTAN OHSU', 'syn39142026', 5, 27819541, 'baeca7b216861296c7ee15042ac8ef5e', 'Release 2.0', NULL);