-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.10xvisium_spatialtranscriptomics_scRNAseq_level2_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"),
  Checksum STRING OPTIONS(description="MD5 checksum of the BAM file"),
  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_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  UMI_Tag STRING OPTIONS(description="SAM tag for the UMI field; please provide a valid UB, UMI (e.g. UB:Z or UR:Z)"),
  Whitelist_Spatial_Barcode_File_Link STRING OPTIONS(description="Link to file listing all possible spatial barcodes. URL"),
  Spatial_Barcode_Tag STRING OPTIONS(description="SAM tag for spot barcode field; please provide a valid spot barcode tag (e.g. CB:Z)"),
  Applied_Hard_Trimming STRING OPTIONS(description="Was Hard Trimming applied"),
  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"),
  Genomic_Reference STRING OPTIONS(description="Exact version of the human genome reference used in the alignment of reads (e.g. GCF_000001405.39)"),
  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)"),
  Genome_Annotation_URL STRING OPTIONS(description="Link to the human genome annotation (GTF) file (e.g. ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_34/gencode.v34.annotation.gtf.gz)"),
  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"),
  Run_ID STRING OPTIONS(description="A unique identifier for this individual run (typically associated with a single slide) of the spatial transcriptomic processing workflow."),
  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"),
  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 2 METADATA R3 VERSIONED",
  description="This table contains the file metadata for second level (i.e. BAM files) 10x Genomics Visium sequencing 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_level2_metadata_r3` (Component, Filename, Checksum, HTAN_Data_File_ID, HTAN_Parent_Data_File_ID, UMI_Tag, Whitelist_Spatial_Barcode_File_Link, Spatial_Barcode_Tag, Applied_Hard_Trimming, Workflow_Version, Workflow_Link, Genomic_Reference, Genomic_Reference_URL, Genome_Annotation_URL, HTAN_Parent_Biospecimen_ID, Run_ID, Capture_Area, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid, File_Size, md5, CDS_Release) VALUES ('10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'visium_level_2_ccrcc23_bam/HT282N1-S1H3Fs4U1Bp1_possorted_genome_bam.bam', 'b78d01bcc65783e18509830f5ceac27f', 'HTA12_33_2001', 'HTA12_33_1001,HTA12_33_1002', 'UR:Z', 'https://github.com/simoncmo/HTAN/blob/main/Spatial_preprocessing/Barcode_whitelist/spaceranger1.3.0/visium-v1_coordinates.txt', 'CB:Z', 'No', 'spaceranger-1.3', 'https://github.com/simoncmo/HTAN/blob/main/Spatial_preprocessing/run_spaceranger_1.3_FFPE.sh', 'refdata-gex-GRCh38-2020-A', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'HTA12_33_1', 'HT282N1-S1H3Fs4U1Bp1', 'C1', 'syn51202923', 'HTAN WUSTL', 'Release 3.0', 8, 'fa9cb316-b304-4cb7-9741-e2e9e6f84e3c', 17692838509, 'b78d01bcc65783e18509830f5ceac27f', NULL), ('10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'visium_level_2_ccrcc23_bam/HT293N1-S1H3Fs1U1Bp1_possorted_genome_bam.bam', '6eb67a40b7bbf8160cc4cfc4d738c4a7', 'HTA12_34_2001', 'HTA12_34_1001,HTA12_34_1002', 'UR:Z', 'https://github.com/simoncmo/HTAN/blob/main/Spatial_preprocessing/Barcode_whitelist/spaceranger1.3.0/visium-v1_coordinates.txt', 'CB:Z', 'No', 'spaceranger-1.3', 'https://github.com/simoncmo/HTAN/blob/main/Spatial_preprocessing/run_spaceranger_1.3_FFPE.sh', 'refdata-gex-GRCh38-2020-A', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'HTA12_34_1', 'HT293N1-S1H3Fs1U1Bp1', 'D1', 'syn51202924', 'HTAN WUSTL', 'Release 3.0', 8, 'efe92c94-3d76-4d8d-8fb7-5ce018a4b3be', 20956253320, '6eb67a40b7bbf8160cc4cfc4d738c4a7', NULL), ('10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'visium_level_2_pdac_bam/HT232P1H2A2-possorted_genome_bam.bam', '2a9356ba7a42498b216dc65c33384755', 'HTA12_24_2003', 'HTA12_24_1011,HTA12_24_1012', 'UR:Z', 'https://kb.10xgenomics.com/hc/en-us/articles/115004506263-What-is-a-barcode-whitelist-', 'CB:Z', 'No', 'spaceranger-1.1.0', 'https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'refdata-gex-GRCh38-2020-A', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'HTA12_24_6', 'HT232P1H2A2', 'D1', 'syn51201378', 'HTAN WUSTL', 'Release 3.0', 6, 'a12d36ca-6182-4bd9-9b9b-46b22c0644e4', 20251335735, '2a9356ba7a42498b216dc65c33384755', NULL), ('10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'visium_level_2_pdac_bam/HT242P1H1-S1Fc1U1Z1B1_1-possorted_genome_bam.bam', 'fb9b3a8b7307f08c7154e062278870f0', 'HTA12_25_2002', 'HTA12_25_1009,HTA12_25_1010', 'UR:Z', 'https://kb.10xgenomics.com/hc/en-us/articles/115004506263-What-is-a-barcode-whitelist-', 'CB:Z', 'No', 'spaceranger-1.2.1', 'https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'refdata-gex-GRCh38-2020-A', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'HTA12_25_5', 'HT242P1H1-S1Fc1U1Z1B1_1', 'A1', 'syn51201394', 'HTAN WUSTL', 'Release 3.0', 6, '4bf577d1-2c80-4ec4-bc89-991f4635e68c', 24940092102, 'fb9b3a8b7307f08c7154e062278870f0', NULL), ('10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'visium_level_2_pdac_bam/HT259P1-S1H1Fc2U1Z1Bs1-1-possorted_genome_bam.bam', '2a311437dc1d05b6c7a3bc5ee211467b', 'HTA12_26_2002', 'HTA12_26_1009,HTA12_26_1010', 'UR:Z', 'https://kb.10xgenomics.com/hc/en-us/articles/115004506263-What-is-a-barcode-whitelist-', 'CB:Z', 'No', 'spaceranger-1.2.1', 'https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'refdata-gex-GRCh38-2020-A', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'HTA12_26_5', 'HT259P1-S1H1Fc2U1Z1Bs1-1', 'A1', 'syn51201369', 'HTAN WUSTL', 'Release 3.0', 6, '4fb53775-d070-4a06-a38f-bcbfb4a895a7', 15962180482, '2a311437dc1d05b6c7a3bc5ee211467b', NULL);