-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.10xvisium_spatialtranscriptomics_scRNAseq_level1_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"),
  Run_ID STRING OPTIONS(description="A unique identifier for this individual run (typically associated with a single slide) of the spatial transcriptomic processing workflow."),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  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)"),
  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"),
  Read_Indicator STRING OPTIONS(description="Indicate if this is Read 1 (R1) or Read 2 (R2)"),
  Spatial_Read1 STRING OPTIONS(description="Read 1 content description"),
  Spatial_Read2 STRING OPTIONS(description="Read 2 content description"),
  Spatial_Library_Construction_Method STRING OPTIONS(description="Process which results in the creation of a library from fragments of DNA using cloning vectors or oligonucleotides with the role of adaptors [OBI_0000711]"),
  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'"),
  Sequencing_Library_Construction_Days_from_Index STRING OPTIONS(description="Number of days between sample for assay was received in lab and day of sequencing library construction [number]. If not applicable please enter 'Not Applicable'"),
  End_Bias STRING OPTIONS(description="The end of the cDNA molecule that is preferentially sequenced, e.g. 3/5 prime tag/end or the full length transcript"),
  Reverse_Transcription_Primer STRING OPTIONS(description="An oligo to which new deoxyribonucleotides can be added by DNA polymerase [SO_0000112]. The type of primer used for reverse transcription, e.g. oligo-dT or random primer. This allows users to identify content of the cDNA library input e.g. enriched for mRNA"),
  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."),
  Capture_Area STRING OPTIONS(description="Area (or Capture Area) - One of the either four or two active regions where tissue can be placed on a Visium slide. Each area is intended to contain only one tissue sample. Slide areas are named consecutively from top to bottom: A1, B1, C1, D1 for Visium slides with 6.5 mm Capture Area and A, B for CytAssist slides with 11 mm Capture Area. Both CytAssist slides with 6.5 mm Capture Area and Gateway Slides contain only two slide areas, A1 and D1."),
  Protocol_Link STRING OPTIONS(description="Protocols.io ID or DOI link to a free/open protocol resource describing in detail the assay protocol (e.g. surface markers used in Smart-seq, dissociation duration,  lot/batch numbers for key reagents such as primers, sequencing reagent kits, etc.) or the protocol by which the sample was obtained or generated."),
  Slide_Version STRING OPTIONS(description="Version of imaging slide used. Slide version is critical for the analysis of the sequencing data as different slides have different capture area layouts."),
  Slide_ID STRING OPTIONS(description="The unique identifier printed on the label of each Visium slide. The serial number starts with V followed by a number which can range between one through five and ends with a dash and a three digit number, such as 123."),
  Image_Re_orientation STRING OPTIONS(description="Description unavailable. Contact HTAN DCC for more information"),
  Permeabilization_Time STRING OPTIONS(description="Fixed and stained tissue sections are permeabilized for different times. Each Capture Area captures polyadenylated mRNA from the attached tissue section. Measure is provided in minutes."),
  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"),
  DV200 STRING OPTIONS(description="Represents the percentage of RNA fragments that are >200 nucleotides in size. Number"),
  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 VISIUM RNA-SEQ LEVEL 1 METADATA R3 VERSIONED",
  description="This table contains the file metadata for first level (i.e. fastq files) 10x Genomics Visium sequencing. Data was 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.10xvisium_spatialtranscriptomics_scRNAseq_level1_metadata_r3` (Component, Filename, Run_ID, File_Format, HTAN_Data_File_ID, HTAN_Parent_Biospecimen_ID, Read_Indicator, Spatial_Read1, Spatial_Read2, Spatial_Library_Construction_Method, Library_Preparation_Days_from_Index, Sequencing_Library_Construction_Days_from_Index, End_Bias, Reverse_Transcription_Primer, Sequencing_Platform, Capture_Area, Protocol_Link, Slide_Version, Slide_ID, Image_Re_orientation, Permeabilization_Time, RIN, DV200, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid, File_Size, md5, CDS_Release) VALUES ('10xVisiumSpatialTranscriptomics-RNA-seqLevel1', 'visium_level_1/HMLL7DSXY_GTCCTTCGGC-TCATGCACAG_L002_R1.fastq.gz', 'HT224P1-S1Fc2U1Z1Bs1-1', 'fastq', 'HTA12_22_1007', 'HTA12_22_4', 'R1', 'Spatial Barcode and UMI', 'cDNA', '10xV1.0', NULL, '75', '3 Prime', 'Oligo-dT', 'Illumina NovaSeq 6000', NULL, 'http://dx.doi.org/10.17504/protocols.io.x54v9d3opg3e/v1', NULL, 'V10Y07-090', NULL, NULL, NULL, NULL, 'syn29282141', 'HTAN WUSTL', 'Release 2.0', 6, '4ed5d9b2-fab7-4c41-b1d2-7656afa824c2', 3514681241, 'e3fb20e70a6c00edf28c9f80692ba32a', 'v22.12.1.seq'), ('10xVisiumSpatialTranscriptomics-RNA-seqLevel1', 'visium_level_1/HMLL7DSXY_GTCCTTCGGC-TCATGCACAG_L002_R2.fastq.gz', 'HT224P1-S1Fc2U1Z1Bs1-1', 'fastq', 'HTA12_22_1008', 'HTA12_22_4', 'R2', 'Spatial Barcode and UMI', 'cDNA', '10xV1.0', NULL, '75', '3 Prime', 'Oligo-dT', 'Illumina NovaSeq 6000', NULL, 'http://dx.doi.org/10.17504/protocols.io.x54v9d3opg3e/v1', NULL, 'V10Y07-090', NULL, NULL, NULL, NULL, 'syn29290487', 'HTAN WUSTL', 'Release 2.0', 6, '59fc5f11-825f-4c20-a52d-0f8bd079fe08', 11834666503, '3768a9dba6e891be9ee6402d015b1350', 'v22.12.1.seq'), ('10xVisiumSpatialTranscriptomics-RNA-seqLevel1', 'visium_level_1/TWCE-HT231P1-S1H3Fc2U1Z1Bs1-H3Bs2-Test_S8_L002_R1_001.fastq.gz', 'HT231P1-S1H3Fc2U1Z1Bs1-H3Bs2-Test', 'fastq', 'HTA12_23_1005', 'HTA12_23_3', 'R1', 'Spatial Barcode and UMI', 'cDNA', '10xV1.0', NULL, '63', '3 Prime', 'Oligo-dT', 'Illumina NovaSeq 6000', NULL, 'http://dx.doi.org/10.17504/protocols.io.x54v9d3opg3e/v1', NULL, 'V10L08-058', NULL, NULL, NULL, NULL, 'syn29289888', 'HTAN WUSTL', 'Release 2.0', 6, 'b265d678-5539-432f-b260-0de6ca6d3859', 4598508868, 'b2c7b110491631121760da23f428ab7a', 'v22.12.1.seq'), ('10xVisiumSpatialTranscriptomics-RNA-seqLevel1', 'visium_level_1/TWCE-HT231P1-S1H3Fc2U1Z1Bs1-H3Bs2-Test_S8_L002_R2_001.fastq.gz', 'HT231P1-S1H3Fc2U1Z1Bs1-H3Bs2-Test', 'fastq', 'HTA12_23_1006', 'HTA12_23_3', 'R2', 'Spatial Barcode and UMI', 'cDNA', '10xV1.0', NULL, '63', '3 Prime', 'Oligo-dT', 'Illumina NovaSeq 6000', NULL, 'http://dx.doi.org/10.17504/protocols.io.x54v9d3opg3e/v1', NULL, 'V10L08-058', NULL, NULL, NULL, NULL, 'syn29290431', 'HTAN WUSTL', 'Release 2.0', 6, 'd0afb770-9fa1-4299-ad18-ffc3e9d84879', 15769226139, 'a161f6dbe801dfc5422d9e7bff9ff5fa', 'v22.12.1.seq'), ('10xVisiumSpatialTranscriptomics-RNA-seqLevel1', 'visium_level_1/TCCCAAGGGT-TACTACCTTT_S7_L004_R1_001.fastq.gz', 'HT232P1H1A2', 'fastq', 'HTA12_24_1009', 'HTA12_24_5', 'R1', 'Spatial Barcode and UMI', 'cDNA', '10xV1.0', NULL, '3', '3 Prime', 'Oligo-dT', 'Illumina NovaSeq 6000', NULL, 'http://dx.doi.org/10.17504/protocols.io.x54v9d3opg3e/v1', NULL, 'V10M12-007', NULL, NULL, NULL, NULL, 'syn29298136', 'HTAN WUSTL', 'Release 2.0', 6, '6dde0d11-7da1-4f32-9ebc-c4051065ba7d', 6106083864, '52a615c8164bb1244fd05bf870276051', 'v22.12.1.seq');