-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.10xvisium_spatialtranscriptomics_scRNAseq_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_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"),
  HTAN_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  Run_ID STRING OPTIONS(description="A unique identifier for this individual run (typically associated with a single slide) of the spatial transcriptomic processing workflow."),
  Visium_File_Type STRING OPTIONS(description="The file type generated for the visium experiment."),
  Workflow_Version STRING OPTIONS(description="Major version of the workflow (e.g. Cell Ranger v3.1)"),
  Workflow_Link STRING OPTIONS(description="Link to workflow or command. DockStore.org recommended. URL"),
  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."),
  Spots_under_tissue STRING OPTIONS(description="Description unavailable. Contact HTAN DCC for more information"),
  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_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."),
  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)."),
  Proportion_Reads_Mapped STRING OPTIONS(description="Proportion of mapped reads collected from samtools. Number"),
  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."),
  Median_UMI_Counts_per_Spot STRING OPTIONS(description="The median number of UMI counts per tissue covered spot."),
  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 3 METADATA R3 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 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_level3_metadata_r3` (Component, Filename, File_Format, HTAN_Data_File_ID, HTAN_Parent_Biospecimen_ID, HTAN_Parent_Data_File_ID, Run_ID, Visium_File_Type, Workflow_Version, Workflow_Link, Capture_Area, Spots_under_tissue, Mean_Reads_per_Spatial_Spot, Median_Number_Genes_per_Spatial_Spot, Sequencing_Saturation, Proportion_Reads_Mapped, Proportion_Reads_Mapped_to_Transcriptome, Median_UMI_Counts_per_Spot, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid, File_Size, md5, CDS_Release) VALUES ('10xVisiumSpatialTranscriptomics-RNA-seqLevel3', 'visium_level_3_ccrcc23/HT282N1-S1H3Fs4U1Bp1_barcodes.tsv.gz', 'gzip', 'HTA12_33_3001', 'HTA12_33_1', 'HTA12_33_2001', 'HT282N1-S1H3Fs4U1Bp1', 'barcodes', 'spaceranger-1.3', 'https://github.com/simoncmo/HTAN/blob/main/Spatial_preprocessing/run_spaceranger_1.3_FFPE.sh', 'C1', '4004', '30471.5', '4041', '0.64', NULL, '98.8%', '8912', 'syn51202902', 'HTAN WUSTL', 'Release 3.0', 6, '35785a46-4f6b-4748-bde3-6ee1f6703887', 25674, '75c11d8d207153ecabc0b1d824516d79', NULL), ('10xVisiumSpatialTranscriptomics-RNA-seqLevel3', 'visium_level_3_ccrcc23/HT282N1-S1H3Fs4U1Bp1_features.tsv.gz', 'gzip', 'HTA12_33_3002', 'HTA12_33_1', 'HTA12_33_2001', 'HT282N1-S1H3Fs4U1Bp1', 'features', 'spaceranger-1.3', 'https://github.com/simoncmo/HTAN/blob/main/Spatial_preprocessing/run_spaceranger_1.3_FFPE.sh', 'C1', '4004', '30471.5', '4041', '0.64', NULL, '98.8%', '8912', 'syn51202903', 'HTAN WUSTL', 'Release 3.0', 6, '81695c99-5840-44d2-b79c-9194d87e4994', 297011, '61676744f853b21947a63839feec88e7', NULL), ('10xVisiumSpatialTranscriptomics-RNA-seqLevel3', 'visium_level_3_ccrcc23/HT282N1-S1H3Fs4U1Bp1_matrix.mtx.gz', 'gzip', 'HTA12_33_3003', 'HTA12_33_1', 'HTA12_33_2001', 'HT282N1-S1H3Fs4U1Bp1', 'unfiltered mex', 'spaceranger-1.3', 'https://github.com/simoncmo/HTAN/blob/main/Spatial_preprocessing/run_spaceranger_1.3_FFPE.sh', 'C1', '4004', '30471.5', '4041', '0.64', NULL, '98.8%', '8912', 'syn51202905', 'HTAN WUSTL', 'Release 3.0', 6, '1a4605b7-bba6-4493-8bdd-7f52bb4e483b', 64430886, 'cb44bbd1c35487718ea35b73fbf24c61', NULL), ('10xVisiumSpatialTranscriptomics-RNA-seqLevel3', 'visium_level_3_ccrcc23/HT282N1-S1H3Fs4U1Bp1_tissue_positions_list.csv', 'csv', 'HTA12_33_3006', 'HTA12_33_1', 'HTA12_33_2001', 'HT282N1-S1H3Fs4U1Bp1', 'tissue_positions', 'spaceranger-1.3', 'https://github.com/simoncmo/HTAN/blob/main/Spatial_preprocessing/run_spaceranger_1.3_FFPE.sh', 'C1', '4004', '30471.5', '4041', '0.64', NULL, '98.8%', '8912', 'syn51204447', 'HTAN WUSTL', 'Release 3.0', 6, 'ba27e87b-1979-41c9-8022-b4a8d201a43d', 189758, 'e3d6884c2a997764bf8e6eba2ed2a956', NULL), ('10xVisiumSpatialTranscriptomics-RNA-seqLevel3', 'visium_level_3_ccrcc23/HT293N1-S1H3Fs1U1Bp1_barcodes.tsv.gz', 'gzip', 'HTA12_34_3001', 'HTA12_34_1', 'HTA12_34_2001', 'HT293N1-S1H3Fs1U1Bp1', 'barcodes', 'spaceranger-1.3', 'https://github.com/simoncmo/HTAN/blob/main/Spatial_preprocessing/run_spaceranger_1.3_FFPE.sh', 'D1', '2548', '56115.4', '6742', '0.62', NULL, '98.7%', '19576', 'syn51204451', 'HTAN WUSTL', 'Release 3.0', 6, '4f78c673-925b-43e1-8e9e-c375e189b396', 25674, '75c11d8d207153ecabc0b1d824516d79', NULL);