-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.10xvisium_spatialtranscriptomics_scRNAseq_level3_metadata_r4`
(
  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)"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Mean_Reads_per_Spatial_Spot STRING OPTIONS(description="The number of reads, both under and outside of tissue, divided by the number of barcodes associated with a spot under tissue."),
  Median_UMI_Counts_per_Spot STRING OPTIONS(description="The median number of UMI counts per tissue covered spot."),
  Visium_File_Type STRING OPTIONS(description="The file type generated for the visium experiment."),
  Proportion_Reads_Mapped STRING OPTIONS(description="Proportion of mapped reads collected from samtools. Number"),
  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."),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Median_Number_Genes_per_Spatial_Spot STRING OPTIONS(description="The median number of genes detected per spot under tissue-associated barcode. Detection is defined as the presence of at least 1 UMI count."),
  Spots_under_tissue STRING OPTIONS(description="Description unavailable. \t\t\t\t\tContact DCC for more information"),
  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"),
  Sequencing_Saturation STRING OPTIONS(description="The fraction of reads originating from an already-observed UMI. This is a function of library complexity and sequencing depth. More specifically, this is the fraction of confidently mapped, valid spot-barcode, valid UMI reads that had a non-unique (spot-barcode, UMI, gene)."),
  Workflow_Link STRING OPTIONS(description="Link to workflow or command. DockStore.org recommended. URL"),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  Run_ID STRING OPTIONS(description="A unique identifier for this individual run (typically associated with a single slide) of the spatial transcriptomic processing workflow."),
  Filename STRING OPTIONS(description="Name of a file"),
  HTAN_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  Workflow_Version STRING OPTIONS(description="Major version of the workflow (e.g. Cell Ranger v3.1)"),
  Proportion_Reads_Mapped_to_Transcriptome STRING OPTIONS(description="Fraction of reads that mapped to a unique gene in the transcriptome. The read must be consistent with annotated splice junctions. These reads are considered for UMI counting."),
  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 VISIUM RNA-SEQ LEVEL 3 METADATA R4 VERSIONED",
  description="This table contains the file metadata for third level (i.e. expression quantification files) 10x Genomics Visium sequencing data extracted from HTAN Synapse projects in October 2023. 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.10xvisium_spatialtranscriptomics_scRNAseq_level3_metadata_r4` (HTAN_Data_File_ID, Id, Mean_Reads_per_Spatial_Spot, Median_UMI_Counts_per_Spot, Visium_File_Type, Proportion_Reads_Mapped, Capture_Area, entityId, Component, Median_Number_Genes_per_Spatial_Spot, Spots_under_tissue, HTAN_Parent_Biospecimen_ID, Sequencing_Saturation, Workflow_Link, File_Format, Run_ID, Filename, HTAN_Parent_Data_File_ID, Workflow_Version, Proportion_Reads_Mapped_to_Transcriptome, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('HTA12_23_3004', '7126bc31-8460-44e4-bd87-6d67ece17e77', '78867', '8524', 'barcodes', '93.1', 'A1', 'syn51201486', '10xVisiumSpatialTranscriptomics-RNA-seqLevel3', '3155', '4045', 'HTA12_23_3', '81.3', 'https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'gzip', 'HT231P1-S1H3Fc2U1Z1Bs1-H3Bs2-Test', 'visium_level_3_pdac/HT231P1-S1H3Fc2U1Z1Bs1-H3Bs2-Test-barcodes.tsv.gz', 'HTA12_23_2002', 'spaceranger-1.2.2', '80.7', 'HTAN WUSTL', 'syn51204095', 8, 25674, '75c11d8d207153ecabc0b1d824516d79', 'Release 3.0', NULL), ('HTA12_23_3005', 'cd844579-2c35-4718-9588-5da77e40e11a', '78867', '8524', 'features', '93.1', 'A1', 'syn51201481', '10xVisiumSpatialTranscriptomics-RNA-seqLevel3', '3155', '4045', 'HTA12_23_3', '81.3', 'https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'gzip', 'HT231P1-S1H3Fc2U1Z1Bs1-H3Bs2-Test', 'visium_level_3_pdac/HT231P1-S1H3Fc2U1Z1Bs1-H3Bs2-Test-features.tsv.gz', 'HTA12_23_2002', 'spaceranger-1.2.2', '80.7', 'HTAN WUSTL', 'syn51204095', 8, 294478, 'ac13e8a24bb4395fd044463c54f68a06', 'Release 3.0', NULL), ('HTA12_23_3006', '7f9b69da-4f10-4230-88ca-09da9e89f05c', '78867', '8524', 'unfiltered mex', '93.1', 'A1', 'syn51201505', '10xVisiumSpatialTranscriptomics-RNA-seqLevel3', '3155', '4045', 'HTA12_23_3', '81.3', 'https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'gzip', 'HT231P1-S1H3Fc2U1Z1Bs1-H3Bs2-Test', 'visium_level_3_pdac/HT231P1-S1H3Fc2U1Z1Bs1-H3Bs2-Test-matrix.mtx.gz', 'HTA12_23_2002', 'spaceranger-1.2.2', '80.7', 'HTAN WUSTL', 'syn51204095', 8, 54284787, '8a30811ac4b96b1c44d54aea36713777', 'Release 3.0', NULL), ('HTA12_23_3009', 'a39fcad5-7105-4bce-9fb7-6e8e45c19779', '78867', '8524', 'tissue_positions', '93.1', 'A1', 'syn51203265', '10xVisiumSpatialTranscriptomics-RNA-seqLevel3', '3155', '4045', 'HTA12_23_3', '81.3', 'https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'csv', 'HT231P1-S1H3Fc2U1Z1Bs1-H3Bs2-Test', 'visium_level_3_pdac/HT231P1-S1H3Fc2U1Z1Bs1-H3Bs2-Test-tissue_positions_list.csv', 'HTA12_23_2002', 'spaceranger-1.2.2', '80.7', 'HTAN WUSTL', 'syn51204095', 8, 189655, '8370e2616cec6d957216c34c3be1ea36', 'Release 3.0', NULL), ('HTA12_25_3004', '4ffd9771-f233-4c6d-bb15-38abdd768dff', '110440', '18838', 'barcodes', '93.1', 'A1', 'syn51201479', '10xVisiumSpatialTranscriptomics-RNA-seqLevel3', '4858', '3077', 'HTA12_25_5', '75.0', 'https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'gzip', 'HT242P1H1-S1Fc1U1Z1B1_1', 'visium_level_3_pdac/HT242P1H1-S1Fc1U1Z1B1_1-barcodes.tsv.gz', 'HTA12_25_2002', 'spaceranger-1.2.1', '84.5', 'HTAN WUSTL', 'syn51204095', 8, 25674, '75c11d8d207153ecabc0b1d824516d79', 'Release 3.0', NULL);