-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.10xvisium_spatialtranscriptomics_scRNAseq_level3_metadata_r5`
(
  Workflow_Link STRING OPTIONS(description="Link to workflow or command. DockStore.org recommended. URL"),
  Visium_File_Type STRING OPTIONS(description="The file type generated for the visium experiment."),
  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)"),
  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."),
  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."),
  HTAN_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  Proportion_Reads_Mapped STRING OPTIONS(description="Proportion of mapped reads collected from samtools. Number"),
  Median_UMI_Counts_per_Spot STRING OPTIONS(description="The median number of UMI counts per tissue covered spot."),
  Workflow_Version STRING OPTIONS(description="Major version of the workflow (e.g. Cell Ranger v3.1)"),
  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"),
  Filename STRING OPTIONS(description="Name of a file"),
  Spots_under_tissue STRING OPTIONS(description="The number of barcodes associated with a spot under tissue."),
  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."),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  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."),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  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)."),
  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."),
  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 R5 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 April 2024 and corresponds to HTAN Data Release 5.1. More details: see https://data.humantumoratlas.org/standard/spatial_transcriptomics",
  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_r5` (Workflow_Link, Visium_File_Type, HTAN_Data_File_ID, Component, Median_Number_Genes_per_Spatial_Spot, File_Format, Run_ID, HTAN_Parent_Data_File_ID, Proportion_Reads_Mapped, Median_UMI_Counts_per_Spot, Workflow_Version, HTAN_Parent_Biospecimen_ID, Filename, Spots_under_tissue, Proportion_Reads_Mapped_to_Transcriptome, entityId, Capture_Area, Id, Sequencing_Saturation, Mean_Reads_per_Spatial_Spot, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('https://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/using/mkfastq', 'barcodes', 'HTA1_336_522130416', '10xVisiumSpatialTranscriptomics-RNA-seqLevel3', '3407', 'tsv', 'HTA1_336_5221304_V10U24-037_A', 'HTA1_336_522130409', '83.90%', '12439', 'SpaceRanger v1.2.0', 'HTA1_336_5221304', 'visium_level_3_lung/V10U24-037_A_filtered_barcodes.tsv.gz', '1715', '69.40%', 'syn26017536', 'A', '6db7eca4-b379-4288-81b7-a69d813ddf49', '52.20%', '59244', 'HTAN HTAPP', 'syn51300141', 4, 10073, '05def0ab54d3313c3fd8ffebc331b9f8', 'Release 5.1', NULL), ('https://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/using/mkfastq', 'features', 'HTA1_336_522130417', '10xVisiumSpatialTranscriptomics-RNA-seqLevel3', '3407', 'tsv', 'HTA1_336_5221304_V10U24-037_A', 'HTA1_336_522130409', '83.90%', '12439', 'SpaceRanger v1.2.0', 'HTA1_336_5221304', 'visium_level_3_lung/V10U24-037_A_filtered_features.tsv.gz', '1715', '69.40%', 'syn26017537', 'A', 'f6541a4c-5614-43f9-b38e-9f58c95e6c18', '52.20%', '59244', 'HTAN HTAPP', 'syn51300141', 4, 333437, 'a7ee94edb2fb99e96a1c429dbb3b848c', 'Release 5.1', NULL), ('https://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/using/mkfastq', 'filtered mex', 'HTA1_336_522130418', '10xVisiumSpatialTranscriptomics-RNA-seqLevel3', '3407', 'mtx', 'HTA1_336_5221304_V10U24-037_A', 'HTA1_336_522130409', '83.90%', '12439', 'SpaceRanger v1.2.0', 'HTA1_336_5221304', 'visium_level_3_lung/V10U24-037_A_filtered_matrix.mtx.gz', '1715', '69.40%', 'syn26017538', 'A', '282de39a-2201-40ac-9e69-6bb8d0fe04a1', '52.20%', '59244', 'HTAN HTAPP', 'syn51300141', 4, 21987351, 'b47d4c9d1c1d828b6e6435756bad80ac', 'Release 5.1', NULL), ('https://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/using/mkfastq', 'barcodes', 'HTA1_336_522130419', '10xVisiumSpatialTranscriptomics-RNA-seqLevel3', '3407', 'tsv', 'HTA1_336_5221304_V10U24-037_A', 'HTA1_336_522130409', '83.90%', '12439', 'SpaceRanger v1.2.0', 'HTA1_336_5221304', 'visium_level_3_lung/V10U24-037_A_raw_barcodes.tsv.gz', '1715', '69.40%', 'syn26017533', 'A', '7fcc042f-fcc8-4a4b-a90d-0f9e802cef30', '52.20%', '59244', 'HTAN HTAPP', 'syn51300141', 4, 25674, '75c11d8d207153ecabc0b1d824516d79', 'Release 5.1', NULL), ('https://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/using/mkfastq', 'features', 'HTA1_336_522130420', '10xVisiumSpatialTranscriptomics-RNA-seqLevel3', '3407', 'tsv', 'HTA1_336_5221304_V10U24-037_A', 'HTA1_336_522130409', '83.90%', '12439', 'SpaceRanger v1.2.0', 'HTA1_336_5221304', 'visium_level_3_lung/V10U24-037_A_raw_features.tsv.gz', '1715', '69.40%', 'syn26017534', 'A', '4d3d3fd1-7cff-40f9-a3d6-445ccb4a4220', '52.20%', '59244', 'HTAN HTAPP', 'syn51300141', 4, 294478, 'ac13e8a24bb4395fd044463c54f68a06', 'Release 5.1', NULL);