-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.10xvisium_spatialtranscriptomics_scRNAseq_level2_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)"),
  Whitelist_Spatial_Barcode_File_Link STRING OPTIONS(description="Link to file listing all possible spatial barcodes. URL"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Aligned_Read_Length STRING OPTIONS(description="Read length used for alignment if hard trimming was applied"),
  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"),
  Genomic_Reference STRING OPTIONS(description="Exact version of the human genome reference used in the alignment of reads (e.g. GCF_000001405.39)"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Applied_Hard_Trimming STRING OPTIONS(description="Was Hard Trimming applied"),
  Checksum STRING OPTIONS(description="MD5 checksum of the BAM file"),
  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"),
  Spatial_Barcode_Tag STRING OPTIONS(description="SAM tag for spot barcode field; please provide a valid spot barcode tag (e.g. CB:Z)"),
  UMI_Tag STRING OPTIONS(description="SAM tag for the UMI field; please provide a valid UB, UMI (e.g. UB:Z or UR:Z)"),
  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)"),
  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)"),
  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)"),
  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 2 METADATA R4 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 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_level2_metadata_r4` (HTAN_Data_File_ID, Whitelist_Spatial_Barcode_File_Link, Id, Aligned_Read_Length, Capture_Area, entityId, Genomic_Reference, Component, Applied_Hard_Trimming, Checksum, HTAN_Parent_Biospecimen_ID, Spatial_Barcode_Tag, UMI_Tag, Workflow_Link, File_Format, Run_ID, Filename, HTAN_Parent_Data_File_ID, Workflow_Version, Genome_Annotation_URL, Genomic_Reference_URL, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('HTA12_33_2001', 'https://github.com/simoncmo/HTAN/blob/main/Spatial_preprocessing/Barcode_whitelist/spaceranger1.3.0/visium-v1_coordinates.txt', 'fa9cb316-b304-4cb7-9741-e2e9e6f84e3c', NULL, 'C1', 'syn51202923', 'refdata-gex-GRCh38-2020-A', '10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'No', 'b78d01bcc65783e18509830f5ceac27f', 'HTA12_33_1', 'CB:Z', 'UR:Z', 'https://github.com/simoncmo/HTAN/blob/main/Spatial_preprocessing/run_spaceranger_1.3_FFPE.sh', 'bam', 'HT282N1-S1H3Fs4U1Bp1', 'visium_level_2_ccrcc23_bam/HT282N1-S1H3Fs4U1Bp1_possorted_genome_bam.bam', 'HTA12_33_1001,HTA12_33_1002', 'spaceranger-1.3', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', 'HTAN WUSTL', 'syn51204556', 10, 17692838509, 'b78d01bcc65783e18509830f5ceac27f', 'Release 3.0', NULL), ('HTA12_34_2001', 'https://github.com/simoncmo/HTAN/blob/main/Spatial_preprocessing/Barcode_whitelist/spaceranger1.3.0/visium-v1_coordinates.txt', 'efe92c94-3d76-4d8d-8fb7-5ce018a4b3be', NULL, 'D1', 'syn51202924', 'refdata-gex-GRCh38-2020-A', '10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'No', '6eb67a40b7bbf8160cc4cfc4d738c4a7', 'HTA12_34_1', 'CB:Z', 'UR:Z', 'https://github.com/simoncmo/HTAN/blob/main/Spatial_preprocessing/run_spaceranger_1.3_FFPE.sh', 'bam', 'HT293N1-S1H3Fs1U1Bp1', 'visium_level_2_ccrcc23_bam/HT293N1-S1H3Fs1U1Bp1_possorted_genome_bam.bam', 'HTA12_34_1001,HTA12_34_1002', 'spaceranger-1.3', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', 'HTAN WUSTL', 'syn51204556', 10, 20956253320, '6eb67a40b7bbf8160cc4cfc4d738c4a7', 'Release 3.0', NULL), ('HTA12_24_2003', 'https://kb.10xgenomics.com/hc/en-us/articles/115004506263-What-is-a-barcode-whitelist-', 'a12d36ca-6182-4bd9-9b9b-46b22c0644e4', NULL, 'D1', 'syn51201378', 'refdata-gex-GRCh38-2020-A', '10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'No', '2a9356ba7a42498b216dc65c33384755', 'HTA12_24_6', 'CB:Z', 'UR:Z', 'https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'bam', 'HT232P1H2A2', 'visium_level_2_pdac_bam/HT232P1H2A2-possorted_genome_bam.bam', 'HTA12_24_1011,HTA12_24_1012', 'spaceranger-1.1.0', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', 'HTAN WUSTL', 'syn51203651', 8, 20251335735, '2a9356ba7a42498b216dc65c33384755', 'Release 3.0', NULL), ('HTA12_25_2002', 'https://kb.10xgenomics.com/hc/en-us/articles/115004506263-What-is-a-barcode-whitelist-', '4bf577d1-2c80-4ec4-bc89-991f4635e68c', NULL, 'A1', 'syn51201394', 'refdata-gex-GRCh38-2020-A', '10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'No', 'fb9b3a8b7307f08c7154e062278870f0', 'HTA12_25_5', 'CB:Z', 'UR:Z', 'https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'bam', 'HT242P1H1-S1Fc1U1Z1B1_1', 'visium_level_2_pdac_bam/HT242P1H1-S1Fc1U1Z1B1_1-possorted_genome_bam.bam', 'HTA12_25_1009,HTA12_25_1010', 'spaceranger-1.2.1', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', 'HTAN WUSTL', 'syn51203651', 8, 24940092102, 'fb9b3a8b7307f08c7154e062278870f0', 'Release 3.0', NULL), ('HTA12_26_2002', 'https://kb.10xgenomics.com/hc/en-us/articles/115004506263-What-is-a-barcode-whitelist-', '4fb53775-d070-4a06-a38f-bcbfb4a895a7', NULL, 'A1', 'syn51201369', 'refdata-gex-GRCh38-2020-A', '10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'No', '2a311437dc1d05b6c7a3bc5ee211467b', 'HTA12_26_5', 'CB:Z', 'UR:Z', 'https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'bam', 'HT259P1-S1H1Fc2U1Z1Bs1-1', 'visium_level_2_pdac_bam/HT259P1-S1H1Fc2U1Z1Bs1-1-possorted_genome_bam.bam', 'HTA12_26_1009,HTA12_26_1010', 'spaceranger-1.2.1', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', 'HTAN WUSTL', 'syn51203651', 8, 15962180482, '2a311437dc1d05b6c7a3bc5ee211467b', 'Release 3.0', NULL);